@harborclient/sdk 1.1.8 → 1.1.9

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.
Files changed (57) hide show
  1. package/dist/components/Resizable/ResizeHandle.d.ts +7 -2
  2. package/dist/components/Resizable/ResizeHandle.d.ts.map +1 -1
  3. package/dist/components/Resizable/ResizeHandle.js +6 -2
  4. package/dist/components/SidebarItem/SidebarColorDot.d.ts.map +1 -1
  5. package/dist/components/SidebarItem/SidebarColorDot.js +1 -1
  6. package/dist/components/SidebarItem/SidebarCommitItem.d.ts +7 -1
  7. package/dist/components/SidebarItem/SidebarCommitItem.d.ts.map +1 -1
  8. package/dist/components/SidebarItem/SidebarCommitItem.js +4 -2
  9. package/dist/components/SidebarItem/SidebarEnvironmentItem.d.ts +12 -18
  10. package/dist/components/SidebarItem/SidebarEnvironmentItem.d.ts.map +1 -1
  11. package/dist/components/SidebarItem/SidebarEnvironmentItem.js +17 -6
  12. package/dist/components/SidebarItem/SidebarFolderItem.d.ts +30 -4
  13. package/dist/components/SidebarItem/SidebarFolderItem.d.ts.map +1 -1
  14. package/dist/components/SidebarItem/SidebarFolderItem.js +26 -5
  15. package/dist/components/SidebarItem/SidebarHistoryItem.d.ts +9 -5
  16. package/dist/components/SidebarItem/SidebarHistoryItem.d.ts.map +1 -1
  17. package/dist/components/SidebarItem/SidebarHistoryItem.js +13 -4
  18. package/dist/components/SidebarItem/SidebarItem.d.ts +83 -3
  19. package/dist/components/SidebarItem/SidebarItem.d.ts.map +1 -1
  20. package/dist/components/SidebarItem/SidebarItem.js +54 -4
  21. package/dist/components/SidebarItem/SidebarList.d.ts +30 -0
  22. package/dist/components/SidebarItem/SidebarList.d.ts.map +1 -0
  23. package/dist/components/SidebarItem/SidebarList.js +17 -0
  24. package/dist/components/SidebarItem/SidebarListbox.d.ts +35 -0
  25. package/dist/components/SidebarItem/SidebarListbox.d.ts.map +1 -0
  26. package/dist/components/SidebarItem/SidebarListbox.js +18 -0
  27. package/dist/components/SidebarItem/SidebarMethodBadge.d.ts.map +1 -1
  28. package/dist/components/SidebarItem/SidebarMethodBadge.js +1 -1
  29. package/dist/components/SidebarItem/SidebarRequestItem.d.ts +16 -30
  30. package/dist/components/SidebarItem/SidebarRequestItem.d.ts.map +1 -1
  31. package/dist/components/SidebarItem/SidebarRequestItem.js +21 -4
  32. package/dist/components/SidebarItem/SidebarRunItem.d.ts +11 -8
  33. package/dist/components/SidebarItem/SidebarRunItem.d.ts.map +1 -1
  34. package/dist/components/SidebarItem/SidebarRunItem.js +12 -4
  35. package/dist/components/SidebarItem/SidebarStatusMarker.js +1 -1
  36. package/dist/components/SidebarItem/SidebarTabGroupItem.d.ts +7 -3
  37. package/dist/components/SidebarItem/SidebarTabGroupItem.d.ts.map +1 -1
  38. package/dist/components/SidebarItem/SidebarTabGroupItem.js +8 -3
  39. package/dist/components/SidebarItem/SidebarTree.d.ts +55 -0
  40. package/dist/components/SidebarItem/SidebarTree.d.ts.map +1 -0
  41. package/dist/components/SidebarItem/SidebarTree.js +30 -0
  42. package/dist/components/SidebarItem/SortableSidebarItem.d.ts +24 -5
  43. package/dist/components/SidebarItem/SortableSidebarItem.d.ts.map +1 -1
  44. package/dist/components/SidebarItem/SortableSidebarItem.js +27 -13
  45. package/dist/components/SidebarItem/index.d.ts +5 -1
  46. package/dist/components/SidebarItem/index.d.ts.map +1 -1
  47. package/dist/components/SidebarItem/index.js +4 -0
  48. package/dist/components/SidebarItem/sidebarItemClasses.d.ts +4 -0
  49. package/dist/components/SidebarItem/sidebarItemClasses.d.ts.map +1 -1
  50. package/dist/components/SidebarItem/sidebarItemClasses.js +4 -0
  51. package/dist/components/SidebarItem/sidebarListOption.d.ts +6 -0
  52. package/dist/components/SidebarItem/sidebarListOption.d.ts.map +1 -0
  53. package/dist/components/SidebarItem/sidebarListOption.js +10 -0
  54. package/dist/components/index.d.ts +1 -1
  55. package/dist/components/index.d.ts.map +1 -1
  56. package/dist/components/index.js +1 -1
  57. 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,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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,CAa3F"}
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 }, "aria-hidden": label == null ? true : undefined, "aria-label": label }));
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;CAC1D;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,EAChC,OAAO,EACP,MAAM,EACN,cAAc,EACd,IAAI,EACJ,OAAO,EACR,EAAE,KAAK,GAAG,GAAG,CAAC,OAAO,CAgBrB"}
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
  }
@@ -21,14 +21,6 @@ interface Props {
21
21
  * Whether this row should use selected/highlighted row styling.
22
22
  */
23
23
  selected?: boolean;
24
- /**
25
- * When true, sets aria-current="true" on the primary button.
26
- */
27
- ariaCurrent?: boolean;
28
- /**
29
- * When true, sets aria-selected="true" on the primary button.
30
- */
31
- ariaSelected?: boolean;
32
24
  /**
33
25
  * dnd-kit sortable configuration for environment reordering.
34
26
  */
@@ -38,21 +30,17 @@ interface Props {
38
30
  */
39
31
  onContextMenu?: (event: MouseEvent<HTMLElement>) => void;
40
32
  /**
41
- * Called when the primary label button is clicked.
33
+ * Called when the primary label area is activated.
42
34
  */
43
- onClick?: (event: MouseEvent<HTMLButtonElement>) => void;
35
+ onClick?: (event: MouseEvent<HTMLElement>) => void;
44
36
  /**
45
- * Called when the primary label button is double-clicked.
37
+ * Called when the primary label area is double-clicked.
46
38
  */
47
- onDoubleClick?: () => void;
39
+ onDoubleClick?: (event: MouseEvent<HTMLElement>) => void;
48
40
  /**
49
- * Called when Enter is pressed on the primary label button.
41
+ * Called when Enter is pressed on the primary label area.
50
42
  */
51
43
  onEnter?: () => void;
52
- /**
53
- * Accessible label for the primary button.
54
- */
55
- ariaLabel?: string;
56
44
  /**
57
45
  * Trailing actions slot, typically a row actions menu.
58
46
  */
@@ -61,10 +49,16 @@ interface Props {
61
49
  * Optional data attribute value for keyboard navigation focus targets.
62
50
  */
63
51
  dataSidebarEnvironmentId?: string | number;
52
+ /**
53
+ * HTML element for the row container. Use `li` inside {@link SidebarListbox}.
54
+ */
55
+ as?: 'div' | 'li';
64
56
  }
65
57
  /**
66
58
  * Renders an environment row in the Collections sidebar Environments section.
59
+ *
60
+ * The accessible name is derived from visible row content (name, variable summary).
67
61
  */
68
- export declare function SidebarEnvironmentItem({ name, variableSummary, colorDot, selected, ariaCurrent, ariaSelected, sortable, onContextMenu, onClick, onDoubleClick, onEnter, ariaLabel, actions, dataSidebarEnvironmentId }: Props): JSX.Element;
62
+ export declare function SidebarEnvironmentItem({ name, variableSummary, colorDot, selected, sortable, onContextMenu, onClick, onDoubleClick, onEnter, actions, dataSidebarEnvironmentId, as }: Props): JSX.Element;
69
63
  export {};
70
64
  //# 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,WAAW,CAAC,EAAE,OAAO,CAAC;IAEtB;;OAEG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IAEvB;;OAEG;IACH,QAAQ,CAAC,EAAE,yBAAyB,CAAC;IAErC;;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,iBAAiB,CAAC,KAAK,IAAI,CAAC;IAEzD;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,IAAI,CAAC;IAE3B;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IAErB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,OAAO,CAAC,EAAE,SAAS,CAAC;IAEpB;;OAEG;IACH,wBAAwB,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CAC5C;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,EACrC,IAAI,EACJ,eAAe,EACf,QAAQ,EACR,QAAgB,EAChB,WAAmB,EACnB,YAAoB,EACpB,QAAQ,EACR,aAAa,EACb,OAAO,EACP,aAAa,EACb,OAAO,EACP,SAAS,EACT,OAAO,EACP,wBAAwB,EACzB,EAAE,KAAK,GAAG,GAAG,CAAC,OAAO,CA4CrB"}
1
+ {"version":3,"file":"SidebarEnvironmentItem.d.ts","sourceRoot":"","sources":["../../../src/components/SidebarItem/SidebarEnvironmentItem.tsx"],"names":[],"mappings":"AAAA,OA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AK,GAAG,GAAG,CAAC,OAAO,CAqDrB"}
@@ -4,18 +4,29 @@ 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, ariaCurrent = false, ariaSelected = false, sortable, onContextMenu, onClick, onDoubleClick, onEnter, ariaLabel, actions, dataSidebarEnvironmentId }) {
10
+ export function SidebarEnvironmentItem({ name, variableSummary, colorDot, selected = false, sortable, 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 button.
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
- onEnter?.();
20
+ event.stopPropagation();
21
+ onEnter();
17
22
  };
18
- return (_jsx(SidebarItem, { selected: selected, sortable: sortable, onContextMenu: onContextMenu, actions: actions, children: _jsxs("button", { type: "button", className: SIDEBAR_ITEM_BUTTON_CLASS, ...(dataSidebarEnvironmentId != null
23
+ return (_jsx(SidebarItem, { selected: selected, sortable: sortable, onContextMenu: onContextMenu, actions: actions, as: as, listboxOption: useListboxOption
24
+ ? {
25
+ onClick,
26
+ onDoubleClick,
27
+ onKeyDown: onEnter != null ? handleKeyDown : undefined
28
+ }
29
+ : undefined, children: _jsxs("span", { className: SIDEBAR_ITEM_BUTTON_CLASS, ...(dataSidebarEnvironmentId != null
19
30
  ? { 'data-sidebar-environment-id': String(dataSidebarEnvironmentId) }
20
- : {}), "aria-current": ariaCurrent ? 'true' : undefined, "aria-selected": ariaSelected ? 'true' : undefined, "aria-label": ariaLabel, onClick: onClick, onDoubleClick: onDoubleClick, onKeyDown: handleKeyDown, 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 })] }) }));
31
+ : {}), 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
32
  }
@@ -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 button is clicked.
62
+ * Called when the folder name area is activated.
43
63
  */
44
64
  onNameClick: () => void;
45
65
  /**
46
- * Called when the folder name button is double-clicked.
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 button.
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;CAC9B;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,EAChC,IAAI,EACJ,QAAQ,EACR,QAAQ,EACR,eAAuB,EACvB,QAAgB,EAChB,QAAQ,EACR,aAAa,EACb,cAAc,EACd,WAAW,EACX,iBAAiB,EACjB,WAAW,EACX,OAAO,EACP,UAAU,EACV,YAAY,EACb,EAAE,KAAK,GAAG,GAAG,CAAC,OAAO,CAiDrB"}
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;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,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 button.
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
- onNameEnter?.();
22
+ event.stopPropagation();
23
+ onNameEnter();
19
24
  };
20
- return (_jsxs(SidebarItem, { selected: selected, sortable: sortable, onContextMenu: onContextMenu, actions: actions, 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: onToggleExpand, onPointerDown: stopSortableDragPointerDown, "aria-expanded": expanded, "aria-label": expanded ? 'Collapse folder' : 'Expand folder', children: _jsx(FaIcon, { icon: expanded ? collapseIcon : expandIcon, className: "h-2 w-2" }) }), _jsxs("button", { type: "button", 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, onClick: onNameClick, onDoubleClick: onNameDoubleClick, onKeyDown: handleNameKeyDown, 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] })] }));
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 button.
33
+ * Tooltip title for the primary label area.
34
34
  */
35
35
  title?: string;
36
36
  /**
37
- * Accessible label for the primary button.
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 button is clicked.
45
+ * Called when the primary row area is activated.
46
46
  */
47
- onClick?: (event: MouseEvent<HTMLButtonElement>) => void;
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,iBAAiB,CAAC,KAAK,IAAI,CAAC;IAEzD;;OAEG;IACH,OAAO,CAAC,EAAE,SAAS,CAAC;CACrB;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,EACR,EAAE,KAAK,GAAG,GAAG,CAAC,OAAO,CA8BrB"}
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 { statusDotClass } from './sidebarItemClasses.js';
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
- return (_jsx(SidebarItem, { selected: selected, onContextMenu: onContextMenu, actions: actions, children: _jsxs(Button, { variant: "toolbar", className: "flex min-w-0 flex-1 items-center gap-2 py-0.5 text-left text-text hover:bg-transparent", title: title, "aria-label": ariaLabel, "aria-selected": selected ? 'true' : undefined, onClick: onClick, 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("span", { className: `inline-block h-2 w-2 shrink-0 rounded-full ${statusDotClass(status)}`, "aria-hidden": "true" }), status, " ", statusText] })) : null] }) }));
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,76 @@ 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
+ * Explicit tab index override. Defaults to `0` when selected, otherwise `-1`.
74
+ */
75
+ tabIndex?: number;
76
+ /**
77
+ * Called when the option is activated via click or keyboard.
78
+ */
79
+ onClick?: (event: MouseEvent<HTMLElement>) => void;
80
+ /**
81
+ * Called when the option receives a double-click.
82
+ */
83
+ onDoubleClick?: (event: MouseEvent<HTMLElement>) => void;
84
+ /**
85
+ * Additional keyboard handling composed before default Enter/Space activation.
86
+ */
87
+ onKeyDown?: (event: KeyboardEvent<HTMLElement>) => void;
88
+ }
19
89
  interface Props {
20
90
  /**
21
91
  * Whether this row should use selected/highlighted row styling.
@@ -29,6 +99,14 @@ interface Props {
29
99
  * Optional dnd-kit sortable configuration.
30
100
  */
31
101
  sortable?: SidebarItemSortableConfig;
102
+ /**
103
+ * When set, exposes the row as a listbox option (`role="option"`).
104
+ */
105
+ listboxOption?: SidebarItemListboxOption;
106
+ /**
107
+ * When set, exposes the row as a tree item (`role="treeitem"`).
108
+ */
109
+ treeItem?: SidebarItemTreeItem;
32
110
  /**
33
111
  * Called when the user right-clicks the row container.
34
112
  */
@@ -39,6 +117,7 @@ interface Props {
39
117
  actions?: ReactNode;
40
118
  /**
41
119
  * When true, wraps the actions slot with {@link stopSortableDragPointerDown}.
120
+ * Harmless when sortable: drag activation lives on the grip handle, not the row.
42
121
  */
43
122
  actionsStopDrag?: boolean;
44
123
  /**
@@ -56,8 +135,9 @@ interface Props {
56
135
  }
57
136
  /**
58
137
  * Base shell for sidebar list rows. Applies shared row chrome, optional sortable
59
- * drag behavior, and a trailing actions slot suitable for future Sidebar layout reuse.
138
+ * drag behavior via a leading grip handle, and a trailing actions slot suitable
139
+ * for future Sidebar layout reuse.
60
140
  */
61
- export declare function SidebarItem({ selected, compact, sortable, onContextMenu, actions, actionsStopDrag, as: Container, className, children }: Props): JSX.Element;
141
+ export declare function SidebarItem({ selected, compact, sortable, listboxOption, treeItem, onContextMenu, actions, actionsStopDrag, as: Container, className, children }: Props): JSX.Element;
62
142
  export {};
63
143
  //# 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;AAMxD;;GAEG;AACH,MAAM,WAAW,yBAAyB;IACxC;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;OAEG;IACH,eAAe,EAAE,MAAM,CAAC;IAExB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,UAAU,KAAK;IACb;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB;;OAEG;IACH,QAAQ,CAAC,EAAE,yBAAyB,CAAC;IAErC;;OAEG;IACH,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,CAAC,WAAW,CAAC,KAAK,IAAI,CAAC;IAEzD;;OAEG;IACH,OAAO,CAAC,EAAE,SAAS,CAAC;IAEpB;;OAEG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAE1B;;OAEG;IACH,EAAE,CAAC,EAAE,KAAK,GAAG,IAAI,CAAC;IAElB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,EAC1B,QAAgB,EAChB,OAAc,EACd,QAAQ,EACR,aAAa,EACb,OAAO,EACP,eAAsB,EACtB,EAAE,EAAE,SAAiB,EACrB,SAAS,EACT,QAAQ,EACT,EAAE,KAAK,GAAG,GAAG,CAAC,OAAO,CAoCrB"}
1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AU,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,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,aAAa,CAAC,WAAW,CAAC,KAAK,IAAI,CAAC;CACzD;AAED,UAAU,KAAK;IACb;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB;;OAEG;IACH,QAAQ,CAAC,EAAE,yBAAyB,CAAC;IAErC;;OAEG;IACH,aAAa,CAAC,EAAE,wBAAwB,CAAC;IAEzC;;OAEG;IACH,QAAQ,CAAC,EAAE,mBAAmB,CAAC;IAE/B;;OAEG;IACH,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,CAAC,WAAW,CAAC,KAAK,IAAI,CAAC;IAEzD;;OAEG;IACH,OAAO,CAAC,EAAE,SAAS,CAAC;IAEpB;;;OAGG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAE1B;;OAEG;IACH,EAAE,CAAC,EAAE,KAAK,GAAG,IAAI,CAAC;IAElB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,EAC1B,QAAgB,EAChB,OAAc,EACd,QAAQ,EACR,aAAa,EACb,QAAQ,EACR,aAAa,EACb,OAAO,EACP,eAAsB,EACtB,EAAE,EAAE,SAAiB,EACrB,SAAS,EACT,QAAQ,EACT,EAAE,KAAK,GAAG,GAAG,CAAC,OAAO,CA2FrB"}
@@ -2,16 +2,66 @@ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "@harborclient
2
2
  import { cn } from '../utils.js';
3
3
  import { SortableSidebarItem } from './SortableSidebarItem.js';
4
4
  import { sourceRow } from './sidebarItemClasses.js';
5
+ import { handleSidebarOptionKeyDown } from './sidebarListOption.js';
5
6
  import { stopSortableDragPointerDown } from './stopSortableDragPointerDown.js';
6
7
  /**
7
8
  * Base shell for sidebar list rows. Applies shared row chrome, optional sortable
8
- * drag behavior, and a trailing actions slot suitable for future Sidebar layout reuse.
9
+ * drag behavior via a leading grip handle, and a trailing actions slot suitable
10
+ * for future Sidebar layout reuse.
9
11
  */
10
- export function SidebarItem({ selected = false, compact = true, sortable, onContextMenu, actions, actionsStopDrag = true, as: Container = 'div', className, children }) {
12
+ export function SidebarItem({ selected = false, compact = true, sortable, listboxOption, treeItem, onContextMenu, actions, actionsStopDrag = true, as: Container = 'div', className, children }) {
11
13
  const rowClassName = cn('hc-sidebar-item', sourceRow(selected, compact), className);
12
14
  const rowContent = (_jsxs(_Fragment, { children: [children, actions != null ? (_jsx("div", { className: "shrink-0", ...(actionsStopDrag ? { onPointerDown: stopSortableDragPointerDown } : {}), children: actions })) : null] }));
15
+ const listboxOptionProps = listboxOption != null
16
+ ? {
17
+ role: 'option',
18
+ 'aria-selected': selected ? 'true' : 'false',
19
+ ...(listboxOption.ariaLabel != null ? { 'aria-label': listboxOption.ariaLabel } : {}),
20
+ tabIndex: listboxOption.tabIndex ?? (selected ? 0 : -1),
21
+ ...(listboxOption.onClick != null ? { onClick: listboxOption.onClick } : {}),
22
+ ...(listboxOption.onDoubleClick != null
23
+ ? { onDoubleClick: listboxOption.onDoubleClick }
24
+ : {}),
25
+ onKeyDown: (event) => {
26
+ listboxOption.onKeyDown?.(event);
27
+ if (event.defaultPrevented) {
28
+ return;
29
+ }
30
+ handleSidebarOptionKeyDown(event, () => {
31
+ listboxOption.onClick?.(event);
32
+ });
33
+ }
34
+ }
35
+ : {};
36
+ const treeItemProps = treeItem != null
37
+ ? {
38
+ role: 'treeitem',
39
+ 'aria-selected': selected ? 'true' : 'false',
40
+ ...(treeItem.ariaLabel != null ? { 'aria-label': treeItem.ariaLabel } : {}),
41
+ ...(treeItem.expanded != null
42
+ ? { 'aria-expanded': treeItem.expanded ? 'true' : 'false' }
43
+ : {}),
44
+ ...(treeItem.controlsId != null ? { 'aria-controls': treeItem.controlsId } : {}),
45
+ ...(treeItem.level != null ? { 'aria-level': treeItem.level } : {}),
46
+ ...(treeItem.setSize != null ? { 'aria-setsize': treeItem.setSize } : {}),
47
+ ...(treeItem.posInSet != null ? { 'aria-posinset': treeItem.posInSet } : {}),
48
+ tabIndex: treeItem.tabIndex ?? (selected ? 0 : -1),
49
+ ...(treeItem.onClick != null ? { onClick: treeItem.onClick } : {}),
50
+ ...(treeItem.onDoubleClick != null ? { onDoubleClick: treeItem.onDoubleClick } : {}),
51
+ onKeyDown: (event) => {
52
+ treeItem.onKeyDown?.(event);
53
+ if (event.defaultPrevented) {
54
+ return;
55
+ }
56
+ handleSidebarOptionKeyDown(event, () => {
57
+ treeItem.onClick?.(event);
58
+ });
59
+ }
60
+ }
61
+ : {};
62
+ const interactiveProps = listboxOption != null ? listboxOptionProps : treeItemProps;
13
63
  if (sortable != null) {
14
- return (_jsx(SortableSidebarItem, { id: sortable.id, className: rowClassName, dragHandleLabel: sortable.dragHandleLabel, disabled: sortable.disabled, onRowContextMenu: onContextMenu, children: rowContent }));
64
+ return (_jsx(SortableSidebarItem, { id: sortable.id, as: Container, className: rowClassName, dragHandleLabel: sortable.dragHandleLabel, disabled: sortable.disabled, onRowContextMenu: onContextMenu, ...interactiveProps, children: rowContent }));
15
65
  }
16
- return (_jsx(Container, { className: rowClassName, onContextMenu: onContextMenu, children: rowContent }));
66
+ return (_jsx(Container, { className: rowClassName, onContextMenu: onContextMenu, ...interactiveProps, children: rowContent }));
17
67
  }