@camunda/design-system 0.37.0 → 0.40.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/date-picker.d.ts +1 -1
- package/dist/carbon-compat/date-picker.d.ts.map +1 -1
- package/dist/carbon-compat/date-picker.js +78 -30
- package/dist/carbon-compat/date-picker.js.map +1 -1
- package/dist/carbon-compat/heading.d.ts +18 -1
- package/dist/carbon-compat/heading.d.ts.map +1 -1
- package/dist/carbon-compat/heading.js +16 -2
- package/dist/carbon-compat/heading.js.map +1 -1
- 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/alert-dialog.d.ts.map +1 -1
- package/dist/src/components/ui/alert-dialog.js +4 -1
- package/dist/src/components/ui/alert-dialog.js.map +1 -1
- package/dist/src/components/ui/alert.d.ts.map +1 -1
- package/dist/src/components/ui/alert.js +2 -1
- package/dist/src/components/ui/alert.js.map +1 -1
- package/dist/src/components/ui/app-header.d.ts +17 -1
- package/dist/src/components/ui/app-header.d.ts.map +1 -1
- package/dist/src/components/ui/app-header.js +11 -2
- package/dist/src/components/ui/app-header.js.map +1 -1
- package/dist/src/components/ui/calendar.d.ts.map +1 -1
- package/dist/src/components/ui/calendar.js +16 -5
- package/dist/src/components/ui/calendar.js.map +1 -1
- package/dist/src/components/ui/card.d.ts.map +1 -1
- package/dist/src/components/ui/card.js +6 -1
- package/dist/src/components/ui/card.js.map +1 -1
- package/dist/src/components/ui/chart.d.ts +9 -3
- package/dist/src/components/ui/chart.d.ts.map +1 -1
- package/dist/src/components/ui/chart.js +74 -13
- package/dist/src/components/ui/chart.js.map +1 -1
- package/dist/src/components/ui/data-table.d.ts.map +1 -1
- package/dist/src/components/ui/data-table.js +3 -2
- package/dist/src/components/ui/data-table.js.map +1 -1
- package/dist/src/components/ui/date-range-picker.d.ts +25 -0
- package/dist/src/components/ui/date-range-picker.d.ts.map +1 -0
- package/dist/src/components/ui/date-range-picker.js +70 -0
- package/dist/src/components/ui/date-range-picker.js.map +1 -0
- package/dist/src/components/ui/dialog.d.ts.map +1 -1
- package/dist/src/components/ui/dialog.js +7 -3
- package/dist/src/components/ui/dialog.js.map +1 -1
- package/dist/src/components/ui/dropdown.d.ts +2 -2
- package/dist/src/components/ui/dropdown.d.ts.map +1 -1
- package/dist/src/components/ui/dropdown.js +9 -5
- package/dist/src/components/ui/dropdown.js.map +1 -1
- package/dist/src/components/ui/multi-select.d.ts.map +1 -1
- package/dist/src/components/ui/multi-select.js +2 -2
- package/dist/src/components/ui/multi-select.js.map +1 -1
- package/dist/src/components/ui/nav-breadcrumb.d.ts +77 -8
- package/dist/src/components/ui/nav-breadcrumb.d.ts.map +1 -1
- package/dist/src/components/ui/nav-breadcrumb.js +105 -13
- package/dist/src/components/ui/nav-breadcrumb.js.map +1 -1
- 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/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/popover.d.ts +1 -1
- package/dist/src/components/ui/popover.d.ts.map +1 -1
- package/dist/src/components/ui/popover.js +4 -1
- package/dist/src/components/ui/popover.js.map +1 -1
- package/dist/src/components/ui/sheet.d.ts.map +1 -1
- package/dist/src/components/ui/sheet.js +4 -1
- package/dist/src/components/ui/sheet.js.map +1 -1
- package/dist/src/components/ui/sparkline.js +1 -1
- package/dist/src/components/ui/sparkline.js.map +1 -1
- package/dist/src/components/ui/typography.d.ts +34 -0
- package/dist/src/components/ui/typography.d.ts.map +1 -0
- package/dist/src/components/ui/typography.js +56 -0
- package/dist/src/components/ui/typography.js.map +1 -0
- package/dist/src/examples/agent-control-plane-processes/DashboardPage.js +2 -2
- package/dist/src/examples/agent-control-plane-processes/DashboardPage.js.map +1 -1
- package/dist/src/examples/agent-control-plane-processes/derive.d.ts.map +1 -1
- package/dist/src/examples/agent-control-plane-processes/derive.js +12 -12
- package/dist/src/examples/agent-control-plane-processes/derive.js.map +1 -1
- package/dist/src/index.d.ts +6 -2
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +4 -1
- package/dist/src/index.js.map +1 -1
- package/dist/styles.css +111 -31
- package/package.json +5 -5
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
/**
|
|
3
|
+
* Header tool panels — the button-plus-panel system that carries app chrome (notifications,
|
|
4
|
+
* info, help, user).
|
|
5
|
+
*
|
|
6
|
+
* The panel is a **disclosure**, not a dialog: opening it leaves focus on the trigger and moving
|
|
7
|
+
* focus away does not close it. Escape and an outside pointer-down do close it, which a plain
|
|
8
|
+
* disclosure would not do, but neither is focus-based so neither contradicts the role.
|
|
9
|
+
*/
|
|
10
|
+
/** What the header hands a tool's trigger component. */
|
|
11
|
+
export interface ToolButtonProps {
|
|
12
|
+
onClick: () => void;
|
|
13
|
+
isActive: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Spread onto the rendered button. The consumer owns that element, so the design system
|
|
16
|
+
* cannot put the disclosure wiring on it from outside — cloning the returned node instead
|
|
17
|
+
* silently no-ops whenever `renderButton` returns a Fragment or a wrapper.
|
|
18
|
+
*
|
|
19
|
+
* `aria-controls` appears only while this tool's panel is open, because it must reference an
|
|
20
|
+
* element that exists.
|
|
21
|
+
*/
|
|
22
|
+
buttonProps: {
|
|
23
|
+
id: string;
|
|
24
|
+
"aria-expanded": boolean;
|
|
25
|
+
"aria-controls"?: string;
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* A panel, or a function receiving `close`.
|
|
30
|
+
*
|
|
31
|
+
* The function form exists because the panel gets no chrome from the design system: C3 ships
|
|
32
|
+
* none either (`panel-primitives` exports a header and a title, no close button), and its
|
|
33
|
+
* notifications panel deliberately stays open over the destination the user just navigated to.
|
|
34
|
+
* A panel that does want a close affordance would otherwise have no way to dismiss itself.
|
|
35
|
+
*/
|
|
36
|
+
export type ToolPanelContent = React.ReactNode | ((props: {
|
|
37
|
+
close: () => void;
|
|
38
|
+
}) => React.ReactNode);
|
|
39
|
+
export interface ToolDescriptor {
|
|
40
|
+
key: string;
|
|
41
|
+
label: string;
|
|
42
|
+
/**
|
|
43
|
+
* Rendered as a component (`<tool.renderButton … />`), never called as a function, so it may
|
|
44
|
+
* use hooks — C3's notifications tool reads a context inside it to drive its unread badge.
|
|
45
|
+
*
|
|
46
|
+
* Its identity is therefore a component identity: build the `tools` array outside render or
|
|
47
|
+
* memoize it, or every button unmounts and remounts on each render, dropping focus, hover and
|
|
48
|
+
* any open tooltip.
|
|
49
|
+
*/
|
|
50
|
+
renderButton: (props: ToolButtonProps) => React.ReactNode;
|
|
51
|
+
/** Omit for a tool that only acts — its click is inert and the action lives in `renderButton`. */
|
|
52
|
+
panel?: ToolPanelContent;
|
|
53
|
+
/** Width of this tool's panel on `sm` and up. Default `"20rem"` (C3's 320px). */
|
|
54
|
+
panelWidth?: string;
|
|
55
|
+
}
|
|
56
|
+
export interface UseHeaderToolsOptions {
|
|
57
|
+
tools?: ToolDescriptor[];
|
|
58
|
+
activeToolKey?: string | null;
|
|
59
|
+
onActiveToolChange?: (key: string | null) => void;
|
|
60
|
+
/** Namespaces the generated trigger and panel ids. */
|
|
61
|
+
idPrefix: string;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Owns which tool is open.
|
|
65
|
+
*
|
|
66
|
+
* `activeToolKey` has three states, not two: `undefined` is uncontrolled, `null` is controlled
|
|
67
|
+
* with nothing open, and a string is controlled with that tool open. A consumer passing `null`
|
|
68
|
+
* to mean "you decide" enters controlled mode permanently, so that distinction has to survive.
|
|
69
|
+
*/
|
|
70
|
+
export declare function useHeaderTools({ tools, activeToolKey, onActiveToolChange, idPrefix, }: UseHeaderToolsOptions): {
|
|
71
|
+
activeTool: ToolDescriptor | null;
|
|
72
|
+
activeKey: string | null;
|
|
73
|
+
toggleTool: (tool: ToolDescriptor) => void;
|
|
74
|
+
setActiveKey: (key: string | null) => void;
|
|
75
|
+
panelId: string;
|
|
76
|
+
triggerId: (key: string) => string;
|
|
77
|
+
};
|
|
78
|
+
export interface HeaderToolsProps {
|
|
79
|
+
tools: ToolDescriptor[];
|
|
80
|
+
activeTool: ToolDescriptor | null;
|
|
81
|
+
activeKey: string | null;
|
|
82
|
+
toggleTool: (tool: ToolDescriptor) => void;
|
|
83
|
+
setActiveKey: (key: string | null) => void;
|
|
84
|
+
panelId: string;
|
|
85
|
+
triggerId: (key: string) => string;
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* The trigger row plus, when a tool is open, its portaled panel.
|
|
89
|
+
*
|
|
90
|
+
* Tab from an expanded trigger moves focus into the panel. Without it a disclosure whose panel
|
|
91
|
+
* is portaled to the end of `<body>` is reachable only by tabbing the whole page — the panel
|
|
92
|
+
* sits beside its trigger visually but nowhere near it in the tab sequence.
|
|
93
|
+
*/
|
|
94
|
+
export declare function HeaderTools({ tools, activeTool, activeKey, toggleTool, setActiveKey, panelId, triggerId, }: HeaderToolsProps): React.JSX.Element;
|
|
95
|
+
//# sourceMappingURL=nav-tools.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nav-tools.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/nav-tools.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAQ/B;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EAAE,cAAc,GAAG,IAAI,CAAC;IAClC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,UAAU,EAAE,CAAC,IAAI,EAAE,cAAc,KAAK,IAAI,CAAC;IAC3C,YAAY,EAAE,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;IAC3C,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,CAAC;CACpC;AAED;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,EAC1B,KAAK,EACL,UAAU,EACV,SAAS,EACT,UAAU,EACV,YAAY,EACZ,OAAO,EACP,SAAS,GACV,EAAE,gBAAgB,qBAuDlB"}
|
|
@@ -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,MA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|
+
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,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AG,EAAE,CAAC,CAAC,CAAC,EAAE,EACtC,SAAS,EAAC,wCAAwC,YAEjD,WAAW,GACN,CACT,IACI,CACR,CAAC;4BACJ,CAAC,GACD,CACH,IACG,IACW,GACJ,CAClB,CAAC;AACJ,CAAC;AAED,OAAO,EAAE,QAAQ,EAAE,CAAC"}
|
|
@@ -13,7 +13,7 @@ declare function PopoverContent({ className, align, sideOffset, onOpenAutoFocus,
|
|
|
13
13
|
}): React.JSX.Element;
|
|
14
14
|
declare function PopoverAnchor({ ...props }: React.ComponentProps<typeof PopoverPrimitive.Anchor>): React.JSX.Element;
|
|
15
15
|
declare function PopoverHeader({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
16
|
-
declare function PopoverTitle({ className, ...props }: React.ComponentProps<"
|
|
16
|
+
declare function PopoverTitle({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
17
17
|
declare function PopoverDescription({ className, ...props }: React.ComponentProps<"p">): React.JSX.Element;
|
|
18
18
|
export { Popover, PopoverAnchor, PopoverContent, PopoverDescription, PopoverHeader, PopoverTitle, PopoverTrigger, };
|
|
19
19
|
//# sourceMappingURL=popover.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"popover.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/popover.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"popover.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/popover.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAWvD,iBAAS,OAAO,CAAC,EACf,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,gBAAgB,CAAC,IAAI,CAAC,qBAEpD;AAED,iBAAS,cAAc,CAAC,EACtB,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,gBAAgB,CAAC,OAAO,CAAC,qBAEvD;AAED,iBAAS,cAAc,CAAC,EACtB,SAAS,EACT,KAAgB,EAChB,UAAc,EACd,eAAe,EACf,gBAAgB,EAChB,eAAe,EACf,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,gBAAgB,CAAC,OAAO,CAAC,GAAG;IACzD;;;;;OAKG;IACH,eAAe,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC;CACvD,qBA+BA;AAED,iBAAS,aAAa,CAAC,EACrB,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,gBAAgB,CAAC,MAAM,CAAC,qBAEtD;AAED,iBAAS,aAAa,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,qBAQ1E;AAED,iBAAS,YAAY,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,qBAUzE;AAED,iBAAS,kBAAkB,CAAC,EAC1B,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,GAAG,CAAC,qBAQ3B;AAED,OAAO,EACL,OAAO,EACP,aAAa,EACb,cAAc,EACd,kBAAkB,EAClB,aAAa,EACb,YAAY,EACZ,cAAc,GACf,CAAC"}
|
|
@@ -2,6 +2,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
import { Popover as PopoverPrimitive } from "radix-ui";
|
|
4
4
|
import { cn } from "../../lib/utils.js";
|
|
5
|
+
import { typographyVariants } from "./typography.js";
|
|
5
6
|
import { composeCloseAutoFocus, composeOpenAutoFocus, useDialogFocusReturn, } from "../../lib/focus-visible-on-close.js";
|
|
6
7
|
import { C4Provider } from "./c4-provider.js";
|
|
7
8
|
function Popover({ ...props }) {
|
|
@@ -28,7 +29,9 @@ function PopoverHeader({ className, ...props }) {
|
|
|
28
29
|
return (_jsx("div", { "data-slot": "popover-header", className: cn("flex flex-col gap-0.5 text-sm", className), ...props }));
|
|
29
30
|
}
|
|
30
31
|
function PopoverTitle({ className, ...props }) {
|
|
31
|
-
|
|
32
|
+
// Share the type scale via `typographyVariants`; kept as a <div> (not a
|
|
33
|
+
// heading element) to avoid injecting a heading into the popover context.
|
|
34
|
+
return (_jsx("div", { "data-slot": "popover-title", className: cn(typographyVariants({ variant: "heading-xs" }), className), ...props }));
|
|
32
35
|
}
|
|
33
36
|
function PopoverDescription({ className, ...props }) {
|
|
34
37
|
return (_jsx("p", { "data-slot": "popover-description", className: cn("text-neutral-foreground-subtle", className), ...props }));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"popover.js","sourceRoot":"","sources":["../../../../src/components/ui/popover.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAEvD,OAAO,EAAE,EAAE,EAAE,MAAM,WAAW,CAAC;AAC/B,OAAO,EACL,qBAAqB,EACrB,oBAAoB,EACpB,oBAAoB,GACrB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,SAAS,OAAO,CAAC,EACf,GAAG,KAAK,EAC2C;IACnD,OAAO,KAAC,gBAAgB,CAAC,IAAI,iBAAW,SAAS,KAAK,KAAK,GAAI,CAAC;AAClE,CAAC;AAED,SAAS,cAAc,CAAC,EACtB,GAAG,KAAK,EAC8C;IACtD,OAAO,KAAC,gBAAgB,CAAC,OAAO,iBAAW,iBAAiB,KAAK,KAAK,GAAI,CAAC;AAC7E,CAAC;AAED,SAAS,cAAc,CAAC,EACtB,SAAS,EACT,KAAK,GAAG,QAAQ,EAChB,UAAU,GAAG,CAAC,EACd,eAAe,EACf,gBAAgB,EAChB,eAAe,EACf,GAAG,KAAK,EAST;IACC,MAAM,iBAAiB,GAAG,oBAAoB,CAAC,eAAe,CAAC,CAAC;IAChE,OAAO,CACL,KAAC,gBAAgB,CAAC,MAAM,cACtB,KAAC,UAAU,cACT,KAAC,gBAAgB,CAAC,OAAO,iBACb,iBAAiB,EAC3B,KAAK,EAAE,KAAK,EACZ,UAAU,EAAE,UAAU;gBACtB,iEAAiE;gBACjE,wDAAwD;gBACxD,2BAA2B;gBAC3B,eAAe,EAAE,oBAAoB,CACnC,eAAe,EACf,iBAAiB,CAAC,eAAe,CAClC;gBACD,mEAAmE;gBACnE,sCAAsC;gBACtC,gBAAgB,EAAE,qBAAqB,CACrC,gBAAgB,EAChB,iBAAiB,CAAC,gBAAgB,CACnC,EACD,SAAS,EAAE,EAAE,CACX,yeAAye,EACze,SAAS,CACV,KACG,KAAK,GACT,GACS,GACW,CAC3B,CAAC;AACJ,CAAC;AAED,SAAS,aAAa,CAAC,EACrB,GAAG,KAAK,EAC6C;IACrD,OAAO,KAAC,gBAAgB,CAAC,MAAM,iBAAW,gBAAgB,KAAK,KAAK,GAAI,CAAC;AAC3E,CAAC;AAED,SAAS,aAAa,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAA+B;IACzE,OAAO,CACL,2BACY,gBAAgB,EAC1B,SAAS,EAAE,EAAE,CAAC,+BAA+B,EAAE,SAAS,CAAC,KACrD,KAAK,GACT,CACH,CAAC;AACJ,CAAC;AAED,SAAS,YAAY,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,
|
|
1
|
+
{"version":3,"file":"popover.js","sourceRoot":"","sources":["../../../../src/components/ui/popover.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MA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rB,GAAG,KAAK,EAC6C;IACrD,OAAO,KAAC,gBAAgB,CAAC,MAAM,iBAAW,gBAAgB,KAAK,KAAK,GAAI,CAAC;AAC3E,CAAC;AAED,SAAS,aAAa,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAA+B;IACzE,OAAO,CACL,2BACY,gBAAgB,EAC1B,SAAS,EAAE,EAAE,CAAC,+BAA+B,EAAE,SAAS,CAAC,KACrD,KAAK,GACT,CACH,CAAC;AACJ,CAAC;AAED,SAAS,YAAY,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAA+B;IACxE,wEAAwE;IACxE,0EAA0E;IAC1E,OAAO,CACL,2BACY,eAAe,EACzB,SAAS,EAAE,EAAE,CAAC,kBAAkB,CAAC,EAAE,OAAO,EAAE,YAAY,EAAE,CAAC,EAAE,SAAS,CAAC,KACnE,KAAK,GACT,CACH,CAAC;AACJ,CAAC;AAED,SAAS,kBAAkB,CAAC,EAC1B,SAAS,EACT,GAAG,KAAK,EACkB;IAC1B,OAAO,CACL,yBACY,qBAAqB,EAC/B,SAAS,EAAE,EAAE,CAAC,gCAAgC,EAAE,SAAS,CAAC,KACtD,KAAK,GACT,CACH,CAAC;AACJ,CAAC;AAED,OAAO,EACL,OAAO,EACP,aAAa,EACb,cAAc,EACd,kBAAkB,EAClB,aAAa,EACb,YAAY,EACZ,cAAc,GACf,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sheet.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/sheet.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,MAAM,IAAI,cAAc,EAAE,MAAM,UAAU,CAAC;AACpD,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"sheet.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/sheet.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK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,CAAC,KAAK,CAAC,qBAQxE;AAED,iBAAS,WAAW,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,qBAQxE;AAED,iBAAS,UAAU,CAAC,EAClB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,cAAc,CAAC,KAAK,CAAC,qBAUnD;AAED,iBAAS,gBAAgB,CAAC,EACxB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,cAAc,CAAC,WAAW,CAAC,qBAQzD;AAED,OAAO,EACL,KAAK,EACL,UAAU,EACV,YAAY,EACZ,gBAAgB,EAChB,WAAW,EACX,WAAW,EACX,YAAY,EACZ,WAAW,EACX,aAAa,EACb,UAAU,EACV,YAAY,GACb,CAAC"}
|
|
@@ -8,6 +8,7 @@ import { cn } from "../../lib/utils.js";
|
|
|
8
8
|
import { composeCloseAutoFocus, composeOpenAutoFocus, useDialogFocusReturn, } from "../../lib/focus-visible-on-close.js";
|
|
9
9
|
import { C4Provider } from "./c4-provider.js";
|
|
10
10
|
import { Button } from "../ui/button.js";
|
|
11
|
+
import { typographyVariants } from "./typography.js";
|
|
11
12
|
function Sheet({ ...props }) {
|
|
12
13
|
return _jsx(SheetPrimitive.Root, { "data-slot": "sheet", ...props });
|
|
13
14
|
}
|
|
@@ -56,7 +57,9 @@ function SheetFooter({ className, ...props }) {
|
|
|
56
57
|
return (_jsx("div", { "data-slot": "sheet-footer", className: cn("mt-auto flex flex-col gap-2 p-4", className), ...props }));
|
|
57
58
|
}
|
|
58
59
|
function SheetTitle({ className, ...props }) {
|
|
59
|
-
|
|
60
|
+
// Share the typography scale via `typographyVariants`; do NOT nest <Heading>
|
|
61
|
+
// (would break Radix's aria-labelledby wiring to this Title primitive).
|
|
62
|
+
return (_jsx(SheetPrimitive.Title, { "data-slot": "sheet-title", className: cn(typographyVariants({ variant: "heading-sm" }), className), ...props }));
|
|
60
63
|
}
|
|
61
64
|
function SheetDescription({ className, ...props }) {
|
|
62
65
|
return (_jsx(SheetPrimitive.Description, { "data-slot": "sheet-description", className: cn("text-sm text-neutral-foreground-subtle", className), ...props }));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sheet.js","sourceRoot":"","sources":["../../../../src/components/ui/sheet.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,MAAM,IAAI,cAAc,EAAE,MAAM,UAAU,CAAC;AACpD,OAAO,EAAE,GAAG,EAAqB,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAErC,OAAO,EAAE,EAAE,EAAE,MAAM,WAAW,CAAC;AAC/B,OAAO,EACL,qBAAqB,EACrB,oBAAoB,EACpB,oBAAoB,GACrB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"sheet.js","sourceRoot":"","sources":["../../../../src/components/ui/sheet.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,MAAM,IAAI,cAAc,EAAE,MAAM,UAAU,CAAC;AACpD,OAAO,EAAE,GAAG,EAAqB,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAErC,OAAO,EAAE,EAAE,EAAE,MAAM,WAAW,CAAC;AAC/B,OAAO,EACL,qBAAqB,EACrB,oBAAoB,EACpB,oBAAoB,GACrB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,MAAM,EAAE,MAAM,s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B,SAAS,EACT,GAAG,KAAK,EAC0C;IAClD,6EAA6E;IAC7E,wEAAwE;IACxE,OAAO,CACL,KAAC,cAAc,CAAC,KAAK,iBACT,aAAa,EACvB,SAAS,EAAE,EAAE,CAAC,kBAAkB,CAAC,EAAE,OAAO,EAAE,YAAY,EAAE,CAAC,EAAE,SAAS,CAAC,KACnE,KAAK,GACT,CACH,CAAC;AACJ,CAAC;AAED,SAAS,gBAAgB,CAAC,EACxB,SAAS,EACT,GAAG,KAAK,EACgD;IACxD,OAAO,CACL,KAAC,cAAc,CAAC,WAAW,iBACf,mBAAmB,EAC7B,SAAS,EAAE,EAAE,CAAC,wCAAwC,EAAE,SAAS,CAAC,KAC9D,KAAK,GACT,CACH,CAAC;AACJ,CAAC;AAED,OAAO,EACL,KAAK,EACL,UAAU,EACV,YAAY,EACZ,gBAAgB,EAChB,WAAW,EACX,WAAW,EACX,YAAY,EACZ,WAAW,EACX,aAAa,EACb,UAAU,EACV,YAAY,GACb,CAAC"}
|
|
@@ -23,7 +23,7 @@ function Sparkline({ data, dataKey, loading = false, className, }) {
|
|
|
23
23
|
// domain=["dataMin", "dataMax"] the highest/lowest point's line
|
|
24
24
|
// is centered exactly on the plot's top/bottom edge, so zero
|
|
25
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-
|
|
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-sky)", stopOpacity: "var(--chart-area-fill-opacity)" }), _jsx("stop", { offset: "100%", stopColor: "var(--chart-sky)", stopOpacity: 0 })] }) }), _jsx(YAxis, { hide: true, domain: ["dataMin", "dataMax"] }), _jsx(Area, { dataKey: dataKey, stroke: "var(--chart-sky)", strokeWidth: 2, fill: `url(#${gradientId})`, isAnimationActive: false })] }) })) }));
|
|
27
27
|
}
|
|
28
28
|
export { Sparkline };
|
|
29
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,IAAI,EACJ,OAAO,EACP,OAAO,GAAG,KAAK,EACf,SAAS,GACM;IACf,yEAAyE;IACzE,0EAA0E;IAC1E,oEAAoE;IACpE,MAAM,UAAU,GAAG,sBAAsB,KAAK,CAAC,KAAK,EAAE,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,EAAE,CAAC;IAE3E,OAAO,CACL,2BAAe,WAAW,EAAC,SAAS,EAAE,EAAE,CAAC,YAAY,EAAE,SAAS,CAAC,YAC9D,OAAO,CAAC,CAAC,CAAC,CACT,KAAC,QAAQ,IAAC,SAAS,EAAC,eAAe,GAAG,CACvC,CAAC,CAAC,CAAC,CACF,KAAC,mBAAmB,cAClB,MAAC,iBAAiB,IAChB,IAAI,EAAE,IAAI,iBACE,MAAM;gBAClB,8DAA8D;gBAC9D,6DAA6D;gBAC7D,iEAAiE;gBACjE,gEAAgE;gBAChE,kBAAkB,EAAE,KAAK;gBACzB,8DAA8D;gBAC9D,iEAAiE;gBACjE,iEAAiE;gBACjE,4DAA4D;gBAC5D,iEAAiE;gBACjE,uDAAuD;gBACvD,gEAAgE;gB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;gBAChE,kBAAkB,EAAE,KAAK;gBACzB,8DAA8D;gBAC9D,iEAAiE;gBACjE,iEAAiE;gBACjE,4DAA4D;gBAC5D,iEAAiE;gBACjE,uDAAuD;gBACvD,gEAAgE;gBAChE,6DAA6D;gBAC7D,oDAAoD;gBACpD,MAAM,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,aAEhD,yBACE,0BAAgB,EAAE,EAAE,UAAU,EAAE,EAAE,EAAC,GAAG,EAAC,EAAE,EAAC,GAAG,EAAC,EAAE,EAAC,GAAG,EAAC,EAAE,EAAC,GAAG,aACzD,eACE,MAAM,EAAC,IAAI,EACX,SAAS,EAAC,kBAAkB,EAC5B,WAAW,EAAC,gCAAgC,GAC5C,EACF,eACE,MAAM,EAAC,MAAM,EACb,SAAS,EAAC,kBAAkB,EAC5B,WAAW,EAAE,CAAC,GACd,IACa,GACZ,EACP,KAAC,KAAK,IAAC,IAAI,QAAC,MAAM,EAAE,CAAC,SAAS,EAAE,SAAS,CAAC,GAAI,EAC9C,KAAC,IAAI,IACH,OAAO,EAAE,OAAO,EAChB,MAAM,EAAC,kBAAkB,EACzB,WAAW,EAAE,CAAC,EACd,IAAI,EAAE,QAAQ,UAAU,GAAG,EAC3B,iBAAiB,EAAE,KAAK,GACxB,IACgB,GACA,CACvB,GACG,CACP,CAAC;AACJ,CAAC;AAED,OAAO,EAAE,SAAS,EAAE,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { type VariantProps } from "class-variance-authority";
|
|
3
|
+
declare const typographyVariants: (props?: ({
|
|
4
|
+
variant?: "heading-xl" | "heading-lg" | "heading-md" | "heading-sm" | "heading-xs" | "body-lg" | "body-md" | "body-sm" | "label-md" | "label-sm" | "helper" | "code-md" | "code-sm" | null | undefined;
|
|
5
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
6
|
+
type TypographyVariant = NonNullable<VariantProps<typeof typographyVariants>["variant"]>;
|
|
7
|
+
type HeadingLevel = "h1" | "h2" | "h3" | "h4" | "h5" | "h6";
|
|
8
|
+
type TextElement = "span" | "p" | "div" | "label" | "code" | "figcaption" | "strong" | "em";
|
|
9
|
+
type HeadingProps = React.HTMLAttributes<HTMLHeadingElement> & {
|
|
10
|
+
/**
|
|
11
|
+
* REQUIRED heading level, chosen from the document outline (h1 → h2 → h3,
|
|
12
|
+
* never skipping). No default: the component must never emit a level the
|
|
13
|
+
* consumer did not deliberately pick (WCAG 1.3.1 / heading-order). The
|
|
14
|
+
* visual size is chosen independently via `variant`.
|
|
15
|
+
*/
|
|
16
|
+
as: HeadingLevel;
|
|
17
|
+
variant?: TypographyVariant;
|
|
18
|
+
ref?: React.Ref<HTMLHeadingElement>;
|
|
19
|
+
};
|
|
20
|
+
type TextProps = React.HTMLAttributes<HTMLElement> & {
|
|
21
|
+
/**
|
|
22
|
+
* Rendered element. Defaults to `span` because it is valid in both inline
|
|
23
|
+
* and block contexts (a defaulted `p`/`div` would break nesting inside
|
|
24
|
+
* `label`/`button`/`td`). `variant` is decoupled from `as`.
|
|
25
|
+
*/
|
|
26
|
+
as?: TextElement;
|
|
27
|
+
variant?: TypographyVariant;
|
|
28
|
+
ref?: React.Ref<HTMLElement>;
|
|
29
|
+
};
|
|
30
|
+
declare const Heading: React.ForwardRefExoticComponent<Omit<HeadingProps, "ref"> & React.RefAttributes<HTMLHeadingElement>>;
|
|
31
|
+
declare const Text: React.ForwardRefExoticComponent<Omit<TextProps, "ref"> & React.RefAttributes<HTMLElement>>;
|
|
32
|
+
export { Heading, Text, typographyVariants };
|
|
33
|
+
export type { HeadingProps, TextProps, TypographyVariant, HeadingLevel, TextElement, };
|
|
34
|
+
//# sourceMappingURL=typography.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"typography.d.ts","sourceRoot":"","sources":["../../../../src/components/ui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sx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { cva } from "class-variance-authority";
|
|
4
|
+
import { cn } from "../../lib/utils.js";
|
|
5
|
+
import { withRef } from "../../lib/with-ref.js";
|
|
6
|
+
// Shared type scale for both `Heading` and `Text`. Source of truth:
|
|
7
|
+
// docs/specs/visual-identity.md type-scale table. `helper` is the only
|
|
8
|
+
// color-bearing step by design (subtle helper text below inputs); a consumer
|
|
9
|
+
// color utility passed via `className` wins over it through tailwind-merge.
|
|
10
|
+
const typographyVariants = cva("", {
|
|
11
|
+
variants: {
|
|
12
|
+
variant: {
|
|
13
|
+
"heading-xl": "font-heading text-3xl leading-10 font-normal",
|
|
14
|
+
"heading-lg": "font-heading text-[28px] leading-9 font-normal",
|
|
15
|
+
"heading-md": "font-heading text-xl leading-7 font-semibold",
|
|
16
|
+
"heading-sm": "font-heading text-base leading-6 font-semibold",
|
|
17
|
+
"heading-xs": "font-heading text-sm leading-[18px] font-semibold",
|
|
18
|
+
"body-lg": "text-base leading-6 font-normal",
|
|
19
|
+
"body-md": "text-sm leading-5 font-normal",
|
|
20
|
+
"body-sm": "text-sm leading-[18px] font-normal",
|
|
21
|
+
"label-md": "text-sm leading-[18px] font-normal",
|
|
22
|
+
"label-sm": "text-xs leading-4 font-normal",
|
|
23
|
+
helper: "text-xs leading-4 font-normal text-neutral-foreground-subtle",
|
|
24
|
+
"code-md": "font-mono text-sm leading-5 font-normal",
|
|
25
|
+
"code-sm": "font-mono text-xs leading-4 font-normal",
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
defaultVariants: {
|
|
29
|
+
variant: "body-md",
|
|
30
|
+
},
|
|
31
|
+
});
|
|
32
|
+
function HeadingImpl({ as, variant = "heading-md", className, ref, ...props }) {
|
|
33
|
+
// All of h1–h6 share identical intrinsic prop/ref types, so a literal-union
|
|
34
|
+
// element tag needs no cast here.
|
|
35
|
+
const Component = as;
|
|
36
|
+
return (_jsx(Component, { ref: ref, "data-slot": "heading", className: cn(typographyVariants({ variant }), className), ...props }));
|
|
37
|
+
}
|
|
38
|
+
HeadingImpl.displayName = "Heading";
|
|
39
|
+
function TextImpl({ as = "span", variant = "body-md", className, ref, ...props }) {
|
|
40
|
+
// Polymorphic element via createElement (not JSX): the constrained `as` union
|
|
41
|
+
// otherwise produces an intersected ref type across its members that no single
|
|
42
|
+
// `React.Ref<HTMLElement>` can satisfy. Widening the tag to `string` selects
|
|
43
|
+
// createElement's permissive DOM overload (same pattern as empty-state.tsx).
|
|
44
|
+
const tag = as;
|
|
45
|
+
return React.createElement(tag, {
|
|
46
|
+
...props,
|
|
47
|
+
ref,
|
|
48
|
+
"data-slot": "text",
|
|
49
|
+
className: cn(typographyVariants({ variant }), className),
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
TextImpl.displayName = "Text";
|
|
53
|
+
const Heading = withRef(HeadingImpl);
|
|
54
|
+
const Text = withRef(TextImpl);
|
|
55
|
+
export { Heading, Text, typographyVariants };
|
|
56
|
+
//# sourceMappingURL=typography.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"typography.js","sourceRoot":"","sources":["../../../../src/components/ui/typography.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,GAAG,EAAqB,MAAM,0BAA0B,CAAC;AAElE,OAAO,EAAE,EAAE,EAAE,MAAM,WAAW,CAAC;AAC/B,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvC,oEAAoE;AACpE,uEAAuE;AACvE,6EAA6E;AAC7E,4EAA4E;AAC5E,MAAM,kBAAkB,GAAG,GAAG,CAAC,EAAE,EAAE;IACjC,QAAQ,EAAE;QACR,OAAO,EAAE;YACP,YAAY,EAAE,8CAA8C;YAC5D,YAAY,EAAE,gDAAgD;YAC9D,YAAY,EAAE,8CAA8C;YAC5D,YAAY,EAAE,gDAAgD;YAC9D,YAAY,EAAE,mD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MAAM,IAAI,GAAG,OAAO,CAAyB,QAAQ,CAAC,CAAC;AAEvD,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,kBAAkB,EAAE,CAAC"}
|
|
@@ -11,10 +11,10 @@ import { topProcessesByInstances, topProcessesByTokens, } from "./summary-mock-d
|
|
|
11
11
|
const preserveOrder = () => 0;
|
|
12
12
|
const kpiGridClass = "grid grid-cols-1 gap-4 sm:grid-cols-2 xl:grid-cols-4";
|
|
13
13
|
const instancesRankingConfig = {
|
|
14
|
-
instances: { label: "Instances", color: "
|
|
14
|
+
instances: { label: "Instances", color: "chart-sky" },
|
|
15
15
|
};
|
|
16
16
|
const tokensRankingConfig = {
|
|
17
|
-
tokens: { label: "Tokens", color: "
|
|
17
|
+
tokens: { label: "Tokens", color: "chart-sky" },
|
|
18
18
|
};
|
|
19
19
|
const instanceColumns = [
|
|
20
20
|
{ accessorKey: "key", header: "Instance key" },
|