@harborclient/sdk 1.1.8 → 1.1.10
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/components/Resizable/ResizeHandle.d.ts +7 -2
- package/dist/components/Resizable/ResizeHandle.d.ts.map +1 -1
- package/dist/components/Resizable/ResizeHandle.js +6 -2
- package/dist/components/SidebarItem/SidebarColorDot.d.ts.map +1 -1
- package/dist/components/SidebarItem/SidebarColorDot.js +1 -1
- package/dist/components/SidebarItem/SidebarCommitItem.d.ts +7 -1
- package/dist/components/SidebarItem/SidebarCommitItem.d.ts.map +1 -1
- package/dist/components/SidebarItem/SidebarCommitItem.js +4 -2
- package/dist/components/SidebarItem/SidebarEnvironmentItem.d.ts +23 -15
- package/dist/components/SidebarItem/SidebarEnvironmentItem.d.ts.map +1 -1
- package/dist/components/SidebarItem/SidebarEnvironmentItem.js +20 -6
- package/dist/components/SidebarItem/SidebarFolderItem.d.ts +30 -4
- package/dist/components/SidebarItem/SidebarFolderItem.d.ts.map +1 -1
- package/dist/components/SidebarItem/SidebarFolderItem.js +26 -5
- package/dist/components/SidebarItem/SidebarHistoryItem.d.ts +9 -5
- package/dist/components/SidebarItem/SidebarHistoryItem.d.ts.map +1 -1
- package/dist/components/SidebarItem/SidebarHistoryItem.js +13 -4
- package/dist/components/SidebarItem/SidebarItem.d.ts +94 -3
- package/dist/components/SidebarItem/SidebarItem.d.ts.map +1 -1
- package/dist/components/SidebarItem/SidebarItem.js +55 -4
- package/dist/components/SidebarItem/SidebarList.d.ts +30 -0
- package/dist/components/SidebarItem/SidebarList.d.ts.map +1 -0
- package/dist/components/SidebarItem/SidebarList.js +17 -0
- package/dist/components/SidebarItem/SidebarListbox.d.ts +35 -0
- package/dist/components/SidebarItem/SidebarListbox.d.ts.map +1 -0
- package/dist/components/SidebarItem/SidebarListbox.js +18 -0
- package/dist/components/SidebarItem/SidebarMethodBadge.d.ts.map +1 -1
- package/dist/components/SidebarItem/SidebarMethodBadge.js +1 -1
- package/dist/components/SidebarItem/SidebarRequestItem.d.ts +39 -24
- package/dist/components/SidebarItem/SidebarRequestItem.d.ts.map +1 -1
- package/dist/components/SidebarItem/SidebarRequestItem.js +29 -4
- package/dist/components/SidebarItem/SidebarRunItem.d.ts +23 -6
- package/dist/components/SidebarItem/SidebarRunItem.d.ts.map +1 -1
- package/dist/components/SidebarItem/SidebarRunItem.js +15 -4
- package/dist/components/SidebarItem/SidebarStatusMarker.js +1 -1
- package/dist/components/SidebarItem/SidebarTabGroupItem.d.ts +7 -3
- package/dist/components/SidebarItem/SidebarTabGroupItem.d.ts.map +1 -1
- package/dist/components/SidebarItem/SidebarTabGroupItem.js +8 -3
- package/dist/components/SidebarItem/SidebarTree.d.ts +55 -0
- package/dist/components/SidebarItem/SidebarTree.d.ts.map +1 -0
- package/dist/components/SidebarItem/SidebarTree.js +30 -0
- package/dist/components/SidebarItem/SortableSidebarItem.d.ts +24 -5
- package/dist/components/SidebarItem/SortableSidebarItem.d.ts.map +1 -1
- package/dist/components/SidebarItem/SortableSidebarItem.js +27 -13
- package/dist/components/SidebarItem/index.d.ts +5 -1
- package/dist/components/SidebarItem/index.d.ts.map +1 -1
- package/dist/components/SidebarItem/index.js +4 -0
- package/dist/components/SidebarItem/sidebarItemClasses.d.ts +4 -0
- package/dist/components/SidebarItem/sidebarItemClasses.d.ts.map +1 -1
- package/dist/components/SidebarItem/sidebarItemClasses.js +4 -0
- package/dist/components/SidebarItem/sidebarListOption.d.ts +6 -0
- package/dist/components/SidebarItem/sidebarListOption.d.ts.map +1 -0
- package/dist/components/SidebarItem/sidebarListOption.js +10 -0
- package/dist/components/index.d.ts +1 -1
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ComponentPropsWithoutRef, JSX, KeyboardEvent as ReactKeyboardEvent, MouseEvent as ReactMouseEvent } from 'react';
|
|
2
|
-
interface Props extends Omit<ComponentPropsWithoutRef<'div'>, 'children' | 'aria-label' | 'aria-valuenow' | 'aria-valuemin' | 'aria-valuemax'> {
|
|
2
|
+
interface Props extends Omit<ComponentPropsWithoutRef<'div'>, 'children' | 'aria-label' | 'aria-valuenow' | 'aria-valuemin' | 'aria-valuemax' | 'aria-valuetext'> {
|
|
3
3
|
/**
|
|
4
4
|
* Handle orientation: horizontal resizes height, vertical resizes width.
|
|
5
5
|
*/
|
|
@@ -28,10 +28,15 @@ interface Props extends Omit<ComponentPropsWithoutRef<'div'>, 'children' | 'aria
|
|
|
28
28
|
* Accessible label for the separator.
|
|
29
29
|
*/
|
|
30
30
|
ariaLabel: string;
|
|
31
|
+
/**
|
|
32
|
+
* Formats the spoken value for assistive tech. Defaults to
|
|
33
|
+
* e.g. "Width 487 pixels" based on orientation.
|
|
34
|
+
*/
|
|
35
|
+
formatValueText?: (value: number, orientation: 'horizontal' | 'vertical') => string;
|
|
31
36
|
}
|
|
32
37
|
/**
|
|
33
38
|
* Draggable separator handle for resizable panels.
|
|
34
39
|
*/
|
|
35
|
-
export declare function ResizeHandle({ orientation, value, min, max, onResizeStart, onKeyboardResize, ariaLabel, className, ...props }: Props): JSX.Element;
|
|
40
|
+
export declare function ResizeHandle({ orientation, value, min, max, onResizeStart, onKeyboardResize, ariaLabel, formatValueText, className, ...props }: Props): JSX.Element;
|
|
36
41
|
export {};
|
|
37
42
|
//# sourceMappingURL=ResizeHandle.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ResizeHandle.d.ts","sourceRoot":"","sources":["../../../src/components/Resizable/ResizeHandle.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,wBAAwB,EACxB,GAAG,EACH,aAAa,IAAI,kBAAkB,EACnC,UAAU,IAAI,eAAe,EAC9B,MAAM,OAAO,CAAC;AAGf,UAAU,KAAM,SAAQ,IAAI,CAC1B,wBAAwB,CAAC,KAAK,CAAC,EAC/B,UAAU,GAAG,YAAY,GAAG,eAAe,GAAG,eAAe,GAAG,eAAe,
|
|
1
|
+
{"version":3,"file":"ResizeHandle.d.ts","sourceRoot":"","sources":["../../../src/components/Resizable/ResizeHandle.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,wBAAwB,EACxB,GAAG,EACH,aAAa,IAAI,kBAAkB,EACnC,UAAU,IAAI,eAAe,EAC9B,MAAM,OAAO,CAAC;AAGf,UAAU,KAAM,SAAQ,IAAI,CAC1B,wBAAwB,CAAC,KAAK,CAAC,EAC/B,UAAU,GAAG,YAAY,GAAG,eAAe,GAAG,eAAe,GAAG,eAAe,GAAG,gBAAgB,CACnG;IACC;;OAEG;IACH,WAAW,EAAE,YAAY,GAAG,UAAU,CAAC;IAEvC;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;IAEZ;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;IAEZ;;OAEG;IACH,aAAa,EAAE,CAAC,KAAK,EAAE,eAAe,KAAK,IAAI,CAAC;IAEhD;;OAEG;IACH,gBAAgB,EAAE,CAAC,KAAK,EAAE,kBAAkB,KAAK,IAAI,CAAC;IAEtD;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;;OAGG;IACH,eAAe,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,YAAY,GAAG,UAAU,KAAK,MAAM,CAAC;CACrF;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,EAC3B,WAAW,EACX,KAAK,EACL,GAAG,EACH,GAAG,EACH,aAAa,EACb,gBAAgB,EAChB,SAAS,EACT,eAAe,EACf,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,GAAG,GAAG,CAAC,OAAO,CAsCrB"}
|
|
@@ -3,11 +3,15 @@ import { cn } from '../utils.js';
|
|
|
3
3
|
/**
|
|
4
4
|
* Draggable separator handle for resizable panels.
|
|
5
5
|
*/
|
|
6
|
-
export function ResizeHandle({ orientation, value, min, max, onResizeStart, onKeyboardResize, ariaLabel, className, ...props }) {
|
|
6
|
+
export function ResizeHandle({ orientation, value, min, max, onResizeStart, onKeyboardResize, ariaLabel, formatValueText, className, ...props }) {
|
|
7
7
|
const isHorizontal = orientation === 'horizontal';
|
|
8
|
+
const dimension = isHorizontal ? 'Height' : 'Width';
|
|
9
|
+
const valueText = formatValueText
|
|
10
|
+
? formatValueText(value, orientation)
|
|
11
|
+
: `${dimension} ${Math.round(value)} pixels`;
|
|
8
12
|
return (_jsx("div", { ...props, role: "separator", tabIndex: 0, className: cn('hc-resize-handle font-inherit app-no-drag m-0 flex shrink-0 items-center justify-center bg-control p-0 text-inherit hover:bg-selection/60', isHorizontal
|
|
9
13
|
? 'h-1.5 w-full cursor-row-resize border-b border-separator'
|
|
10
|
-
: 'h-full w-1.5 cursor-col-resize border-r border-separator', className), onMouseDown: onResizeStart, onKeyDown: onKeyboardResize, "aria-orientation": orientation, "aria-label": ariaLabel, "aria-valuenow": Math.round(value), "aria-valuemin": min, "aria-valuemax": Math.round(max), children: _jsx("div", { className: isHorizontal
|
|
14
|
+
: 'h-full w-1.5 cursor-col-resize border-r border-separator', className), onMouseDown: onResizeStart, onKeyDown: onKeyboardResize, "aria-orientation": orientation, "aria-label": ariaLabel, "aria-valuenow": Math.round(value), "aria-valuemin": min, "aria-valuemax": Math.round(max), "aria-valuetext": valueText, children: _jsx("div", { className: isHorizontal
|
|
11
15
|
? 'hc-resize-handle-grip h-0.5 w-8 rounded-full bg-muted/50'
|
|
12
16
|
: 'hc-resize-handle-grip h-8 w-0.5 rounded-full bg-muted/50', "aria-hidden": true }) }));
|
|
13
17
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SidebarColorDot.d.ts","sourceRoot":"","sources":["../../../src/components/SidebarItem/SidebarColorDot.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAEjC,UAAU,KAAK;IACb;;OAEG;IACH,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IAEjC;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,EAAE,KAAK,EAAE,OAAc,EAAE,KAAK,EAAE,EAAE,KAAK,GAAG,GAAG,CAAC,OAAO,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"SidebarColorDot.d.ts","sourceRoot":"","sources":["../../../src/components/SidebarItem/SidebarColorDot.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAEjC,UAAU,KAAK;IACb;;OAEG;IACH,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IAEjC;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,EAAE,KAAK,EAAE,OAAc,EAAE,KAAK,EAAE,EAAE,KAAK,GAAG,GAAG,CAAC,OAAO,GAAG,IAAI,CAY3F"}
|
|
@@ -7,5 +7,5 @@ export function SidebarColorDot({ color, visible = true, label }) {
|
|
|
7
7
|
if (!visible || color == null || color.trim() === '') {
|
|
8
8
|
return null;
|
|
9
9
|
}
|
|
10
|
-
return (_jsx("span", { className: "inline-block h-4 w-4 shrink-0 rounded-full", style: { backgroundColor: color },
|
|
10
|
+
return (_jsx("span", { className: "inline-block h-4 w-4 shrink-0 rounded-full", style: { backgroundColor: color }, ...(label != null ? { role: 'img', 'aria-label': label } : { 'aria-hidden': true }) }));
|
|
11
11
|
}
|
|
@@ -21,11 +21,17 @@ interface Props {
|
|
|
21
21
|
* Called when the commit row button is clicked.
|
|
22
22
|
*/
|
|
23
23
|
onClick?: (event: MouseEvent<HTMLButtonElement>) => void;
|
|
24
|
+
/**
|
|
25
|
+
* HTML element for the row container. Use `li` inside {@link SidebarList}.
|
|
26
|
+
*/
|
|
27
|
+
as?: 'div' | 'li';
|
|
24
28
|
}
|
|
25
29
|
/**
|
|
26
30
|
* Renders a recent commit row in the Git sidebar Commits section.
|
|
27
31
|
* Uses a distinct two-line layout rather than the standard sourceRow shell.
|
|
32
|
+
*
|
|
33
|
+
* Wrap lists in {@link SidebarList} and pass `as="li"` for valid list semantics.
|
|
28
34
|
*/
|
|
29
|
-
export declare function SidebarCommitItem({ message, author, timestampLabel, icon, onClick }: Props): JSX.Element;
|
|
35
|
+
export declare function SidebarCommitItem({ message, author, timestampLabel, icon, onClick, as: Container }: Props): JSX.Element;
|
|
30
36
|
export {};
|
|
31
37
|
//# sourceMappingURL=SidebarCommitItem.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SidebarCommitItem.d.ts","sourceRoot":"","sources":["../../../src/components/SidebarItem/SidebarCommitItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AACxE,OAAO,KAAK,EAAE,GAAG,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAG7C,UAAU,KAAK;IACb;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,cAAc,EAAE,MAAM,CAAC;IAEvB;;OAEG;IACH,IAAI,EAAE,cAAc,CAAC;IAErB;;OAEG;IACH,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,CAAC,iBAAiB,CAAC,KAAK,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"SidebarCommitItem.d.ts","sourceRoot":"","sources":["../../../src/components/SidebarItem/SidebarCommitItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AACxE,OAAO,KAAK,EAAE,GAAG,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAG7C,UAAU,KAAK;IACb;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,cAAc,EAAE,MAAM,CAAC;IAEvB;;OAEG;IACH,IAAI,EAAE,cAAc,CAAC;IAErB;;OAEG;IACH,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,CAAC,iBAAiB,CAAC,KAAK,IAAI,CAAC;IAEzD;;OAEG;IACH,EAAE,CAAC,EAAE,KAAK,GAAG,IAAI,CAAC;CACnB;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,EAChC,OAAO,EACP,MAAM,EACN,cAAc,EACd,IAAI,EACJ,OAAO,EACP,EAAE,EAAE,SAAgB,EACrB,EAAE,KAAK,GAAG,GAAG,CAAC,OAAO,CAkBrB"}
|
|
@@ -3,7 +3,9 @@ import { FaIcon } from '../FaIcon/index.js';
|
|
|
3
3
|
/**
|
|
4
4
|
* Renders a recent commit row in the Git sidebar Commits section.
|
|
5
5
|
* Uses a distinct two-line layout rather than the standard sourceRow shell.
|
|
6
|
+
*
|
|
7
|
+
* Wrap lists in {@link SidebarList} and pass `as="li"` for valid list semantics.
|
|
6
8
|
*/
|
|
7
|
-
export function SidebarCommitItem({ message, author, timestampLabel, icon, onClick }) {
|
|
8
|
-
return (_jsxs("button", { type: "button", className: "hc-sidebar-commit-item group app-no-drag flex w-full cursor-pointer rounded-md p-2 text-left hover:bg-selection/60", onClick: onClick, children: [_jsx(FaIcon, { icon: icon, className: "mr-2 h-4 w-4 shrink-0 text-muted", "aria-hidden": true }), _jsxs("div", { className: "-mt-1.5 flex flex-col gap-0.5", children: [_jsx("span", { className: "block min-w-0 truncate font-medium text-text", children: message }), _jsxs("span", { className: "block min-w-0 truncate text-[14px] text-muted", children: [author, " \u00B7 ", timestampLabel] })] })] }));
|
|
9
|
+
export function SidebarCommitItem({ message, author, timestampLabel, icon, onClick, as: Container = 'li' }) {
|
|
10
|
+
return (_jsx(Container, { children: _jsxs("button", { type: "button", className: "hc-sidebar-commit-item group app-no-drag flex w-full cursor-pointer rounded-md p-2 text-left hover:bg-selection/60", onClick: onClick, children: [_jsx(FaIcon, { icon: icon, className: "mr-2 h-4 w-4 shrink-0 text-muted", "aria-hidden": true }), _jsxs("div", { className: "-mt-1.5 flex flex-col gap-0.5", children: [_jsx("span", { className: "block min-w-0 truncate font-medium text-text", children: message }), _jsxs("span", { className: "block min-w-0 truncate text-[14px] text-muted", children: [author, " \u00B7 ", timestampLabel] })] })] }) }));
|
|
9
11
|
}
|
|
@@ -22,37 +22,39 @@ interface Props {
|
|
|
22
22
|
*/
|
|
23
23
|
selected?: boolean;
|
|
24
24
|
/**
|
|
25
|
-
*
|
|
25
|
+
* dnd-kit sortable configuration for environment reordering.
|
|
26
26
|
*/
|
|
27
|
-
|
|
27
|
+
sortable?: SidebarItemSortableConfig;
|
|
28
28
|
/**
|
|
29
|
-
*
|
|
29
|
+
* Accessible label for the listbox option. When omitted, the name is derived
|
|
30
|
+
* from visible row content (name, variable summary).
|
|
31
|
+
*/
|
|
32
|
+
ariaLabel?: string;
|
|
33
|
+
/**
|
|
34
|
+
* Overrides the `aria-selected` state. When omitted, falls back to `selected`.
|
|
35
|
+
* Use to decouple selection semantics from highlight styling.
|
|
30
36
|
*/
|
|
31
37
|
ariaSelected?: boolean;
|
|
32
38
|
/**
|
|
33
|
-
*
|
|
39
|
+
* When true, marks the row as the current item with `aria-current="true"`.
|
|
34
40
|
*/
|
|
35
|
-
|
|
41
|
+
ariaCurrent?: boolean;
|
|
36
42
|
/**
|
|
37
43
|
* Called when the user right-clicks the row container.
|
|
38
44
|
*/
|
|
39
45
|
onContextMenu?: (event: MouseEvent<HTMLElement>) => void;
|
|
40
46
|
/**
|
|
41
|
-
* Called when the primary label
|
|
47
|
+
* Called when the primary label area is activated.
|
|
42
48
|
*/
|
|
43
|
-
onClick?: (event: MouseEvent<
|
|
49
|
+
onClick?: (event: MouseEvent<HTMLElement>) => void;
|
|
44
50
|
/**
|
|
45
|
-
* Called when the primary label
|
|
51
|
+
* Called when the primary label area is double-clicked.
|
|
46
52
|
*/
|
|
47
|
-
onDoubleClick?: () => void;
|
|
53
|
+
onDoubleClick?: (event: MouseEvent<HTMLElement>) => void;
|
|
48
54
|
/**
|
|
49
|
-
* Called when Enter is pressed on the primary label
|
|
55
|
+
* Called when Enter is pressed on the primary label area.
|
|
50
56
|
*/
|
|
51
57
|
onEnter?: () => void;
|
|
52
|
-
/**
|
|
53
|
-
* Accessible label for the primary button.
|
|
54
|
-
*/
|
|
55
|
-
ariaLabel?: string;
|
|
56
58
|
/**
|
|
57
59
|
* Trailing actions slot, typically a row actions menu.
|
|
58
60
|
*/
|
|
@@ -61,10 +63,16 @@ interface Props {
|
|
|
61
63
|
* Optional data attribute value for keyboard navigation focus targets.
|
|
62
64
|
*/
|
|
63
65
|
dataSidebarEnvironmentId?: string | number;
|
|
66
|
+
/**
|
|
67
|
+
* HTML element for the row container. Use `li` inside {@link SidebarListbox}.
|
|
68
|
+
*/
|
|
69
|
+
as?: 'div' | 'li';
|
|
64
70
|
}
|
|
65
71
|
/**
|
|
66
72
|
* Renders an environment row in the Collections sidebar Environments section.
|
|
73
|
+
*
|
|
74
|
+
* The accessible name is derived from visible row content (name, variable summary).
|
|
67
75
|
*/
|
|
68
|
-
export declare function SidebarEnvironmentItem({ name, variableSummary, colorDot, selected,
|
|
76
|
+
export declare function SidebarEnvironmentItem({ name, variableSummary, colorDot, selected, sortable, ariaLabel, ariaSelected, ariaCurrent, onContextMenu, onClick, onDoubleClick, onEnter, actions, dataSidebarEnvironmentId, as }: Props): JSX.Element;
|
|
69
77
|
export {};
|
|
70
78
|
//# sourceMappingURL=SidebarEnvironmentItem.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SidebarEnvironmentItem.d.ts","sourceRoot":"","sources":["../../../src/components/SidebarItem/SidebarEnvironmentItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAiB,UAAU,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvE,OAAO,EAAe,KAAK,yBAAyB,EAAE,MAAM,kBAAkB,CAAC;AAG/E,UAAU,KAAK;IACb;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,eAAe,EAAE,MAAM,CAAC;IAExB;;OAEG;IACH,QAAQ,CAAC,EAAE;QACT,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;QACjC,OAAO,CAAC,EAAE,OAAO,CAAC;QAClB,KAAK,CAAC,EAAE,MAAM,CAAC;KAChB,CAAC;IAEF;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;OAEG;IACH,
|
|
1
|
+
{"version":3,"file":"SidebarEnvironmentItem.d.ts","sourceRoot":"","sources":["../../../src/components/SidebarItem/SidebarEnvironmentItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAiB,UAAU,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvE,OAAO,EAAe,KAAK,yBAAyB,EAAE,MAAM,kBAAkB,CAAC;AAG/E,UAAU,KAAK;IACb;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,eAAe,EAAE,MAAM,CAAC;IAExB;;OAEG;IACH,QAAQ,CAAC,EAAE;QACT,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;QACjC,OAAO,CAAC,EAAE,OAAO,CAAC;QAClB,KAAK,CAAC,EAAE,MAAM,CAAC;KAChB,CAAC;IAEF;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;OAEG;IACH,QAAQ,CAAC,EAAE,yBAAyB,CAAC;IAErC;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;OAGG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IAEvB;;OAEG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IAEtB;;OAEG;IACH,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,CAAC,WAAW,CAAC,KAAK,IAAI,CAAC;IAEzD;;OAEG;IACH,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,CAAC,WAAW,CAAC,KAAK,IAAI,CAAC;IAEnD;;OAEG;IACH,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,CAAC,WAAW,CAAC,KAAK,IAAI,CAAC;IAEzD;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IAErB;;OAEG;IACH,OAAO,CAAC,EAAE,SAAS,CAAC;IAEpB;;OAEG;IACH,wBAAwB,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAE3C;;OAEG;IACH,EAAE,CAAC,EAAE,KAAK,GAAG,IAAI,CAAC;CACnB;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,EACrC,IAAI,EACJ,eAAe,EACf,QAAQ,EACR,QAAgB,EAChB,QAAQ,EACR,SAAS,EACT,YAAY,EACZ,WAAW,EACX,aAAa,EACb,OAAO,EACP,aAAa,EACb,OAAO,EACP,OAAO,EACP,wBAAwB,EACxB,EAAS,EACV,EAAE,KAAK,GAAG,GAAG,CAAC,OAAO,CAwDrB"}
|
|
@@ -4,18 +4,32 @@ import { SidebarItem } from './SidebarItem.js';
|
|
|
4
4
|
import { SIDEBAR_ITEM_BUTTON_CLASS } from './sidebarItemClasses.js';
|
|
5
5
|
/**
|
|
6
6
|
* Renders an environment row in the Collections sidebar Environments section.
|
|
7
|
+
*
|
|
8
|
+
* The accessible name is derived from visible row content (name, variable summary).
|
|
7
9
|
*/
|
|
8
|
-
export function SidebarEnvironmentItem({ name, variableSummary, colorDot, selected = false,
|
|
10
|
+
export function SidebarEnvironmentItem({ name, variableSummary, colorDot, selected = false, sortable, ariaLabel, ariaSelected, ariaCurrent, onContextMenu, onClick, onDoubleClick, onEnter, actions, dataSidebarEnvironmentId, as = 'li' }) {
|
|
11
|
+
const useListboxOption = as === 'li';
|
|
9
12
|
/**
|
|
10
|
-
* Opens environment settings when Enter is pressed on the name
|
|
13
|
+
* Opens environment settings when Enter is pressed on the name area.
|
|
11
14
|
*/
|
|
12
15
|
const handleKeyDown = (event) => {
|
|
13
|
-
if (event.key !== 'Enter')
|
|
16
|
+
if (event.key !== 'Enter' || onEnter == null) {
|
|
14
17
|
return;
|
|
18
|
+
}
|
|
15
19
|
event.preventDefault();
|
|
16
|
-
|
|
20
|
+
event.stopPropagation();
|
|
21
|
+
onEnter();
|
|
17
22
|
};
|
|
18
|
-
return (_jsx(SidebarItem, { selected: selected, sortable: sortable, onContextMenu: onContextMenu, actions: actions,
|
|
23
|
+
return (_jsx(SidebarItem, { selected: selected, sortable: sortable, onContextMenu: onContextMenu, actions: actions, as: as, listboxOption: useListboxOption
|
|
24
|
+
? {
|
|
25
|
+
ariaLabel,
|
|
26
|
+
ariaSelected,
|
|
27
|
+
ariaCurrent,
|
|
28
|
+
onClick,
|
|
29
|
+
onDoubleClick,
|
|
30
|
+
onKeyDown: onEnter != null ? handleKeyDown : undefined
|
|
31
|
+
}
|
|
32
|
+
: undefined, children: _jsxs("span", { className: SIDEBAR_ITEM_BUTTON_CLASS, ...(dataSidebarEnvironmentId != null
|
|
19
33
|
? { 'data-sidebar-environment-id': String(dataSidebarEnvironmentId) }
|
|
20
|
-
: {}),
|
|
34
|
+
: {}), children: [_jsxs("span", { className: "inline-flex min-w-0 flex-1 items-center gap-1.5", children: [_jsx("span", { className: "min-w-0 truncate", children: name }), colorDot != null ? (_jsx(SidebarColorDot, { color: colorDot.color, visible: colorDot.visible, label: colorDot.label })) : null] }), _jsx("span", { className: "shrink-0 text-muted", children: variableSummary })] }) }));
|
|
21
35
|
}
|
|
@@ -10,6 +10,26 @@ interface Props {
|
|
|
10
10
|
* Whether the folder tree node is expanded.
|
|
11
11
|
*/
|
|
12
12
|
expanded: boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Id of the child region controlled by this folder (`SidebarTreeGroup` id).
|
|
15
|
+
*/
|
|
16
|
+
childrenId?: string;
|
|
17
|
+
/**
|
|
18
|
+
* 1-based depth in the tree.
|
|
19
|
+
*/
|
|
20
|
+
level?: number;
|
|
21
|
+
/**
|
|
22
|
+
* Total siblings at this level.
|
|
23
|
+
*/
|
|
24
|
+
setSize?: number;
|
|
25
|
+
/**
|
|
26
|
+
* 1-based position among siblings at this level.
|
|
27
|
+
*/
|
|
28
|
+
posInSet?: number;
|
|
29
|
+
/**
|
|
30
|
+
* Accessible label for the treeitem row.
|
|
31
|
+
*/
|
|
32
|
+
ariaLabel?: string;
|
|
13
33
|
/**
|
|
14
34
|
* Optional color dot beside the folder name.
|
|
15
35
|
*/
|
|
@@ -39,15 +59,15 @@ interface Props {
|
|
|
39
59
|
*/
|
|
40
60
|
onToggleExpand: () => void;
|
|
41
61
|
/**
|
|
42
|
-
* Called when the folder name
|
|
62
|
+
* Called when the folder name area is activated.
|
|
43
63
|
*/
|
|
44
64
|
onNameClick: () => void;
|
|
45
65
|
/**
|
|
46
|
-
* Called when the folder name
|
|
66
|
+
* Called when the folder name area is double-clicked.
|
|
47
67
|
*/
|
|
48
68
|
onNameDoubleClick?: () => void;
|
|
49
69
|
/**
|
|
50
|
-
* Called when Enter is pressed on the folder name
|
|
70
|
+
* Called when Enter is pressed on the folder name area.
|
|
51
71
|
*/
|
|
52
72
|
onNameEnter?: () => void;
|
|
53
73
|
/**
|
|
@@ -59,11 +79,17 @@ interface Props {
|
|
|
59
79
|
*/
|
|
60
80
|
expandIcon: IconDefinition;
|
|
61
81
|
collapseIcon: IconDefinition;
|
|
82
|
+
/**
|
|
83
|
+
* HTML element for the row container. Use `li` inside {@link SidebarTree}.
|
|
84
|
+
*/
|
|
85
|
+
as?: 'div' | 'li';
|
|
62
86
|
}
|
|
63
87
|
/**
|
|
64
88
|
* Renders a collection folder row with expand/collapse control, optional color dot,
|
|
65
89
|
* and optional drag-drop highlight affordance.
|
|
90
|
+
*
|
|
91
|
+
* Wrap folder trees in {@link SidebarTree} and pass `as="li"` for valid tree semantics.
|
|
66
92
|
*/
|
|
67
|
-
export declare function SidebarFolderItem({ name, expanded, colorDot, dropHighlighted, selected, sortable, onContextMenu, onToggleExpand, onNameClick, onNameDoubleClick, onNameEnter, actions, expandIcon, collapseIcon }: Props): JSX.Element;
|
|
93
|
+
export declare function SidebarFolderItem({ name, expanded, childrenId, level, setSize, posInSet, ariaLabel, colorDot, dropHighlighted, selected, sortable, onContextMenu, onToggleExpand, onNameClick, onNameDoubleClick, onNameEnter, actions, expandIcon, collapseIcon, as }: Props): JSX.Element;
|
|
68
94
|
export {};
|
|
69
95
|
//# sourceMappingURL=SidebarFolderItem.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SidebarFolderItem.d.ts","sourceRoot":"","sources":["../../../src/components/SidebarItem/SidebarFolderItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AACxE,OAAO,KAAK,EAAE,GAAG,EAAiB,UAAU,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvE,OAAO,EAAe,KAAK,yBAAyB,EAAE,MAAM,kBAAkB,CAAC;AAG/E,UAAU,KAAK;IACb;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,QAAQ,EAAE,OAAO,CAAC;IAElB;;OAEG;IACH,QAAQ,CAAC,EAAE;QACT,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;QACjC,OAAO,CAAC,EAAE,OAAO,CAAC;QAClB,KAAK,CAAC,EAAE,MAAM,CAAC;KAChB,CAAC;IAEF;;OAEG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAE1B;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;OAEG;IACH,QAAQ,EAAE,yBAAyB,CAAC;IAEpC;;OAEG;IACH,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,CAAC,WAAW,CAAC,KAAK,IAAI,CAAC;IAEzD;;OAEG;IACH,cAAc,EAAE,MAAM,IAAI,CAAC;IAE3B;;OAEG;IACH,WAAW,EAAE,MAAM,IAAI,CAAC;IAExB;;OAEG;IACH,iBAAiB,CAAC,EAAE,MAAM,IAAI,CAAC;IAE/B;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,IAAI,CAAC;IAEzB;;OAEG;IACH,OAAO,CAAC,EAAE,SAAS,CAAC;IAEpB;;OAEG;IACH,UAAU,EAAE,cAAc,CAAC;IAC3B,YAAY,EAAE,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"SidebarFolderItem.d.ts","sourceRoot":"","sources":["../../../src/components/SidebarItem/SidebarFolderItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AACxE,OAAO,KAAK,EAAE,GAAG,EAAiB,UAAU,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvE,OAAO,EAAe,KAAK,yBAAyB,EAAE,MAAM,kBAAkB,CAAC;AAG/E,UAAU,KAAK;IACb;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,QAAQ,EAAE,OAAO,CAAC;IAElB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,QAAQ,CAAC,EAAE;QACT,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;QACjC,OAAO,CAAC,EAAE,OAAO,CAAC;QAClB,KAAK,CAAC,EAAE,MAAM,CAAC;KAChB,CAAC;IAEF;;OAEG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAE1B;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;OAEG;IACH,QAAQ,EAAE,yBAAyB,CAAC;IAEpC;;OAEG;IACH,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,CAAC,WAAW,CAAC,KAAK,IAAI,CAAC;IAEzD;;OAEG;IACH,cAAc,EAAE,MAAM,IAAI,CAAC;IAE3B;;OAEG;IACH,WAAW,EAAE,MAAM,IAAI,CAAC;IAExB;;OAEG;IACH,iBAAiB,CAAC,EAAE,MAAM,IAAI,CAAC;IAE/B;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,IAAI,CAAC;IAEzB;;OAEG;IACH,OAAO,CAAC,EAAE,SAAS,CAAC;IAEpB;;OAEG;IACH,UAAU,EAAE,cAAc,CAAC;IAC3B,YAAY,EAAE,cAAc,CAAC;IAE7B;;OAEG;IACH,EAAE,CAAC,EAAE,KAAK,GAAG,IAAI,CAAC;CACnB;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,EAChC,IAAI,EACJ,QAAQ,EACR,UAAU,EACV,KAAK,EACL,OAAO,EACP,QAAQ,EACR,SAAS,EACT,QAAQ,EACR,eAAuB,EACvB,QAAgB,EAChB,QAAQ,EACR,aAAa,EACb,cAAc,EACd,WAAW,EACX,iBAAiB,EACjB,WAAW,EACX,OAAO,EACP,UAAU,EACV,YAAY,EACZ,EAAS,EACV,EAAE,KAAK,GAAG,GAAG,CAAC,OAAO,CAwErB"}
|
|
@@ -6,16 +6,37 @@ import { stopSortableDragPointerDown } from './stopSortableDragPointerDown.js';
|
|
|
6
6
|
/**
|
|
7
7
|
* Renders a collection folder row with expand/collapse control, optional color dot,
|
|
8
8
|
* and optional drag-drop highlight affordance.
|
|
9
|
+
*
|
|
10
|
+
* Wrap folder trees in {@link SidebarTree} and pass `as="li"` for valid tree semantics.
|
|
9
11
|
*/
|
|
10
|
-
export function SidebarFolderItem({ name, expanded, colorDot, dropHighlighted = false, selected = false, sortable, onContextMenu, onToggleExpand, onNameClick, onNameDoubleClick, onNameEnter, actions, expandIcon, collapseIcon }) {
|
|
12
|
+
export function SidebarFolderItem({ name, expanded, childrenId, level, setSize, posInSet, ariaLabel, colorDot, dropHighlighted = false, selected = false, sortable, onContextMenu, onToggleExpand, onNameClick, onNameDoubleClick, onNameEnter, actions, expandIcon, collapseIcon, as = 'li' }) {
|
|
13
|
+
const useTreeItem = as === 'li';
|
|
11
14
|
/**
|
|
12
|
-
* Opens folder settings when Enter is pressed on the name
|
|
15
|
+
* Opens folder settings when Enter is pressed on the name area.
|
|
13
16
|
*/
|
|
14
17
|
const handleNameKeyDown = (event) => {
|
|
15
|
-
if (event.key !== 'Enter')
|
|
18
|
+
if (event.key !== 'Enter' || onNameEnter == null) {
|
|
16
19
|
return;
|
|
20
|
+
}
|
|
17
21
|
event.preventDefault();
|
|
18
|
-
|
|
22
|
+
event.stopPropagation();
|
|
23
|
+
onNameEnter();
|
|
19
24
|
};
|
|
20
|
-
|
|
25
|
+
const chevronLabel = expanded ? `Collapse folder "${name}"` : `Expand folder "${name}"`;
|
|
26
|
+
return (_jsxs(SidebarItem, { selected: selected, sortable: sortable, onContextMenu: onContextMenu, actions: actions, as: as, treeItem: useTreeItem
|
|
27
|
+
? {
|
|
28
|
+
ariaLabel,
|
|
29
|
+
expanded,
|
|
30
|
+
controlsId: childrenId,
|
|
31
|
+
level,
|
|
32
|
+
setSize,
|
|
33
|
+
posInSet,
|
|
34
|
+
onClick: () => onNameClick(),
|
|
35
|
+
onDoubleClick: onNameDoubleClick != null ? () => onNameDoubleClick() : undefined,
|
|
36
|
+
onKeyDown: onNameEnter != null ? handleNameKeyDown : undefined
|
|
37
|
+
}
|
|
38
|
+
: undefined, children: [_jsx("button", { type: "button", className: "app-no-drag inline-flex h-4 w-4 shrink-0 cursor-pointer items-center justify-center rounded border-none bg-transparent p-0 text-muted hover:text-text", onClick: (event) => {
|
|
39
|
+
event.stopPropagation();
|
|
40
|
+
onToggleExpand();
|
|
41
|
+
}, onPointerDown: stopSortableDragPointerDown, tabIndex: -1, "aria-label": chevronLabel, children: _jsx(FaIcon, { icon: expanded ? collapseIcon : expandIcon, className: "h-2 w-2" }) }), _jsxs("span", { className: "app-no-drag ml-0.5 min-w-0 flex-1 cursor-pointer truncate border-none bg-transparent py-0 text-left leading-none font-medium text-inherit", "aria-current": selected ? 'true' : undefined, children: [_jsxs("span", { className: "inline-flex min-w-0 items-center gap-1.5", children: [name, colorDot != null ? (_jsx(SidebarColorDot, { color: colorDot.color, visible: colorDot.visible, label: colorDot.label })) : null] }), dropHighlighted ? _jsx("span", { className: "ml-1.5 font-normal text-info", children: "Drop here" }) : null] })] }));
|
|
21
42
|
}
|
|
@@ -30,11 +30,11 @@ interface Props {
|
|
|
30
30
|
*/
|
|
31
31
|
selected?: boolean;
|
|
32
32
|
/**
|
|
33
|
-
* Tooltip title for the primary
|
|
33
|
+
* Tooltip title for the primary label area.
|
|
34
34
|
*/
|
|
35
35
|
title?: string;
|
|
36
36
|
/**
|
|
37
|
-
* Accessible label for the
|
|
37
|
+
* Accessible label for the listbox option.
|
|
38
38
|
*/
|
|
39
39
|
ariaLabel: string;
|
|
40
40
|
/**
|
|
@@ -42,17 +42,21 @@ interface Props {
|
|
|
42
42
|
*/
|
|
43
43
|
onContextMenu?: (event: MouseEvent<HTMLElement>) => void;
|
|
44
44
|
/**
|
|
45
|
-
* Called when the primary row
|
|
45
|
+
* Called when the primary row area is activated.
|
|
46
46
|
*/
|
|
47
|
-
onClick?: (event: MouseEvent<
|
|
47
|
+
onClick?: (event: MouseEvent<HTMLElement>) => void;
|
|
48
48
|
/**
|
|
49
49
|
* Trailing actions slot, typically a row actions menu.
|
|
50
50
|
*/
|
|
51
51
|
actions?: ReactNode;
|
|
52
|
+
/**
|
|
53
|
+
* HTML element for the row container. Use `li` inside {@link SidebarListbox}.
|
|
54
|
+
*/
|
|
55
|
+
as?: 'div' | 'li';
|
|
52
56
|
}
|
|
53
57
|
/**
|
|
54
58
|
* Renders a request or run history entry row in the Collections sidebar History section.
|
|
55
59
|
*/
|
|
56
|
-
export declare function SidebarHistoryItem({ method, name, isRun, status, statusText, runIcon, selected, title, ariaLabel, onContextMenu, onClick, actions }: Props): JSX.Element;
|
|
60
|
+
export declare function SidebarHistoryItem({ method, name, isRun, status, statusText, runIcon, selected, title, ariaLabel, onContextMenu, onClick, actions, as }: Props): JSX.Element;
|
|
57
61
|
export {};
|
|
58
62
|
//# sourceMappingURL=SidebarHistoryItem.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SidebarHistoryItem.d.ts","sourceRoot":"","sources":["../../../src/components/SidebarItem/SidebarHistoryItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AACxE,OAAO,KAAK,EAAE,GAAG,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAOxD,UAAU,KAAK;IACb;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;IAEhB;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACH,OAAO,CAAC,EAAE,cAAc,CAAC;IAEzB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,CAAC,WAAW,CAAC,KAAK,IAAI,CAAC;IAEzD;;OAEG;IACH,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,CAAC,
|
|
1
|
+
{"version":3,"file":"SidebarHistoryItem.d.ts","sourceRoot":"","sources":["../../../src/components/SidebarItem/SidebarHistoryItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AACxE,OAAO,KAAK,EAAE,GAAG,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAOxD,UAAU,KAAK;IACb;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;IAEhB;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACH,OAAO,CAAC,EAAE,cAAc,CAAC;IAEzB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,CAAC,WAAW,CAAC,KAAK,IAAI,CAAC;IAEzD;;OAEG;IACH,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,CAAC,WAAW,CAAC,KAAK,IAAI,CAAC;IAEnD;;OAEG;IACH,OAAO,CAAC,EAAE,SAAS,CAAC;IAEpB;;OAEG;IACH,EAAE,CAAC,EAAE,KAAK,GAAG,IAAI,CAAC;CACnB;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,EACjC,MAAM,EACN,IAAI,EACJ,KAAa,EACb,MAAM,EACN,UAAU,EACV,OAAO,EACP,QAAgB,EAChB,KAAK,EACL,SAAS,EACT,aAAa,EACb,OAAO,EACP,OAAO,EACP,EAAS,EACV,EAAE,KAAK,GAAG,GAAG,CAAC,OAAO,CAuCrB"}
|
|
@@ -1,12 +1,21 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "@harborclient/sdk/jsx-runtime";
|
|
2
|
-
import { Button } from '../Button/index.js';
|
|
3
2
|
import { FaIcon } from '../FaIcon/index.js';
|
|
4
3
|
import { SidebarItem } from './SidebarItem.js';
|
|
5
4
|
import { SidebarMethodBadge } from './SidebarMethodBadge.js';
|
|
6
|
-
import {
|
|
5
|
+
import { SidebarStatusDot } from './SidebarStatusDot.js';
|
|
6
|
+
import { SIDEBAR_ITEM_BUTTON_CLASS, statusDotClass } from './sidebarItemClasses.js';
|
|
7
7
|
/**
|
|
8
8
|
* Renders a request or run history entry row in the Collections sidebar History section.
|
|
9
9
|
*/
|
|
10
|
-
export function SidebarHistoryItem({ method, name, isRun = false, status, statusText, runIcon, selected = false, title, ariaLabel, onContextMenu, onClick, actions }) {
|
|
11
|
-
|
|
10
|
+
export function SidebarHistoryItem({ method, name, isRun = false, status, statusText, runIcon, selected = false, title, ariaLabel, onContextMenu, onClick, actions, as = 'li' }) {
|
|
11
|
+
const useListboxOption = as === 'li';
|
|
12
|
+
const optionAriaLabel = !isRun && status != null && statusText != null
|
|
13
|
+
? `${ariaLabel}, responded ${status} ${statusText}`
|
|
14
|
+
: ariaLabel;
|
|
15
|
+
return (_jsx(SidebarItem, { selected: selected, onContextMenu: onContextMenu, actions: actions, as: as, listboxOption: useListboxOption
|
|
16
|
+
? {
|
|
17
|
+
ariaLabel: optionAriaLabel,
|
|
18
|
+
onClick
|
|
19
|
+
}
|
|
20
|
+
: undefined, children: _jsxs("span", { className: `${SIDEBAR_ITEM_BUTTON_CLASS} py-0.5`, title: title, children: [_jsx(SidebarMethodBadge, { method: method, uppercase: true }), _jsxs("span", { className: "flex min-w-0 flex-1 items-center gap-1.5", children: [_jsx("span", { className: "min-w-0 truncate text-text", children: name }), isRun && runIcon != null ? (_jsx(FaIcon, { icon: runIcon, className: "h-3.5 w-3.5 shrink-0 text-muted", "aria-hidden": true })) : null] }), !isRun && status != null && statusText != null ? (_jsxs("span", { className: "flex shrink-0 items-center gap-1.5 text-muted tabular-nums", children: [_jsx(SidebarStatusDot, { className: statusDotClass(status) }), status, " ", statusText] })) : null] }) }));
|
|
12
21
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { JSX, MouseEvent, ReactNode } from 'react';
|
|
1
|
+
import type { JSX, KeyboardEvent, MouseEvent, ReactNode } from 'react';
|
|
2
2
|
/**
|
|
3
3
|
* Sortable drag configuration for a sidebar row.
|
|
4
4
|
*/
|
|
@@ -16,6 +16,87 @@ export interface SidebarItemSortableConfig {
|
|
|
16
16
|
*/
|
|
17
17
|
disabled?: boolean;
|
|
18
18
|
}
|
|
19
|
+
/**
|
|
20
|
+
* Tree item interaction props for a sidebar row rendered inside {@link SidebarTree}.
|
|
21
|
+
*/
|
|
22
|
+
export interface SidebarItemTreeItem {
|
|
23
|
+
/**
|
|
24
|
+
* Accessible label for the treeitem.
|
|
25
|
+
*/
|
|
26
|
+
ariaLabel?: string;
|
|
27
|
+
/**
|
|
28
|
+
* Whether the treeitem is expanded. Omit for leaf nodes.
|
|
29
|
+
*/
|
|
30
|
+
expanded?: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Id of the controlled child region (`SidebarTreeGroup` id).
|
|
33
|
+
*/
|
|
34
|
+
controlsId?: string;
|
|
35
|
+
/**
|
|
36
|
+
* 1-based depth in the tree.
|
|
37
|
+
*/
|
|
38
|
+
level?: number;
|
|
39
|
+
/**
|
|
40
|
+
* Total siblings at this level.
|
|
41
|
+
*/
|
|
42
|
+
setSize?: number;
|
|
43
|
+
/**
|
|
44
|
+
* 1-based position among siblings at this level.
|
|
45
|
+
*/
|
|
46
|
+
posInSet?: number;
|
|
47
|
+
/**
|
|
48
|
+
* Explicit tab index override. Defaults to `0` when selected, otherwise `-1`.
|
|
49
|
+
*/
|
|
50
|
+
tabIndex?: number;
|
|
51
|
+
/**
|
|
52
|
+
* Called when the treeitem is activated via click or keyboard.
|
|
53
|
+
*/
|
|
54
|
+
onClick?: (event: MouseEvent<HTMLElement>) => void;
|
|
55
|
+
/**
|
|
56
|
+
* Called when the treeitem receives a double-click.
|
|
57
|
+
*/
|
|
58
|
+
onDoubleClick?: (event: MouseEvent<HTMLElement>) => void;
|
|
59
|
+
/**
|
|
60
|
+
* Additional keyboard handling composed before default Enter/Space activation.
|
|
61
|
+
*/
|
|
62
|
+
onKeyDown?: (event: KeyboardEvent<HTMLElement>) => void;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Listbox option interaction props for a sidebar row rendered inside {@link SidebarListbox}.
|
|
66
|
+
*/
|
|
67
|
+
export interface SidebarItemListboxOption {
|
|
68
|
+
/**
|
|
69
|
+
* Accessible label for the listbox option. When omitted, the name is derived from visible content.
|
|
70
|
+
*/
|
|
71
|
+
ariaLabel?: string;
|
|
72
|
+
/**
|
|
73
|
+
* Overrides the `aria-selected` state. When omitted, falls back to the row's
|
|
74
|
+
* `selected` prop. Use this to decouple selection semantics from highlight
|
|
75
|
+
* styling (e.g. an active row that is not part of a multi-selection).
|
|
76
|
+
*/
|
|
77
|
+
ariaSelected?: boolean;
|
|
78
|
+
/**
|
|
79
|
+
* When true, marks the option as the current item with `aria-current="true"`.
|
|
80
|
+
* Use for the single active/current row when it is distinct from selection.
|
|
81
|
+
*/
|
|
82
|
+
ariaCurrent?: boolean;
|
|
83
|
+
/**
|
|
84
|
+
* Explicit tab index override. Defaults to `0` when selected, otherwise `-1`.
|
|
85
|
+
*/
|
|
86
|
+
tabIndex?: number;
|
|
87
|
+
/**
|
|
88
|
+
* Called when the option is activated via click or keyboard.
|
|
89
|
+
*/
|
|
90
|
+
onClick?: (event: MouseEvent<HTMLElement>) => void;
|
|
91
|
+
/**
|
|
92
|
+
* Called when the option receives a double-click.
|
|
93
|
+
*/
|
|
94
|
+
onDoubleClick?: (event: MouseEvent<HTMLElement>) => void;
|
|
95
|
+
/**
|
|
96
|
+
* Additional keyboard handling composed before default Enter/Space activation.
|
|
97
|
+
*/
|
|
98
|
+
onKeyDown?: (event: KeyboardEvent<HTMLElement>) => void;
|
|
99
|
+
}
|
|
19
100
|
interface Props {
|
|
20
101
|
/**
|
|
21
102
|
* Whether this row should use selected/highlighted row styling.
|
|
@@ -29,6 +110,14 @@ interface Props {
|
|
|
29
110
|
* Optional dnd-kit sortable configuration.
|
|
30
111
|
*/
|
|
31
112
|
sortable?: SidebarItemSortableConfig;
|
|
113
|
+
/**
|
|
114
|
+
* When set, exposes the row as a listbox option (`role="option"`).
|
|
115
|
+
*/
|
|
116
|
+
listboxOption?: SidebarItemListboxOption;
|
|
117
|
+
/**
|
|
118
|
+
* When set, exposes the row as a tree item (`role="treeitem"`).
|
|
119
|
+
*/
|
|
120
|
+
treeItem?: SidebarItemTreeItem;
|
|
32
121
|
/**
|
|
33
122
|
* Called when the user right-clicks the row container.
|
|
34
123
|
*/
|
|
@@ -39,6 +128,7 @@ interface Props {
|
|
|
39
128
|
actions?: ReactNode;
|
|
40
129
|
/**
|
|
41
130
|
* When true, wraps the actions slot with {@link stopSortableDragPointerDown}.
|
|
131
|
+
* Harmless when sortable: drag activation lives on the grip handle, not the row.
|
|
42
132
|
*/
|
|
43
133
|
actionsStopDrag?: boolean;
|
|
44
134
|
/**
|
|
@@ -56,8 +146,9 @@ interface Props {
|
|
|
56
146
|
}
|
|
57
147
|
/**
|
|
58
148
|
* Base shell for sidebar list rows. Applies shared row chrome, optional sortable
|
|
59
|
-
* drag behavior, and a trailing actions slot suitable
|
|
149
|
+
* drag behavior via a leading grip handle, and a trailing actions slot suitable
|
|
150
|
+
* for future Sidebar layout reuse.
|
|
60
151
|
*/
|
|
61
|
-
export declare function SidebarItem({ selected, compact, sortable, onContextMenu, actions, actionsStopDrag, as: Container, className, children }: Props): JSX.Element;
|
|
152
|
+
export declare function SidebarItem({ selected, compact, sortable, listboxOption, treeItem, onContextMenu, actions, actionsStopDrag, as: Container, className, children }: Props): JSX.Element;
|
|
62
153
|
export {};
|
|
63
154
|
//# sourceMappingURL=SidebarItem.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SidebarItem.d.ts","sourceRoot":"","sources":["../../../src/components/SidebarItem/SidebarItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"SidebarItem.d.ts","sourceRoot":"","sources":["../../../src/components/SidebarItem/SidebarItem.tsx"],"names":[],"mappings":"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"}
|