@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
@@ -0,0 +1,30 @@
1
+ import type { JSX, ReactNode } from 'react';
2
+ interface Props {
3
+ /**
4
+ * List rows. Each child should render as an `<li>` (e.g. {@link SidebarCommitItem} `as="li"`).
5
+ */
6
+ children: ReactNode;
7
+ /**
8
+ * Accessible name for the list when the section title is not sufficient.
9
+ */
10
+ 'aria-label'?: string;
11
+ /**
12
+ * Additional classes merged onto the list element.
13
+ */
14
+ className?: string;
15
+ }
16
+ /**
17
+ * Accessible list container for non-selectable sidebar rows.
18
+ *
19
+ * Wrap rows rendered with `as="li"` so each child is a `role="listitem"`.
20
+ *
21
+ * @example
22
+ * ```tsx
23
+ * <SidebarList aria-label="Commits">
24
+ * <SidebarCommitItem as="li" message="Fix auth" author="Alex" timestampLabel="2h ago" icon={faCodeBranch} />
25
+ * </SidebarList>
26
+ * ```
27
+ */
28
+ export declare function SidebarList({ children, 'aria-label': ariaLabel, className }: Props): JSX.Element;
29
+ export {};
30
+ //# sourceMappingURL=SidebarList.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SidebarList.d.ts","sourceRoot":"","sources":["../../../src/components/SidebarItem/SidebarList.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAG5C,UAAU,KAAK;IACb;;OAEG;IACH,QAAQ,EAAE,SAAS,CAAC;IAEpB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,WAAW,CAAC,EAAE,QAAQ,EAAE,YAAY,EAAE,SAAS,EAAE,SAAS,EAAE,EAAE,KAAK,GAAG,GAAG,CAAC,OAAO,CAMhG"}
@@ -0,0 +1,17 @@
1
+ import { jsx as _jsx } from "@harborclient/sdk/jsx-runtime";
2
+ import { cn } from '../utils.js';
3
+ /**
4
+ * Accessible list container for non-selectable sidebar rows.
5
+ *
6
+ * Wrap rows rendered with `as="li"` so each child is a `role="listitem"`.
7
+ *
8
+ * @example
9
+ * ```tsx
10
+ * <SidebarList aria-label="Commits">
11
+ * <SidebarCommitItem as="li" message="Fix auth" author="Alex" timestampLabel="2h ago" icon={faCodeBranch} />
12
+ * </SidebarList>
13
+ * ```
14
+ */
15
+ export function SidebarList({ children, 'aria-label': ariaLabel, className }) {
16
+ return (_jsx("ul", { role: "list", "aria-label": ariaLabel, className: cn('m-0 list-none p-0', className), children: children }));
17
+ }
@@ -0,0 +1,35 @@
1
+ import type { JSX, ReactNode } from 'react';
2
+ interface Props {
3
+ /**
4
+ * Listbox option rows. Each child should be a {@link SidebarItem} with `as="li"`.
5
+ */
6
+ children: ReactNode;
7
+ /**
8
+ * When true, multiple options may be selected at once.
9
+ */
10
+ multiselectable?: boolean;
11
+ /**
12
+ * Accessible name for the listbox when the section title is not sufficient.
13
+ */
14
+ 'aria-label'?: string;
15
+ /**
16
+ * Additional classes merged onto the listbox element.
17
+ */
18
+ className?: string;
19
+ }
20
+ /**
21
+ * Accessible listbox container for flat sidebar item lists.
22
+ *
23
+ * Wrap rows rendered with {@link SidebarItem} `as="li"` and `listboxOption` so
24
+ * each row exposes `role="option"` and `aria-selected` correctly.
25
+ *
26
+ * @example
27
+ * ```tsx
28
+ * <SidebarListbox aria-label="Collections">
29
+ * <SidebarRequestItem as="li" name="List users" method="GET" />
30
+ * </SidebarListbox>
31
+ * ```
32
+ */
33
+ export declare function SidebarListbox({ children, multiselectable, 'aria-label': ariaLabel, className }: Props): JSX.Element;
34
+ export {};
35
+ //# sourceMappingURL=SidebarListbox.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SidebarListbox.d.ts","sourceRoot":"","sources":["../../../src/components/SidebarItem/SidebarListbox.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAG5C,UAAU,KAAK;IACb;;OAEG;IACH,QAAQ,EAAE,SAAS,CAAC;IAEpB;;OAEG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAE1B;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,cAAc,CAAC,EAC7B,QAAQ,EACR,eAAuB,EACvB,YAAY,EAAE,SAAS,EACvB,SAAS,EACV,EAAE,KAAK,GAAG,GAAG,CAAC,OAAO,CAWrB"}
@@ -0,0 +1,18 @@
1
+ import { jsx as _jsx } from "@harborclient/sdk/jsx-runtime";
2
+ import { cn } from '../utils.js';
3
+ /**
4
+ * Accessible listbox container for flat sidebar item lists.
5
+ *
6
+ * Wrap rows rendered with {@link SidebarItem} `as="li"` and `listboxOption` so
7
+ * each row exposes `role="option"` and `aria-selected` correctly.
8
+ *
9
+ * @example
10
+ * ```tsx
11
+ * <SidebarListbox aria-label="Collections">
12
+ * <SidebarRequestItem as="li" name="List users" method="GET" />
13
+ * </SidebarListbox>
14
+ * ```
15
+ */
16
+ export function SidebarListbox({ children, multiselectable = false, 'aria-label': ariaLabel, className }) {
17
+ return (_jsx("ul", { role: "listbox", "aria-multiselectable": multiselectable ? true : undefined, "aria-label": ariaLabel, className: cn('m-0 list-none p-0', className), children: children }));
18
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"SidebarMethodBadge.d.ts","sourceRoot":"","sources":["../../../src/components/SidebarItem/SidebarMethodBadge.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAIjC,UAAU,KAAK;IACb;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,EAAE,MAAM,EAAE,SAAiB,EAAE,EAAE,KAAK,GAAG,GAAG,CAAC,OAAO,CAYpF"}
1
+ {"version":3,"file":"SidebarMethodBadge.d.ts","sourceRoot":"","sources":["../../../src/components/SidebarItem/SidebarMethodBadge.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAIjC,UAAU,KAAK;IACb;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,EAAE,MAAM,EAAE,SAAiB,EAAE,EAAE,KAAK,GAAG,GAAG,CAAC,OAAO,CASpF"}
@@ -7,5 +7,5 @@ import { METHOD_CLASSES } from './sidebarItemClasses.js';
7
7
  export function SidebarMethodBadge({ method, uppercase = false }) {
8
8
  const methodKey = method.toLowerCase();
9
9
  const colorClass = METHOD_CLASSES[methodKey] ?? 'text-info';
10
- return (_jsx("span", { className: cn('shrink-0 px-1 py-px', uppercase && 'font-medium uppercase', colorClass), "aria-hidden": uppercase ? true : undefined, children: method }));
10
+ return (_jsx("span", { className: cn('shrink-0 px-1 py-px', uppercase && 'font-medium uppercase', colorClass), children: method }));
11
11
  }
@@ -43,35 +43,27 @@ interface Props {
43
43
  */
44
44
  onContextMenu?: (event: MouseEvent<HTMLElement>) => void;
45
45
  /**
46
- * Called when the primary label button is clicked.
46
+ * Called when the primary label area is activated.
47
47
  */
48
- onClick?: (event: MouseEvent<HTMLButtonElement>) => void;
49
- /**
50
- * Accessible label for the primary button.
51
- */
52
- ariaLabel?: string;
53
- /**
54
- * When true, sets aria-current="true" on the primary button.
55
- */
56
- ariaCurrent?: boolean;
57
- /**
58
- * When true, sets aria-selected="true" on the primary button.
59
- */
60
- ariaSelected?: boolean;
48
+ onClick?: (event: MouseEvent<HTMLElement>) => void;
61
49
  /**
62
50
  * Trailing actions slot, typically a row actions menu.
63
51
  */
64
52
  actions?: ReactNode;
65
53
  /**
66
- * HTML element for the row container when not sortable.
54
+ * HTML element for the row container. Use `li` inside {@link SidebarListbox}.
67
55
  */
68
56
  as?: 'div' | 'li';
69
57
  }
70
58
  /**
71
59
  * Renders a saved-request sidebar row with method badge, optional color dot or git
72
60
  * status marker, and shared row chrome. Used in both Collections and Git sidebars.
61
+ *
62
+ * The accessible name is derived from visible row content (method, name, markers).
63
+ *
64
+ * Wrap lists in {@link SidebarListbox} and pass `as="li"` for valid listbox semantics.
73
65
  */
74
- export declare function SidebarRequestItem({ method, name, nameClassName, colorDot, statusMarker, selected, sortable, onContextMenu, onClick, ariaLabel, ariaCurrent, ariaSelected, actions, as }: Props): JSX.Element;
66
+ export declare function SidebarRequestItem({ method, name, nameClassName, colorDot, statusMarker, selected, sortable, onContextMenu, onClick, actions, as }: Props): JSX.Element;
75
67
  interface DocumentProps {
76
68
  /**
77
69
  * Icon shown before the document name. Defaults to a file-lines icon when omitted.
@@ -110,34 +102,28 @@ interface DocumentProps {
110
102
  */
111
103
  onContextMenu?: (event: MouseEvent<HTMLElement>) => void;
112
104
  /**
113
- * Called when the primary label button is clicked.
114
- */
115
- onClick?: (event: MouseEvent<HTMLButtonElement>) => void;
116
- /**
117
- * Called when the primary label button is double-clicked.
118
- */
119
- onDoubleClick?: (event: MouseEvent<HTMLButtonElement>) => void;
120
- /**
121
- * Accessible label for the primary button.
105
+ * Called when the primary label area is activated.
122
106
  */
123
- ariaLabel?: string;
107
+ onClick?: (event: MouseEvent<HTMLElement>) => void;
124
108
  /**
125
- * When true, sets aria-current="true" on the primary button.
109
+ * Called when the primary label area is double-clicked.
126
110
  */
127
- ariaCurrent?: boolean;
111
+ onDoubleClick?: (event: MouseEvent<HTMLElement>) => void;
128
112
  /**
129
113
  * Trailing actions slot, typically a row actions menu.
130
114
  */
131
115
  actions?: ReactNode;
132
116
  /**
133
- * HTML element for the row container.
117
+ * HTML element for the row container. Use `li` inside {@link SidebarListbox}.
134
118
  */
135
119
  as?: 'div' | 'li';
136
120
  }
137
121
  /**
138
122
  * Renders a markdown document sidebar row with file icon, optional color dot or git
139
123
  * status marker, and shared row chrome. Used in both Collections and Git sidebars.
124
+ *
125
+ * The accessible name is derived from visible row content (name, markers).
140
126
  */
141
- export declare function SidebarDocumentItem({ icon, name, nameClassName, colorDot, statusMarker, selected, onContextMenu, onClick, onDoubleClick, ariaLabel, ariaCurrent, actions, as }: DocumentProps): JSX.Element;
127
+ export declare function SidebarDocumentItem({ icon, name, nameClassName, colorDot, statusMarker, selected, onContextMenu, onClick, onDoubleClick, actions, as }: DocumentProps): JSX.Element;
142
128
  export {};
143
129
  //# sourceMappingURL=SidebarRequestItem.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"SidebarRequestItem.d.ts","sourceRoot":"","sources":["../../../src/components/SidebarItem/SidebarRequestItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AAExE,OAAO,KAAK,EAAE,GAAG,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGxD,OAAO,EAAe,KAAK,yBAAyB,EAAE,MAAM,kBAAkB,CAAC;AAK/E,UAAU,KAAK;IACb;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB;;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,YAAY,CAAC,EAAE;QACb,MAAM,EAAE,MAAM,CAAC;QACf,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,KAAK,EAAE,MAAM,CAAC;KACf,CAAC;IAEF;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;OAEG;IACH,QAAQ,CAAC,E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,CAAC,EAAE,OAAO,CAAC;IAEnB;;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,CAAC,KAAK,EAAE,UAAU,CAAC,iBAAiB,CAAC,KAAK,IAAI,CAAC;IAE/D;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IAEtB;;OAEG;IACH,OAAO,CAAC,EAAE,SAAS,CAAC;IAEpB;;OAEG;IACH,EAAE,CAAC,EAAE,KAAK,GAAG,IAAI,CAAC;CACnB;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,EAClC,IAAkB,EAClB,IAAI,EACJ,aAAa,EACb,QAAQ,EACR,YAAY,EACZ,QAAgB,EAChB,aAAa,EACb,OAAO,EACP,aAAa,EACb,SAAS,EACT,WAAmB,EACnB,OAAO,EACP,EAAU,EACX,EAAE,aAAa,GAAG,GAAG,CAAC,OAAO,CAkC7B"}
1
+ {"version":3,"file":"SidebarRequestItem.d.ts","sourceRoot":"","sources":["../../../src/components/SidebarItem/SidebarRequestItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AAExE,OAAO,KAAK,EAAE,GAAG,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGxD,OAAO,EAAe,KAAK,yBAAyB,EAAE,MAAM,kBAAkB,CAAC;AAK/E,UAAU,KAAK;IACb;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IAEv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AClB,KAAK,CAAC,EAAE,MAAM,CAAC;KAChB,CAAC;IAEF;;OAEG;IACH,YAAY,CAAC,EAAE;QACb,MAAM,EAAE,MAAM,CAAC;QACf,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,KAAK,EAAE,MAAM,CAAC;KACf,CAAC;IAEF;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;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,SAAS,CAAC;IAEpB;;OAEG;IACH,EAAE,CAAC,EAAE,KAAK,GAAG,IAAI,CAAC;CACnB;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,EAClC,IAAkB,EAClB,IAAI,EACJ,aAAa,EACb,QAAQ,EACR,YAAY,EACZ,QAAgB,EAChB,aAAa,EACb,OAAO,EACP,aAAa,EACb,OAAO,EACP,EAAS,EACV,EAAE,aAAa,GAAG,GAAG,CAAC,OAAO,CA0C7B"}
@@ -9,14 +9,31 @@ import { SIDEBAR_ITEM_BUTTON_CLASS } from './sidebarItemClasses.js';
9
9
  /**
10
10
  * Renders a saved-request sidebar row with method badge, optional color dot or git
11
11
  * status marker, and shared row chrome. Used in both Collections and Git sidebars.
12
+ *
13
+ * The accessible name is derived from visible row content (method, name, markers).
14
+ *
15
+ * Wrap lists in {@link SidebarListbox} and pass `as="li"` for valid listbox semantics.
12
16
  */
13
- export function SidebarRequestItem({ method, name, nameClassName, colorDot, statusMarker, selected = false, sortable, onContextMenu, onClick, ariaLabel, ariaCurrent = false, ariaSelected = false, actions, as = 'div' }) {
14
- return (_jsx(SidebarItem, { selected: selected, sortable: sortable, onContextMenu: onContextMenu, actions: actions, as: as, children: _jsxs("button", { type: "button", className: SIDEBAR_ITEM_BUTTON_CLASS, "aria-current": ariaCurrent ? 'true' : undefined, "aria-selected": ariaSelected ? 'true' : undefined, "aria-label": ariaLabel, onClick: onClick, children: [_jsx(SidebarMethodBadge, { method: method }), colorDot != null ? (_jsxs("span", { className: "inline-flex min-w-0 items-center gap-1.5", children: [_jsx("span", { className: `min-w-0 truncate ${nameClassName ?? ''}`, children: name }), _jsx(SidebarColorDot, { color: colorDot.color, visible: colorDot.visible, label: colorDot.label })] })) : (_jsx("span", { className: `min-w-0 truncate ${nameClassName ?? ''}`, children: name })), statusMarker != null ? (_jsx(SidebarStatusMarker, { marker: statusMarker.marker, className: statusMarker.className, label: statusMarker.label })) : null] }) }));
17
+ export function SidebarRequestItem({ method, name, nameClassName, colorDot, statusMarker, selected = false, sortable, onContextMenu, onClick, actions, as = 'li' }) {
18
+ const useListboxOption = as === 'li';
19
+ return (_jsx(SidebarItem, { selected: selected, sortable: sortable, onContextMenu: onContextMenu, actions: actions, as: as, listboxOption: useListboxOption
20
+ ? {
21
+ onClick
22
+ }
23
+ : undefined, children: _jsxs("span", { className: SIDEBAR_ITEM_BUTTON_CLASS, children: [_jsx(SidebarMethodBadge, { method: method }), colorDot != null ? (_jsxs("span", { className: "inline-flex min-w-0 items-center gap-1.5", children: [_jsx("span", { className: `min-w-0 truncate ${nameClassName ?? ''}`, children: name }), _jsx(SidebarColorDot, { color: colorDot.color, visible: colorDot.visible, label: colorDot.label })] })) : (_jsx("span", { className: `min-w-0 truncate ${nameClassName ?? ''}`, children: name })), statusMarker != null ? (_jsx(SidebarStatusMarker, { marker: statusMarker.marker, className: statusMarker.className, label: statusMarker.label })) : null] }) }));
15
24
  }
16
25
  /**
17
26
  * Renders a markdown document sidebar row with file icon, optional color dot or git
18
27
  * status marker, and shared row chrome. Used in both Collections and Git sidebars.
28
+ *
29
+ * The accessible name is derived from visible row content (name, markers).
19
30
  */
20
- export function SidebarDocumentItem({ icon = faFileLines, name, nameClassName, colorDot, statusMarker, selected = false, onContextMenu, onClick, onDoubleClick, ariaLabel, ariaCurrent = false, actions, as = 'div' }) {
21
- return (_jsx(SidebarItem, { selected: selected, onContextMenu: onContextMenu, actions: actions, as: as, children: _jsxs("button", { type: "button", className: SIDEBAR_ITEM_BUTTON_CLASS, "aria-current": ariaCurrent ? 'true' : undefined, "aria-label": ariaLabel, onClick: onClick, onDoubleClick: onDoubleClick, children: [_jsx(FaIcon, { icon: icon, className: "h-3.5 w-3.5 shrink-0 text-muted", "aria-hidden": true }), colorDot != null ? (_jsxs("span", { className: "inline-flex min-w-0 items-center gap-1.5", children: [_jsx("span", { className: `min-w-0 truncate ${nameClassName ?? ''}`, children: name }), _jsx(SidebarColorDot, { color: colorDot.color, visible: colorDot.visible, label: colorDot.label })] })) : (_jsx("span", { className: `min-w-0 truncate ${nameClassName ?? ''}`, children: name })), statusMarker != null ? (_jsx(SidebarStatusMarker, { marker: statusMarker.marker, className: statusMarker.className, label: statusMarker.label })) : null] }) }));
31
+ export function SidebarDocumentItem({ icon = faFileLines, name, nameClassName, colorDot, statusMarker, selected = false, onContextMenu, onClick, onDoubleClick, actions, as = 'li' }) {
32
+ const useListboxOption = as === 'li';
33
+ return (_jsx(SidebarItem, { selected: selected, onContextMenu: onContextMenu, actions: actions, as: as, listboxOption: useListboxOption
34
+ ? {
35
+ onClick,
36
+ onDoubleClick
37
+ }
38
+ : undefined, children: _jsxs("span", { className: SIDEBAR_ITEM_BUTTON_CLASS, children: [_jsx(FaIcon, { icon: icon, className: "h-3.5 w-3.5 shrink-0 text-muted", "aria-hidden": true }), colorDot != null ? (_jsxs("span", { className: "inline-flex min-w-0 items-center gap-1.5", children: [_jsx("span", { className: `min-w-0 truncate ${nameClassName ?? ''}`, children: name }), _jsx(SidebarColorDot, { color: colorDot.color, visible: colorDot.visible, label: colorDot.label })] })) : (_jsx("span", { className: `min-w-0 truncate ${nameClassName ?? ''}`, children: name })), statusMarker != null ? (_jsx(SidebarStatusMarker, { marker: statusMarker.marker, className: statusMarker.className, label: statusMarker.label })) : null] }) }));
22
39
  }
@@ -25,21 +25,17 @@ interface Props {
25
25
  */
26
26
  selected?: boolean;
27
27
  /**
28
- * Tooltip title for the primary button.
28
+ * Tooltip title for the primary label area.
29
29
  */
30
30
  title?: string;
31
- /**
32
- * Accessible label for the primary button.
33
- */
34
- ariaLabel: string;
35
31
  /**
36
32
  * Called when the user right-clicks the row container.
37
33
  */
38
34
  onContextMenu?: (event: MouseEvent<HTMLElement>) => void;
39
35
  /**
40
- * Called when the primary row button is clicked.
36
+ * Called when the primary row area is activated.
41
37
  */
42
- onClick?: (event: MouseEvent<HTMLButtonElement>) => void;
38
+ onClick?: (event: MouseEvent<HTMLElement>) => void;
43
39
  /**
44
40
  * Trailing actions slot, typically a row actions menu.
45
41
  */
@@ -48,10 +44,17 @@ interface Props {
48
44
  * Optional data attribute value for keyboard navigation focus targets.
49
45
  */
50
46
  dataSidebarRunResultId?: string | number;
47
+ /**
48
+ * HTML element for the row container. Use `li` inside {@link SidebarListbox}.
49
+ */
50
+ as?: 'div' | 'li';
51
51
  }
52
52
  /**
53
53
  * Renders a saved run result row in the Collections sidebar Runs section.
54
+ *
55
+ * The accessible name is derived from visible row content (method, label, connection badge,
56
+ * status summary).
54
57
  */
55
- export declare function SidebarRunItem({ method, label, connectionBadge, statusDotClassName, statusSummary, selected, title, ariaLabel, onContextMenu, onClick, actions, dataSidebarRunResultId }: Props): JSX.Element;
58
+ export declare function SidebarRunItem({ method, label, connectionBadge, statusDotClassName, statusSummary, selected, title, onContextMenu, onClick, actions, dataSidebarRunResultId, as }: Props): JSX.Element;
56
59
  export {};
57
60
  //# sourceMappingURL=SidebarRunItem.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"SidebarRunItem.d.ts","sourceRoot":"","sources":["../../../src/components/SidebarItem/SidebarRunItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAMxD,UAAU,KAAK;IACb;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IAEzB;;OAEG;IACH,kBAAkB,EAAE,MAAM,CAAC;IAE3B;;OAEG;IACH,aAAa,EAAE,MAAM,CAAC;IAEtB;;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;IAEpB;;OAEG;IACH,sBAAsB,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CAC1C;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,EAC7B,MAAM,EACN,KAAK,EACL,eAAe,EACf,kBAAkB,EAClB,aAAa,EACb,QAAgB,EAChB,KAAK,EACL,SAAS,EACT,aAAa,EACb,OAAO,EACP,OAAO,EACP,sBAAsB,EACvB,EAAE,KAAK,GAAG,GAAG,CAAC,OAAO,CA8BrB"}
1
+ {"version":3,"file":"SidebarRunItem.d.ts","sourceRoot":"","sources":["../../../src/components/SidebarItem/SidebarRunItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAMxD,UAAU,KAAK;IACb;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IAEzB;;OAEG;IACH,kBAAkB,EAAE,MAAM,CAAC;IAE3B;;OAEG;IACH,aAAa,EAAE,MAAM,CAAC;IAEtB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;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,sBAAsB,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAEzC;;OAEG;IACH,EAAE,CAAC,EAAE,KAAK,GAAG,IAAI,CAAC;CACnB;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,EAC7B,MAAM,EACN,KAAK,EACL,eAAe,EACf,kBAAkB,EAClB,aAAa,EACb,QAAgB,EAChB,KAAK,EACL,aAAa,EACb,OAAO,EACP,OAAO,EACP,sBAAsB,EACtB,EAAS,EACV,EAAE,KAAK,GAAG,GAAG,CAAC,OAAO,CAwCrB"}
@@ -1,13 +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 { SidebarItem } from './SidebarItem.js';
4
3
  import { SidebarMethodBadge } from './SidebarMethodBadge.js';
5
4
  import { SidebarStatusDot } from './SidebarStatusDot.js';
5
+ import { SIDEBAR_ITEM_BUTTON_CLASS } from './sidebarItemClasses.js';
6
6
  /**
7
7
  * Renders a saved run result row in the Collections sidebar Runs section.
8
+ *
9
+ * The accessible name is derived from visible row content (method, label, connection badge,
10
+ * status summary).
8
11
  */
9
- export function SidebarRunItem({ method, label, connectionBadge, statusDotClassName, statusSummary, selected = false, title, ariaLabel, onContextMenu, onClick, actions, dataSidebarRunResultId }) {
10
- 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", ...(dataSidebarRunResultId != null
12
+ export function SidebarRunItem({ method, label, connectionBadge, statusDotClassName, statusSummary, selected = false, title, onContextMenu, onClick, actions, dataSidebarRunResultId, as = 'li' }) {
13
+ const useListboxOption = as === 'li';
14
+ return (_jsx(SidebarItem, { selected: selected, onContextMenu: onContextMenu, actions: actions, as: as, listboxOption: useListboxOption
15
+ ? {
16
+ onClick
17
+ }
18
+ : undefined, children: _jsxs("span", { className: `${SIDEBAR_ITEM_BUTTON_CLASS} py-0.5`, title: title, ...(dataSidebarRunResultId != null
11
19
  ? { 'data-sidebar-run-result-id': String(dataSidebarRunResultId) }
12
- : {}), title: title, "aria-label": ariaLabel, "aria-selected": selected ? 'true' : undefined, onClick: onClick, children: [method != null && method !== '' ? _jsx(SidebarMethodBadge, { method: method, uppercase: true }) : null, _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: label }), connectionBadge != null ? (_jsx("span", { className: "shrink-0 rounded bg-info/15 px-1.5 py-0.5 text-[14px] font-medium text-info", title: `Stored in ${connectionBadge}`, children: connectionBadge })) : null] }), _jsx(SidebarStatusDot, { className: statusDotClassName, srOnlyLabel: statusSummary })] }) }));
20
+ : {}), children: [method != null && method !== '' ? _jsx(SidebarMethodBadge, { method: method, uppercase: true }) : null, _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: label }), connectionBadge != null ? (_jsx("span", { className: "shrink-0 rounded bg-info/15 px-1.5 py-0.5 text-[14px] font-medium text-info", title: `Stored in ${connectionBadge}`, children: connectionBadge })) : null] }), _jsx(SidebarStatusDot, { className: statusDotClassName, srOnlyLabel: statusSummary })] }) }));
13
21
  }
@@ -4,5 +4,5 @@ import { cn } from '../utils.js';
4
4
  * Renders a git change status marker in square brackets after a file name.
5
5
  */
6
6
  export function SidebarStatusMarker({ marker, className, label }) {
7
- return (_jsxs("span", { className: cn('shrink-0', className), title: label, "aria-label": label, children: ["[", marker, "]"] }));
7
+ return (_jsxs("span", { className: cn('shrink-0', className), role: "img", title: label, "aria-label": label, children: ["[", marker, "]"] }));
8
8
  }
@@ -35,17 +35,21 @@ interface Props {
35
35
  */
36
36
  onContextMenu?: (event: MouseEvent<HTMLElement>) => void;
37
37
  /**
38
- * Called when the primary row button is clicked.
38
+ * Called when the primary row area is activated.
39
39
  */
40
- onClick?: (event: MouseEvent<HTMLButtonElement>) => void;
40
+ onClick?: (event: MouseEvent<HTMLElement>) => void;
41
41
  /**
42
42
  * Trailing actions slot, typically a row actions menu.
43
43
  */
44
44
  actions?: ReactNode;
45
+ /**
46
+ * HTML element for the row container. Use `li` inside {@link SidebarListbox}.
47
+ */
48
+ as?: 'div' | 'li';
45
49
  }
46
50
  /**
47
51
  * Renders a tab group row in the Collections sidebar Tab Groups section.
48
52
  */
49
- export declare function SidebarTabGroupItem({ name, summary, icon, colorDot, selected, sortable, onContextMenu, onClick, actions }: Props): JSX.Element;
53
+ export declare function SidebarTabGroupItem({ name, summary, icon, colorDot, selected, sortable, onContextMenu, onClick, actions, as }: Props): JSX.Element;
50
54
  export {};
51
55
  //# sourceMappingURL=SidebarTabGroupItem.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"SidebarTabGroupItem.d.ts","sourceRoot":"","sources":["../../../src/components/SidebarItem/SidebarTabGroupItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AAC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,OAAO,CAAC;AAGxD,OAAO,EAAe,KAAK,yBAAyB,EAAE,MAAM,kBAAkB,CAAC;AAG/E,UAAU,KAAK;IACb;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,IAAI,EAAE,cAAc,CAAC;IAErB;;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;;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,mBAAmB,CAAC,EAClC,IAAI,EACJ,OAAO,EACP,IAAI,EACJ,QAAQ,EACR,QAAgB,EAChB,QAAQ,EACR,aAAa,EACb,OAAO,EACP,OAAO,EACP,EAAS,EACV,EAAE,KAAK,GAAG,GAAG,CAAC,OAAO,CAkCrB"}
@@ -1,11 +1,16 @@
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 { SidebarColorDot } from './SidebarColorDot.js';
5
4
  import { SidebarItem } from './SidebarItem.js';
5
+ import { SIDEBAR_ITEM_BUTTON_CLASS } from './sidebarItemClasses.js';
6
6
  /**
7
7
  * Renders a tab group row in the Collections sidebar Tab Groups section.
8
8
  */
9
- export function SidebarTabGroupItem({ name, summary, icon, colorDot, selected = false, sortable, onContextMenu, onClick, actions }) {
10
- return (_jsx(SidebarItem, { selected: selected, sortable: sortable, onContextMenu: onContextMenu, actions: actions, children: _jsxs(Button, { variant: "toolbar", className: "min-w-0 flex-1 justify-start gap-2 rounded-md px-2 py-1 text-left text-text hover:bg-transparent", "aria-selected": selected ? 'true' : undefined, onClick: onClick, children: [_jsx(FaIcon, { icon: icon, className: "h-3.5 w-3.5 shrink-0 text-muted", "aria-hidden": true }), _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: summary })] }) }));
9
+ export function SidebarTabGroupItem({ name, summary, icon, colorDot, selected = false, sortable, onContextMenu, onClick, actions, as = 'li' }) {
10
+ const useListboxOption = as === 'li';
11
+ return (_jsx(SidebarItem, { selected: selected, sortable: sortable, onContextMenu: onContextMenu, actions: actions, as: as, listboxOption: useListboxOption
12
+ ? {
13
+ onClick
14
+ }
15
+ : undefined, children: _jsxs("span", { className: `${SIDEBAR_ITEM_BUTTON_CLASS} gap-2 rounded-md px-2 py-1`, children: [_jsx(FaIcon, { icon: icon, className: "h-3.5 w-3.5 shrink-0 text-muted", "aria-hidden": true }), _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: summary })] }) }));
11
16
  }
@@ -0,0 +1,55 @@
1
+ import type { JSX, ReactNode } from 'react';
2
+ interface TreeProps {
3
+ /**
4
+ * Tree rows. Each child should be a {@link SidebarFolderItem} with `as="li"`.
5
+ */
6
+ children: ReactNode;
7
+ /**
8
+ * Accessible name for the tree when the section title is not sufficient.
9
+ */
10
+ 'aria-label'?: string;
11
+ /**
12
+ * Additional classes merged onto the tree element.
13
+ */
14
+ className?: string;
15
+ }
16
+ /**
17
+ * Accessible tree container for nested sidebar folder hierarchies.
18
+ *
19
+ * Wrap folder rows rendered with {@link SidebarFolderItem} `as="li"` and
20
+ * `treeItem` so each row exposes `role="treeitem"` with expand/collapse state.
21
+ *
22
+ * @example
23
+ * ```tsx
24
+ * <SidebarTree aria-label="Collections">
25
+ * <SidebarFolderItem as="li" name="Auth" expanded childrenId="auth-children" />
26
+ * <SidebarTreeGroup id="auth-children">
27
+ * <SidebarRequestItem as="li" name="Login" method="POST" />
28
+ * </SidebarTreeGroup>
29
+ * </SidebarTree>
30
+ * ```
31
+ */
32
+ export declare function SidebarTree({ children, 'aria-label': ariaLabel, className }: TreeProps): JSX.Element;
33
+ interface TreeGroupProps {
34
+ /**
35
+ * Child tree rows or nested groups.
36
+ */
37
+ children: ReactNode;
38
+ /**
39
+ * Stable id referenced by the parent treeitem's `aria-controls`.
40
+ */
41
+ id: string;
42
+ /**
43
+ * Additional classes merged onto the group element.
44
+ */
45
+ className?: string;
46
+ }
47
+ /**
48
+ * Child region for an expanded folder treeitem.
49
+ *
50
+ * Renders `role="group"` and must use the same `id` passed to the parent
51
+ * folder's `childrenId` / `aria-controls`.
52
+ */
53
+ export declare function SidebarTreeGroup({ children, id, className }: TreeGroupProps): JSX.Element;
54
+ export {};
55
+ //# sourceMappingURL=SidebarTree.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SidebarTree.d.ts","sourceRoot":"","sources":["../../../src/components/SidebarItem/SidebarTree.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAG5C,UAAU,SAAS;IACjB;;OAEG;IACH,QAAQ,EAAE,SAAS,CAAC;IAEpB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,WAAW,CAAC,EAC1B,QAAQ,EACR,YAAY,EAAE,SAAS,EACvB,SAAS,EACV,EAAE,SAAS,GAAG,GAAG,CAAC,OAAO,CAMzB;AAED,UAAU,cAAc;IACtB;;OAEG;IACH,QAAQ,EAAE,SAAS,CAAC;IAEpB;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE,SAAS,EAAE,EAAE,cAAc,GAAG,GAAG,CAAC,OAAO,CAMzF"}
@@ -0,0 +1,30 @@
1
+ import { jsx as _jsx } from "@harborclient/sdk/jsx-runtime";
2
+ import { cn } from '../utils.js';
3
+ /**
4
+ * Accessible tree container for nested sidebar folder hierarchies.
5
+ *
6
+ * Wrap folder rows rendered with {@link SidebarFolderItem} `as="li"` and
7
+ * `treeItem` so each row exposes `role="treeitem"` with expand/collapse state.
8
+ *
9
+ * @example
10
+ * ```tsx
11
+ * <SidebarTree aria-label="Collections">
12
+ * <SidebarFolderItem as="li" name="Auth" expanded childrenId="auth-children" />
13
+ * <SidebarTreeGroup id="auth-children">
14
+ * <SidebarRequestItem as="li" name="Login" method="POST" />
15
+ * </SidebarTreeGroup>
16
+ * </SidebarTree>
17
+ * ```
18
+ */
19
+ export function SidebarTree({ children, 'aria-label': ariaLabel, className }) {
20
+ return (_jsx("ul", { role: "tree", "aria-label": ariaLabel, className: cn('m-0 list-none p-0', className), children: children }));
21
+ }
22
+ /**
23
+ * Child region for an expanded folder treeitem.
24
+ *
25
+ * Renders `role="group"` and must use the same `id` passed to the parent
26
+ * folder's `childrenId` / `aria-controls`.
27
+ */
28
+ export function SidebarTreeGroup({ children, id, className }) {
29
+ return (_jsx("ul", { role: "group", id: id, className: cn('m-0 list-none p-0', className), children: children }));
30
+ }
@@ -1,9 +1,13 @@
1
- import type { JSX, MouseEvent, ReactNode } from 'react';
1
+ import type { JSX, KeyboardEvent, MouseEvent, ReactNode } from 'react';
2
2
  interface Props {
3
3
  /**
4
4
  * Stable dnd-kit sortable id for this row.
5
5
  */
6
6
  id: string;
7
+ /**
8
+ * Row container element.
9
+ */
10
+ as?: 'div' | 'li';
7
11
  /**
8
12
  * Row container class names.
9
13
  */
@@ -24,12 +28,27 @@ interface Props {
24
28
  * Called when the user right-clicks the row container.
25
29
  */
26
30
  onRowContextMenu?: (event: MouseEvent<HTMLElement>) => void;
31
+ /**
32
+ * Optional listbox option or treeitem attributes forwarded from {@link SidebarItem}.
33
+ */
34
+ role?: 'option' | 'treeitem';
35
+ 'aria-selected'?: 'true' | 'false';
36
+ 'aria-label'?: string;
37
+ 'aria-expanded'?: 'true' | 'false';
38
+ 'aria-controls'?: string;
39
+ 'aria-level'?: number;
40
+ 'aria-setsize'?: number;
41
+ 'aria-posinset'?: number;
42
+ tabIndex?: number;
43
+ onClick?: (event: MouseEvent<HTMLElement>) => void;
44
+ onDoubleClick?: (event: MouseEvent<HTMLElement>) => void;
45
+ onKeyDown?: (event: KeyboardEvent<HTMLElement>) => void;
27
46
  }
28
47
  /**
29
- * Wraps a sidebar row with dnd-kit sortable drag behavior. The row itself is
30
- * the drag activator; nested controls should call
31
- * {@link stopSortableDragPointerDown} so expand and menu actions do not start a drag.
48
+ * Wraps a sidebar row with dnd-kit sortable drag behavior. Reordering is activated
49
+ * from a dedicated grip handle so keyboard users can focus it and use the keyboard
50
+ * sensor; listbox option interaction and nested row controls stay on the row container.
32
51
  */
33
- export declare function SortableSidebarItem({ id, className, dragHandleLabel, children, disabled, onRowContextMenu }: Props): JSX.Element;
52
+ export declare function SortableSidebarItem({ id, as: Container, className, dragHandleLabel, children, disabled, onRowContextMenu, role, 'aria-selected': ariaSelected, 'aria-label': ariaLabel, 'aria-expanded': ariaExpanded, 'aria-controls': ariaControls, 'aria-level': ariaLevel, 'aria-setsize': ariaSetSize, 'aria-posinset': ariaPosInSet, tabIndex, onClick, onDoubleClick, onKeyDown }: Props): JSX.Element;
34
53
  export {};
35
54
  //# sourceMappingURL=SortableSidebarItem.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"SortableSidebarItem.d.ts","sourceRoot":"","sources":["../../../src/components/SidebarItem/SortableSidebarItem.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAiB,GAAG,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvE,UAAU,KAAK;IACb;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,eAAe,EAAE,MAAM,CAAC;IAExB;;OAEG;IACH,QAAQ,EAAE,SAAS,CAAC;IAEpB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;OAEG;IACH,gBAAgB,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,CAAC,WAAW,CAAC,KAAK,IAAI,CAAC;CAC7D;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,EAClC,EAAE,EACF,SAAS,EACT,eAAe,EACf,QAAQ,EACR,QAAgB,EAChB,gBAAgB,EACjB,EAAE,KAAK,GAAG,GAAG,CAAC,OAAO,CA8CrB"}
1
+ {"version":3,"file":"SortableSidebarItem.d.ts","sourceRoot":"","sources":["../../../src/components/SidebarItem/SortableSidebarItem.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAiB,GAAG,EAAE,aAAa,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAItF,UAAU,KAAK;IACb;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;OAEG;IACH,EAAE,C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AAc,EAAE,WAAW,EAC3B,eAAe,EAAE,YAAY,EAC7B,QAAQ,EACR,OAAO,EACP,aAAa,EACb,SAAS,EACV,EAAE,KAAK,GAAG,GAAG,CAAC,OAAO,CAgErB"}
@@ -1,26 +1,40 @@
1
- import { jsx as _jsx } from "@harborclient/sdk/jsx-runtime";
1
+ import { jsx as _jsx, jsxs as _jsxs } from "@harborclient/sdk/jsx-runtime";
2
2
  import { useSortable } from '@dnd-kit/sortable';
3
3
  import { CSS } from '@dnd-kit/utilities';
4
+ import { faGripVertical } from '@fortawesome/free-solid-svg-icons';
5
+ import { FaIcon } from '../FaIcon/index.js';
6
+ import { SIDEBAR_DRAG_HANDLE_CLASS } from './sidebarItemClasses.js';
4
7
  /**
5
- * Wraps a sidebar row with dnd-kit sortable drag behavior. The row itself is
6
- * the drag activator; nested controls should call
7
- * {@link stopSortableDragPointerDown} so expand and menu actions do not start a drag.
8
+ * Wraps a sidebar row with dnd-kit sortable drag behavior. Reordering is activated
9
+ * from a dedicated grip handle so keyboard users can focus it and use the keyboard
10
+ * sensor; listbox option interaction and nested row controls stay on the row container.
8
11
  */
9
- export function SortableSidebarItem({ id, className, dragHandleLabel, children, disabled = false, onRowContextMenu }) {
12
+ export function SortableSidebarItem({ id, as: Container = 'div', className, dragHandleLabel, children, disabled = false, onRowContextMenu, role, 'aria-selected': ariaSelected, 'aria-label': ariaLabel, 'aria-expanded': ariaExpanded, 'aria-controls': ariaControls, 'aria-level': ariaLevel, 'aria-setsize': ariaSetSize, 'aria-posinset': ariaPosInSet, tabIndex, onClick, onDoubleClick, onKeyDown }) {
10
13
  const { attributes, listeners, setNodeRef, setActivatorNodeRef, transform, transition, isDragging } = useSortable({ id, disabled });
14
+ const isInteractiveRow = role === 'option' || role === 'treeitem';
15
+ const interactiveProps = isInteractiveRow
16
+ ? {
17
+ role,
18
+ 'aria-selected': ariaSelected,
19
+ ...(ariaLabel != null ? { 'aria-label': ariaLabel } : {}),
20
+ ...(ariaExpanded != null ? { 'aria-expanded': ariaExpanded } : {}),
21
+ ...(ariaControls != null ? { 'aria-controls': ariaControls } : {}),
22
+ ...(ariaLevel != null ? { 'aria-level': ariaLevel } : {}),
23
+ ...(ariaSetSize != null ? { 'aria-setsize': ariaSetSize } : {}),
24
+ ...(ariaPosInSet != null ? { 'aria-posinset': ariaPosInSet } : {}),
25
+ tabIndex,
26
+ ...(onClick != null ? { onClick } : {}),
27
+ ...(onDoubleClick != null ? { onDoubleClick } : {}),
28
+ ...(onKeyDown != null ? { onKeyDown } : {})
29
+ }
30
+ : {};
11
31
  if (disabled) {
12
- return (_jsx("div", { className: className, onContextMenu: onRowContextMenu, children: children }));
32
+ return (_jsx(Container, { className: className, onContextMenu: onRowContextMenu, ...interactiveProps, children: children }));
13
33
  }
14
34
  const style = {
15
35
  transform: CSS.Transform.toString(transform),
16
36
  transition: isDragging ? transition : undefined,
17
37
  opacity: isDragging ? 0.45 : undefined
18
38
  };
19
- const { role, tabIndex, ...sortableAttributes } = attributes;
20
- void role;
21
- void tabIndex;
22
- return (_jsx("div", { ref: (node) => {
23
- setNodeRef(node);
24
- setActivatorNodeRef(node);
25
- }, style: style, className: `${className} cursor-grab active:cursor-grabbing`, "aria-label": dragHandleLabel, tabIndex: -1, onContextMenu: onRowContextMenu, ...sortableAttributes, ...listeners, children: children }));
39
+ return (_jsxs(Container, { ref: setNodeRef, style: style, className: className, onContextMenu: onRowContextMenu, ...interactiveProps, children: [_jsx("button", { type: "button", ref: setActivatorNodeRef, className: SIDEBAR_DRAG_HANDLE_CLASS, "aria-label": dragHandleLabel, ...attributes, ...listeners, children: _jsx(FaIcon, { icon: faGripVertical, className: "h-2.5 w-2.5", "aria-hidden": true }) }), children] }));
26
40
  }