@harborclient/sdk 1.3.2 → 1.3.4

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 (102) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/dist/components/AnchorMenuPanel/index.d.ts +35 -0
  3. package/dist/components/AnchorMenuPanel/index.d.ts.map +1 -0
  4. package/dist/components/AnchorMenuPanel/index.js +364 -0
  5. package/dist/components/ColorPicker/index.d.ts +5 -1
  6. package/dist/components/ColorPicker/index.d.ts.map +1 -1
  7. package/dist/components/ColorPicker/index.js +2 -2
  8. package/dist/components/FilterButton/FilterButtonIcon.d.ts +29 -0
  9. package/dist/components/FilterButton/FilterButtonIcon.d.ts.map +1 -0
  10. package/dist/components/FilterButton/FilterButtonIcon.js +18 -0
  11. package/dist/components/FilterButton/index.d.ts +26 -0
  12. package/dist/components/FilterButton/index.d.ts.map +1 -0
  13. package/dist/components/FilterButton/index.js +14 -0
  14. package/dist/components/FormGroup/index.d.ts +7 -1
  15. package/dist/components/FormGroup/index.d.ts.map +1 -1
  16. package/dist/components/FormGroup/index.js +8 -11
  17. package/dist/components/PageSidebar/index.d.ts +1 -0
  18. package/dist/components/PageSidebar/index.d.ts.map +1 -1
  19. package/dist/components/PageSidebar/index.js +4 -13
  20. package/dist/components/Resizable/applyResizableSizes.d.ts +11 -0
  21. package/dist/components/Resizable/applyResizableSizes.d.ts.map +1 -0
  22. package/dist/components/Resizable/applyResizableSizes.js +34 -0
  23. package/dist/components/Resizable/footerPanelUtils.d.ts +1 -1
  24. package/dist/components/Resizable/footerPanelUtils.js +4 -4
  25. package/dist/components/Resizable/index.d.ts +1 -0
  26. package/dist/components/Resizable/index.d.ts.map +1 -1
  27. package/dist/components/Resizable/index.js +1 -0
  28. package/dist/components/Resizable/useResizable.d.ts +7 -1
  29. package/dist/components/Resizable/useResizable.d.ts.map +1 -1
  30. package/dist/components/Resizable/useResizable.js +141 -11
  31. package/dist/components/RowActionsMenu/index.d.ts +7 -1
  32. package/dist/components/RowActionsMenu/index.d.ts.map +1 -1
  33. package/dist/components/RowActionsMenu/index.js +40 -18
  34. package/dist/components/SettingFieldActions/index.d.ts +42 -0
  35. package/dist/components/SettingFieldActions/index.d.ts.map +1 -0
  36. package/dist/components/SettingFieldActions/index.js +66 -0
  37. package/dist/components/SidebarItem/SidebarDocumentItem.d.ts +6 -6
  38. package/dist/components/SidebarItem/SidebarDocumentItem.d.ts.map +1 -1
  39. package/dist/components/SidebarItem/SidebarDocumentItem.js +4 -4
  40. package/dist/components/SidebarItem/SidebarEnvironmentItem.d.ts +4 -4
  41. package/dist/components/SidebarItem/SidebarEnvironmentItem.d.ts.map +1 -1
  42. package/dist/components/SidebarItem/SidebarEnvironmentItem.js +3 -3
  43. package/dist/components/SidebarItem/SidebarFolderItem.d.ts +5 -5
  44. package/dist/components/SidebarItem/SidebarFolderItem.d.ts.map +1 -1
  45. package/dist/components/SidebarItem/SidebarFolderItem.js +4 -4
  46. package/dist/components/SidebarItem/SidebarHistoryItem.d.ts +13 -1
  47. package/dist/components/SidebarItem/SidebarHistoryItem.d.ts.map +1 -1
  48. package/dist/components/SidebarItem/SidebarHistoryItem.js +3 -3
  49. package/dist/components/SidebarItem/SidebarMarkerDot.d.ts +22 -0
  50. package/dist/components/SidebarItem/SidebarMarkerDot.d.ts.map +1 -0
  51. package/dist/components/SidebarItem/SidebarMarkerDot.js +11 -0
  52. package/dist/components/SidebarItem/SidebarMethodBadge.d.ts +9 -1
  53. package/dist/components/SidebarItem/SidebarMethodBadge.d.ts.map +1 -1
  54. package/dist/components/SidebarItem/SidebarMethodBadge.js +7 -5
  55. package/dist/components/SidebarItem/SidebarRequestItem.d.ts +9 -5
  56. package/dist/components/SidebarItem/SidebarRequestItem.d.ts.map +1 -1
  57. package/dist/components/SidebarItem/SidebarRequestItem.js +4 -4
  58. package/dist/components/SidebarItem/SidebarRunItem.d.ts +9 -1
  59. package/dist/components/SidebarItem/SidebarRunItem.d.ts.map +1 -1
  60. package/dist/components/SidebarItem/SidebarRunItem.js +2 -2
  61. package/dist/components/SidebarItem/SidebarStatusDot.d.ts +11 -1
  62. package/dist/components/SidebarItem/SidebarStatusDot.d.ts.map +1 -1
  63. package/dist/components/SidebarItem/SidebarStatusDot.js +10 -1
  64. package/dist/components/SidebarItem/{SidebarTabGroupItem.d.ts → SidebarWorkspaceItem.d.ts} +9 -9
  65. package/dist/components/SidebarItem/SidebarWorkspaceItem.d.ts.map +1 -0
  66. package/dist/components/SidebarItem/{SidebarTabGroupItem.js → SidebarWorkspaceItem.js} +4 -4
  67. package/dist/components/SidebarItem/index.d.ts +3 -3
  68. package/dist/components/SidebarItem/index.d.ts.map +1 -1
  69. package/dist/components/SidebarItem/index.js +3 -3
  70. package/dist/components/SidebarItem/sidebarItemClasses.d.ts +17 -0
  71. package/dist/components/SidebarItem/sidebarItemClasses.d.ts.map +1 -1
  72. package/dist/components/SidebarItem/sidebarItemClasses.js +26 -2
  73. package/dist/components/SidebarSection/SectionItem.d.ts.map +1 -1
  74. package/dist/components/SidebarSection/SectionItem.js +3 -1
  75. package/dist/components/SortButton/SortButtonIcon.d.ts +29 -0
  76. package/dist/components/SortButton/SortButtonIcon.d.ts.map +1 -0
  77. package/dist/components/SortButton/SortButtonIcon.js +18 -0
  78. package/dist/components/SortButton/SortMenu.d.ts +42 -0
  79. package/dist/components/SortButton/SortMenu.d.ts.map +1 -0
  80. package/dist/components/SortButton/SortMenu.js +137 -0
  81. package/dist/components/SortButton/SortMenuOption.d.ts +35 -0
  82. package/dist/components/SortButton/SortMenuOption.d.ts.map +1 -0
  83. package/dist/components/SortButton/SortMenuOption.js +18 -0
  84. package/dist/components/SortButton/index.d.ts +32 -0
  85. package/dist/components/SortButton/index.d.ts.map +1 -0
  86. package/dist/components/SortButton/index.js +15 -0
  87. package/dist/components/SortButton/sortOptions.d.ts +14 -0
  88. package/dist/components/SortButton/sortOptions.d.ts.map +1 -0
  89. package/dist/components/SortButton/sortOptions.js +1 -0
  90. package/dist/components/TabBar/types.d.ts +1 -1
  91. package/dist/components/index.d.ts +9 -2
  92. package/dist/components/index.d.ts.map +1 -1
  93. package/dist/components/index.js +8 -2
  94. package/dist/runtime/createBridgedPluginContext.js +170 -2
  95. package/dist/snippets.d.ts +22 -0
  96. package/dist/types.d.ts +913 -1
  97. package/dist/types.d.ts.map +1 -1
  98. package/package.json +3 -3
  99. package/dist/components/SidebarItem/SidebarColorDot.d.ts +0 -22
  100. package/dist/components/SidebarItem/SidebarColorDot.d.ts.map +0 -1
  101. package/dist/components/SidebarItem/SidebarColorDot.js +0 -11
  102. package/dist/components/SidebarItem/SidebarTabGroupItem.d.ts.map +0 -1
@@ -4,6 +4,10 @@ interface Props {
4
4
  * Tailwind background color class for the dot (e.g. from {@link statusDotClass}).
5
5
  */
6
6
  className: string;
7
+ /**
8
+ * When false, suppresses the indicator even when status data is available.
9
+ */
10
+ visible?: boolean;
7
11
  /**
8
12
  * Screen-reader text describing the status when a visible label is not shown.
9
13
  */
@@ -15,7 +19,13 @@ interface Props {
15
19
  }
16
20
  /**
17
21
  * Renders a small circular status indicator with optional screen-reader text.
22
+ *
23
+ * @param className - Tailwind background color class for the dot.
24
+ * @param visible - When false, returns null instead of rendering the indicator.
25
+ * @param srOnlyLabel - Screen-reader text describing the status.
26
+ * @param title - Native tooltip shown on hover.
27
+ * @returns The status indicator, or null when visibility is disabled.
18
28
  */
19
- export declare function SidebarStatusDot({ className, srOnlyLabel, title }: Props): JSX.Element;
29
+ export declare function SidebarStatusDot({ className, visible, srOnlyLabel, title }: Props): JSX.Element | null;
20
30
  export {};
21
31
  //# sourceMappingURL=SidebarStatusDot.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"SidebarStatusDot.d.ts","sourceRoot":"","sources":["../../../src/components/SidebarItem/SidebarStatusDot.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAGjC,UAAU,KAAK;IACb;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,EAAE,SAAS,EAAE,WAAW,EAAE,KAAK,EAAE,EAAE,KAAK,GAAG,GAAG,CAAC,OAAO,CAUtF"}
1
+ {"version":3,"file":"SidebarStatusDot.d.ts","sourceRoot":"","sources":["../../../src/components/SidebarItem/SidebarStatusDot.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAGjC,UAAU,KAAK;IACb;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAAC,EAC/B,SAAS,EACT,OAAc,EACd,WAAW,EACX,KAAK,EACN,EAAE,KAAK,GAAG,GAAG,CAAC,OAAO,GAAG,IAAI,CAc5B"}
@@ -2,7 +2,16 @@ import { jsx as _jsx, jsxs as _jsxs } from "@harborclient/sdk/jsx-runtime";
2
2
  import { cn } from '../utils.js';
3
3
  /**
4
4
  * Renders a small circular status indicator with optional screen-reader text.
5
+ *
6
+ * @param className - Tailwind background color class for the dot.
7
+ * @param visible - When false, returns null instead of rendering the indicator.
8
+ * @param srOnlyLabel - Screen-reader text describing the status.
9
+ * @param title - Native tooltip shown on hover.
10
+ * @returns The status indicator, or null when visibility is disabled.
5
11
  */
6
- export function SidebarStatusDot({ className, srOnlyLabel, title }) {
12
+ export function SidebarStatusDot({ className, visible = true, srOnlyLabel, title }) {
13
+ if (!visible) {
14
+ return null;
15
+ }
7
16
  return (_jsxs("span", { className: "flex shrink-0 items-center gap-1.5", title: title, children: [_jsx("span", { className: cn('inline-block h-2 w-2 shrink-0 rounded-full', className), "aria-hidden": "true" }), srOnlyLabel != null ? _jsx("span", { className: "sr-only", children: srOnlyLabel }) : null] }));
8
17
  }
@@ -3,7 +3,7 @@ import type { JSX, MouseEvent, ReactNode } from 'react';
3
3
  import { type SidebarItemSortableConfig } from './SidebarItem.js';
4
4
  interface Props {
5
5
  /**
6
- * Tab group display name.
6
+ * Workspace display name.
7
7
  */
8
8
  name: string;
9
9
  /**
@@ -11,14 +11,14 @@ interface Props {
11
11
  */
12
12
  summary: string;
13
13
  /**
14
- * Icon shown before the tab group name.
14
+ * Icon shown before the workspace name.
15
15
  */
16
16
  icon: IconDefinition;
17
17
  /**
18
- * Optional color dot beside the tab group name.
18
+ * Optional marker dot beside the workspace name.
19
19
  */
20
- colorDot?: {
21
- color: string | null | undefined;
20
+ markerDot?: {
21
+ marker: string | null | undefined;
22
22
  visible?: boolean;
23
23
  label?: string;
24
24
  };
@@ -27,7 +27,7 @@ interface Props {
27
27
  */
28
28
  selected?: boolean;
29
29
  /**
30
- * dnd-kit sortable configuration for tab group reordering.
30
+ * dnd-kit sortable configuration for workspace reordering.
31
31
  */
32
32
  sortable?: SidebarItemSortableConfig;
33
33
  /**
@@ -48,8 +48,8 @@ interface Props {
48
48
  as?: 'div' | 'li';
49
49
  }
50
50
  /**
51
- * Renders a tab group row in the Collections sidebar Tab Groups section.
51
+ * Renders a workspace row in the Collections sidebar Workspaces section.
52
52
  */
53
- export declare function SidebarTabGroupItem({ name, summary, icon, colorDot, selected, sortable, onContextMenu, onClick, actions, as }: Props): JSX.Element;
53
+ export declare function SidebarWorkspaceItem({ name, summary, icon, markerDot, selected, sortable, onContextMenu, onClick, actions, as }: Props): JSX.Element;
54
54
  export {};
55
- //# sourceMappingURL=SidebarTabGroupItem.d.ts.map
55
+ //# sourceMappingURL=SidebarWorkspaceItem.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SidebarWorkspaceItem.d.ts","sourceRoot":"","sources":["../../../src/components/SidebarItem/SidebarWorkspaceItem.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;AAExD,OAAO,EAAe,KAAK,yBAAyB,EAAE,MAAM,kBAAkB,CAAC;AAI/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,SAAS,CAAC,EAAE;QACV,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;QAClC,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,oBAAoB,CAAC,EACnC,IAAI,EACJ,OAAO,EACP,IAAI,EACJ,SAAS,EACT,QAAgB,EAChB,QAAQ,EACR,aAAa,EACb,OAAO,EACP,OAAO,EACP,EAAS,EACV,EAAE,KAAK,GAAG,GAAG,CAAC,OAAO,CAkCrB"}
@@ -1,16 +1,16 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "@harborclient/sdk/jsx-runtime";
2
2
  import { FaIcon } from '../FaIcon/index.js';
3
- import { SidebarColorDot } from './SidebarColorDot.js';
4
3
  import { SidebarItem } from './SidebarItem.js';
4
+ import { SidebarMarkerDot } from './SidebarMarkerDot.js';
5
5
  import { SIDEBAR_ITEM_BUTTON_CLASS } from './sidebarItemClasses.js';
6
6
  /**
7
- * Renders a tab group row in the Collections sidebar Tab Groups section.
7
+ * Renders a workspace row in the Collections sidebar Workspaces section.
8
8
  */
9
- export function SidebarTabGroupItem({ name, summary, icon, colorDot, selected = false, sortable, onContextMenu, onClick, actions, as = 'li' }) {
9
+ export function SidebarWorkspaceItem({ name, summary, icon, markerDot, selected = false, sortable, onContextMenu, onClick, actions, as = 'li' }) {
10
10
  const useListboxOption = as === 'li';
11
11
  return (_jsx(SidebarItem, { selected: selected, sortable: sortable, onContextMenu: onContextMenu, actions: actions, as: as, listboxOption: useListboxOption
12
12
  ? {
13
13
  onClick
14
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 })] }) }));
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 }), markerDot != null ? (_jsx(SidebarMarkerDot, { marker: markerDot.marker, visible: markerDot.visible, label: markerDot.label })) : null] }), _jsx("span", { className: "shrink-0 text-muted", children: summary })] }) }));
16
16
  }
@@ -6,9 +6,9 @@ export { SidebarTreeGroup } from './SidebarTreeGroup.js';
6
6
  export { handleSidebarOptionKeyDown } from './sidebarListOption.js';
7
7
  export { SortableSidebarItem } from './SortableSidebarItem.js';
8
8
  export { stopSortableDragPointerDown } from './stopSortableDragPointerDown.js';
9
- export { SidebarColorDot } from './SidebarColorDot.js';
9
+ export { SidebarMarkerDot } from './SidebarMarkerDot.js';
10
10
  export { SidebarBadge, type SidebarBadgeVariant } from './SidebarBadge.js';
11
- export { sourceRow, METHOD_CLASSES, statusDotVariant, statusDotClass, SIDEBAR_ITEM_BUTTON_CLASS, SIDEBAR_CHEVRON_BUTTON_CLASS, SIDEBAR_CHEVRON_ICON_CLASS, SIDEBAR_CHEVRON_SLOT_CLASS, SIDEBAR_CHEVRON_LABEL_OFFSET_CLASS } from './sidebarItemClasses.js';
11
+ export { sourceRow, METHOD_CLASSES, methodBadgeClass, documentIconClass, statusDotVariant, statusDotClass, SIDEBAR_ITEM_BUTTON_CLASS, SIDEBAR_CHEVRON_BUTTON_CLASS, SIDEBAR_CHEVRON_ICON_CLASS, SIDEBAR_CHEVRON_SLOT_CLASS, SIDEBAR_CHEVRON_LABEL_OFFSET_CLASS } from './sidebarItemClasses.js';
12
12
  export { SidebarMethodBadge } from './SidebarMethodBadge.js';
13
13
  export { SidebarStatusDot } from './SidebarStatusDot.js';
14
14
  export { SidebarStatusMarker } from './SidebarStatusMarker.js';
@@ -18,6 +18,6 @@ export { SidebarFolderItem } from './SidebarFolderItem.js';
18
18
  export { SidebarRunItem } from './SidebarRunItem.js';
19
19
  export { SidebarHistoryItem } from './SidebarHistoryItem.js';
20
20
  export { SidebarEnvironmentItem } from './SidebarEnvironmentItem.js';
21
- export { SidebarTabGroupItem } from './SidebarTabGroupItem.js';
21
+ export { SidebarWorkspaceItem } from './SidebarWorkspaceItem.js';
22
22
  export { SidebarCommitItem, type SidebarCommitPushStatus } from './SidebarCommitItem.js';
23
23
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/SidebarItem/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EACX,KAAK,wBAAwB,EAC7B,KAAK,yBAAyB,EAC9B,KAAK,mBAAmB,EACzB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,0BAA0B,EAAE,MAAM,wBAAwB,CAAC;AACpE,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,2BAA2B,EAAE,MAAM,kCAAkC,CAAC;AAC/E,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,KAAK,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAC3E,OAAO,EACL,SAAS,EACT,cAAc,EACd,gBAAgB,EAChB,cAAc,EACd,yBAAyB,EACzB,4BAA4B,EAC5B,0BAA0B,EAC1B,0BAA0B,EAC1B,kCAAkC,EACnC,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,iBAAiB,EAAE,KAAK,uBAAuB,EAAE,MAAM,wBAAwB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/SidebarItem/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EACX,KAAK,wBAAwB,EAC7B,KAAK,yBAAyB,EAC9B,KAAK,mBAAmB,EACzB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,0BAA0B,EAAE,MAAM,wBAAwB,CAAC;AACpE,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,2BAA2B,EAAE,MAAM,kCAAkC,CAAC;AAC/E,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,KAAK,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAC3E,OAAO,EACL,SAAS,EACT,cAAc,EACd,gBAAgB,EAChB,iBAAiB,EACjB,gBAAgB,EAChB,cAAc,EACd,yBAAyB,EACzB,4BAA4B,EAC5B,0BAA0B,EAC1B,0BAA0B,EAC1B,kCAAkC,EACnC,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAE,iBAAiB,EAAE,KAAK,uBAAuB,EAAE,MAAM,wBAAwB,CAAC"}
@@ -6,9 +6,9 @@ export { SidebarTreeGroup } from './SidebarTreeGroup.js';
6
6
  export { handleSidebarOptionKeyDown } from './sidebarListOption.js';
7
7
  export { SortableSidebarItem } from './SortableSidebarItem.js';
8
8
  export { stopSortableDragPointerDown } from './stopSortableDragPointerDown.js';
9
- export { SidebarColorDot } from './SidebarColorDot.js';
9
+ export { SidebarMarkerDot } from './SidebarMarkerDot.js';
10
10
  export { SidebarBadge } from './SidebarBadge.js';
11
- export { sourceRow, METHOD_CLASSES, statusDotVariant, statusDotClass, SIDEBAR_ITEM_BUTTON_CLASS, SIDEBAR_CHEVRON_BUTTON_CLASS, SIDEBAR_CHEVRON_ICON_CLASS, SIDEBAR_CHEVRON_SLOT_CLASS, SIDEBAR_CHEVRON_LABEL_OFFSET_CLASS } from './sidebarItemClasses.js';
11
+ export { sourceRow, METHOD_CLASSES, methodBadgeClass, documentIconClass, statusDotVariant, statusDotClass, SIDEBAR_ITEM_BUTTON_CLASS, SIDEBAR_CHEVRON_BUTTON_CLASS, SIDEBAR_CHEVRON_ICON_CLASS, SIDEBAR_CHEVRON_SLOT_CLASS, SIDEBAR_CHEVRON_LABEL_OFFSET_CLASS } from './sidebarItemClasses.js';
12
12
  export { SidebarMethodBadge } from './SidebarMethodBadge.js';
13
13
  export { SidebarStatusDot } from './SidebarStatusDot.js';
14
14
  export { SidebarStatusMarker } from './SidebarStatusMarker.js';
@@ -18,5 +18,5 @@ export { SidebarFolderItem } from './SidebarFolderItem.js';
18
18
  export { SidebarRunItem } from './SidebarRunItem.js';
19
19
  export { SidebarHistoryItem } from './SidebarHistoryItem.js';
20
20
  export { SidebarEnvironmentItem } from './SidebarEnvironmentItem.js';
21
- export { SidebarTabGroupItem } from './SidebarTabGroupItem.js';
21
+ export { SidebarWorkspaceItem } from './SidebarWorkspaceItem.js';
22
22
  export { SidebarCommitItem } from './SidebarCommitItem.js';
@@ -4,6 +4,8 @@ import type { StatusDotVariant } from '../StatusDot/index.js';
4
4
  */
5
5
  /**
6
6
  * Tailwind classes for a sidebar source row (collection, folder, request, etc.).
7
+ * Uses left padding only so trailing hamburger menus align with section header
8
+ * Add/Erase actions (which sit at the sidebar body's `pr-2` inset).
7
9
  *
8
10
  * @param selected - Whether this row is the active selection.
9
11
  * @param compact - When true, uses tighter vertical padding for top-level list rows.
@@ -14,6 +16,21 @@ export declare function sourceRow(selected: boolean, compact?: boolean): string;
14
16
  * HTTP method color classes keyed by lowercase method name.
15
17
  */
16
18
  export declare const METHOD_CLASSES: Record<string, string>;
19
+ /**
20
+ * Returns Tailwind classes for an HTTP method badge in the sidebar.
21
+ *
22
+ * @param method - HTTP method string.
23
+ * @param methodColors - When false, uses neutral theme text instead of per-method colors.
24
+ * @returns Combined Tailwind class string for the method badge.
25
+ */
26
+ export declare function methodBadgeClass(method: string, methodColors?: boolean): string;
27
+ /**
28
+ * Returns Tailwind classes for a collection markdown document icon in the sidebar.
29
+ *
30
+ * @param methodColors - When false, uses neutral theme text instead of the doc-markdown accent.
31
+ * @returns Tailwind text color class for the document icon.
32
+ */
33
+ export declare function documentIconClass(methodColors?: boolean): string;
17
34
  /**
18
35
  * Status dot variant for an HTTP response code.
19
36
  *
@@ -1 +1 @@
1
- {"version":3,"file":"sidebarItemClasses.d.ts","sourceRoot":"","sources":["../../../src/components/SidebarItem/sidebarItemClasses.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAG9D;;GAEG;AAEH;;;;;;GAMG;AACH,wBAAgB,SAAS,CAAC,QAAQ,EAAE,OAAO,EAAE,OAAO,UAAQ,GAAG,MAAM,CAKpE;AAED;;GAEG;AACH,eAAO,MAAM,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAQjD,CAAC;AAEF;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,GAAG,gBAAgB,CAMjE;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAErD;AAED;;GAEG;AACH,eAAO,MAAM,yBAAyB,+HACwF,CAAC;AAE/H;;GAEG;AACH,eAAO,MAAM,yBAAyB,oVAC6S,CAAC;AAEpV;;;GAGG;AACH,eAAO,MAAM,4BAA4B,0JACgH,CAAC;AAE1J;;;GAGG;AACH,eAAO,MAAM,0BAA0B,cAAc,CAAC;AAEtD;;;GAGG;AACH,eAAO,MAAM,0BAA0B,kEAC0B,CAAC;AAElE;;;GAGG;AACH,eAAO,MAAM,kCAAkC,WAAW,CAAC"}
1
+ {"version":3,"file":"sidebarItemClasses.d.ts","sourceRoot":"","sources":["../../../src/components/SidebarItem/sidebarItemClasses.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAG9D;;GAEG;AAEH;;;;;;;;GAQG;AACH,wBAAgB,SAAS,CAAC,QAAQ,EAAE,OAAO,EAAE,OAAO,UAAQ,GAAG,MAAM,CAKpE;AAED;;GAEG;AACH,eAAO,MAAM,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAQjD,CAAC;AAEF;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,EAAE,YAAY,UAAO,GAAG,MAAM,CAK5E;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,YAAY,UAAO,GAAG,MAAM,CAE7D;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,GAAG,gBAAgB,CAMjE;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAErD;AAED;;GAEG;AACH,eAAO,MAAM,yBAAyB,+HACwF,CAAC;AAE/H;;GAEG;AACH,eAAO,MAAM,yBAAyB,oVAC6S,CAAC;AAEpV;;;GAGG;AACH,eAAO,MAAM,4BAA4B,0JACgH,CAAC;AAE1J;;;GAGG;AACH,eAAO,MAAM,0BAA0B,cAAc,CAAC;AAEtD;;;GAGG;AACH,eAAO,MAAM,0BAA0B,kEAC0B,CAAC;AAElE;;;GAGG;AACH,eAAO,MAAM,kCAAkC,WAAW,CAAC"}
@@ -4,6 +4,8 @@ import { statusDotVariantClass } from '../StatusDot/index.js';
4
4
  */
5
5
  /**
6
6
  * Tailwind classes for a sidebar source row (collection, folder, request, etc.).
7
+ * Uses left padding only so trailing hamburger menus align with section header
8
+ * Add/Erase actions (which sit at the sidebar body's `pr-2` inset).
7
9
  *
8
10
  * @param selected - Whether this row is the active selection.
9
11
  * @param compact - When true, uses tighter vertical padding for top-level list rows.
@@ -12,8 +14,8 @@ import { statusDotVariantClass } from '../StatusDot/index.js';
12
14
  export function sourceRow(selected, compact = false) {
13
15
  const py = compact ? 'py-0' : 'py-0.5';
14
16
  return selected
15
- ? `group flex items-center gap-1 rounded-md bg-selection px-1.5 ${py} app-no-drag`
16
- : `group flex items-center gap-1 rounded-md px-1.5 ${py} hover:bg-selection/60 app-no-drag`;
17
+ ? `group flex items-center gap-1 rounded-md bg-selection pl-1.5 pr-0 ${py} app-no-drag`
18
+ : `group flex items-center gap-1 rounded-md pl-1.5 pr-0 ${py} hover:bg-selection/60 app-no-drag`;
17
19
  }
18
20
  /**
19
21
  * HTTP method color classes keyed by lowercase method name.
@@ -27,6 +29,28 @@ export const METHOD_CLASSES = {
27
29
  head: 'hc-method-badge text-method-head',
28
30
  options: 'hc-method-badge text-method-options'
29
31
  };
32
+ /**
33
+ * Returns Tailwind classes for an HTTP method badge in the sidebar.
34
+ *
35
+ * @param method - HTTP method string.
36
+ * @param methodColors - When false, uses neutral theme text instead of per-method colors.
37
+ * @returns Combined Tailwind class string for the method badge.
38
+ */
39
+ export function methodBadgeClass(method, methodColors = true) {
40
+ if (!methodColors) {
41
+ return 'hc-method-badge text-text';
42
+ }
43
+ return METHOD_CLASSES[method.toLowerCase()] ?? 'hc-method-badge text-text';
44
+ }
45
+ /**
46
+ * Returns Tailwind classes for a collection markdown document icon in the sidebar.
47
+ *
48
+ * @param methodColors - When false, uses neutral theme text instead of the doc-markdown accent.
49
+ * @returns Tailwind text color class for the document icon.
50
+ */
51
+ export function documentIconClass(methodColors = true) {
52
+ return methodColors ? 'text-doc-markdown' : 'text-text';
53
+ }
30
54
  /**
31
55
  * Status dot variant for an HTTP response code.
32
56
  *
@@ -1 +1 @@
1
- {"version":3,"file":"SectionItem.d.ts","sourceRoot":"","sources":["../../../src/components/SidebarSection/SectionItem.tsx"],"names":[],"mappings":"AAQA,OAAO,EAAE,KAAK,GAAG,EAA4B,KAAK,SAAS,EAAkB,MAAM,OAAO,CAAC;AAO3F,UAAU,mBAAmB;IAC3B;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,QAAQ,EAAE,SAAS,CAAC;IAEpB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,IAAI,CAAC;IAEnB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,aAAa,CAAC,EAAE,SAAS,CAAC;IAE1B;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,MAAM,WAAW,KAAM,SAAQ,mBAAmB;IAChD;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,cAAc,EAAE,OAAO,CAAC;CACzB;AA+ED,eAAO,MAAM,gBAAgB,EAIb,CAAC,KAAK,EAAE,KAAK,KAAK,GAAG,CAAC,OAAO,CAAC"}
1
+ {"version":3,"file":"SectionItem.d.ts","sourceRoot":"","sources":["../../../src/components/SidebarSection/SectionItem.tsx"],"names":[],"mappings":"AAQA,OAAO,EAAE,KAAK,GAAG,EAA4B,KAAK,SAAS,EAAkB,MAAM,OAAO,CAAC;AAO3F,UAAU,mBAAmB;IAC3B;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,QAAQ,EAAE,SAAS,CAAC;IAEpB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,IAAI,CAAC;IAEnB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,aAAa,CAAC,EAAE,SAAS,CAAC;IAE1B;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,MAAM,WAAW,KAAM,SAAQ,mBAAmB;IAChD;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,cAAc,EAAE,OAAO,CAAC;CACzB;AAiFD,eAAO,MAAM,gBAAgB,EAIb,CAAC,KAAK,EAAE,KAAK,KAAK,GAAG,CAAC,OAAO,CAAC"}
@@ -7,13 +7,15 @@ import { SIDEBAR_CHEVRON_ICON_CLASS, SIDEBAR_CHEVRON_SLOT_CLASS } from '../Sideb
7
7
  /**
8
8
  * Renders the sidebar section header row and animated body panel.
9
9
  * Header chevron inset and title gap follow shared `SIDEBAR_CHEVRON_*` spacing.
10
+ * Right-side controls use `hc-sidebar-section-header-actions` so host CSS can
11
+ * apply a shared fixed square size across filter, clear, and add buttons.
10
12
  */
11
13
  const SectionItem = memo(function SectionItem({ forwardedRef, itemRef, state, toggle, title, children, onAdd, addLabel, headerActions, flushBody = false }) {
12
14
  const { buttonProps, panelProps } = useAccordionItem({ state, toggle });
13
15
  const [transitionStyle, panelRef] = useHeightTransition(state);
14
16
  const itemElementRef = useMergeRef(forwardedRef, itemRef);
15
17
  const { status, isMounted, isEnter } = state;
16
- return (_jsxs("div", { ref: itemElementRef, className: "-mr-2 mb-1", children: [_jsxs("div", { className: `hc-sidebar-section-header flex min-h-8 items-center justify-between gap-2 bg-sidebar-section py-0.5 pr-2 ${flushBody ? 'mb-0' : 'mb-1'}`, children: [_jsxs("button", { ...buttonProps, type: "button", className: "app-no-drag inline-flex min-w-0 flex-1 cursor-pointer items-center gap-2.5 border-none bg-transparent p-0 text-left", children: [_jsx("span", { className: SIDEBAR_CHEVRON_SLOT_CLASS, children: _jsx(FaIcon, { icon: isEnter ? faChevronDown : faChevronRight, className: `${SIDEBAR_CHEVRON_ICON_CLASS} text-sidebar-section-text` }) }), _jsx("h2", { className: "m-0 text-[15px] leading-none font-medium tracking-wide text-sidebar-section-text uppercase", children: title })] }), (headerActions || onAdd) && (_jsxs("div", { className: "flex shrink-0 items-center gap-1", children: [headerActions, onAdd ? (_jsx("button", { type: "button", className: "hc-sidebar-add-button app-no-drag inline-flex shrink-0 cursor-pointer items-center justify-center border-none bg-transparent text-muted hover:bg-selection hover:text-text focus-visible:bg-selection focus-visible:text-text", title: addLabel ?? 'Add', "aria-label": addLabel ?? 'Add', onClick: onAdd, children: _jsx(FaIcon, { icon: faPlus, className: "h-4 w-4" }) })) : null] }))] }), isMounted ? (_jsx("div", { style: {
18
+ return (_jsxs("div", { ref: itemElementRef, className: "-mr-2 mb-1", children: [_jsxs("div", { className: `hc-sidebar-section-header flex min-h-8 items-center justify-between gap-2 bg-sidebar-section py-0.5 pr-2 ${flushBody ? 'mb-0' : 'mb-1'}`, children: [_jsxs("button", { ...buttonProps, type: "button", className: "app-no-drag inline-flex min-w-0 flex-1 cursor-pointer items-center gap-2.5 border-none bg-transparent p-0 text-left", children: [_jsx("span", { className: SIDEBAR_CHEVRON_SLOT_CLASS, children: _jsx(FaIcon, { icon: isEnter ? faChevronDown : faChevronRight, className: `${SIDEBAR_CHEVRON_ICON_CLASS} text-sidebar-section-text` }) }), _jsx("h2", { className: "m-0 text-[15px] leading-none font-medium tracking-wide text-sidebar-section-text uppercase", children: title })] }), (headerActions || onAdd) && (_jsxs("div", { className: "hc-sidebar-section-header-actions flex shrink-0 items-center gap-1", children: [headerActions, onAdd ? (_jsx("button", { type: "button", className: "hc-sidebar-add-button app-no-drag inline-flex shrink-0 cursor-pointer items-center justify-center border-none bg-transparent text-muted hover:bg-selection hover:text-text focus-visible:bg-selection focus-visible:text-text", title: addLabel ?? 'Add', "aria-label": addLabel ?? 'Add', onClick: onAdd, children: _jsx(FaIcon, { icon: faPlus, className: "h-3.5 w-3.5" }) })) : null] }))] }), isMounted ? (_jsx("div", { style: {
17
19
  display: status === 'exited' ? 'none' : undefined,
18
20
  ...transitionStyle
19
21
  }, className: "transition-[height] duration-200 ease-out motion-reduce:transition-none", children: _jsx("div", { ...panelProps, ref: panelRef, children: children }) })) : null] }));
@@ -0,0 +1,29 @@
1
+ import type { IconDefinition } from '@fortawesome/fontawesome-svg-core';
2
+ import type { JSX } from 'react';
3
+ interface Props {
4
+ /**
5
+ * When true, shows a SegmentedTabs-matching accent dot on the icon corner.
6
+ */
7
+ active?: boolean;
8
+ /**
9
+ * Font Awesome icon to render. Defaults to the sort bars icon.
10
+ */
11
+ icon?: IconDefinition;
12
+ /**
13
+ * Additional classes merged onto the icon wrapper.
14
+ */
15
+ className?: string;
16
+ }
17
+ /**
18
+ * Sort bars icon with an optional accent corner indicator when a non-default
19
+ * sort is applied. Shared by {@link SortButton} so the active affordance stays
20
+ * consistent with {@link FilterButton}.
21
+ *
22
+ * @param active - When true, shows the accent status dot.
23
+ * @param icon - Icon to render; defaults to `faArrowDownShortWide`.
24
+ * @param className - Extra classes for the wrapper.
25
+ * @returns Relative icon wrapper with optional active indicator.
26
+ */
27
+ export declare function SortButtonIcon({ active, icon, className }: Props): JSX.Element;
28
+ export {};
29
+ //# sourceMappingURL=SortButtonIcon.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SortButtonIcon.d.ts","sourceRoot":"","sources":["../../../src/components/SortButton/SortButtonIcon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AAExE,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAKjC,UAAU,KAAK;IACb;;OAEG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IAEjB;;OAEG;IACH,IAAI,CAAC,EAAE,cAAc,CAAC;IAEtB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;;GASG;AACH,wBAAgB,cAAc,CAAC,EAC7B,MAAc,EACd,IAA2B,EAC3B,SAAS,EACV,EAAE,KAAK,GAAG,GAAG,CAAC,OAAO,CAcrB"}
@@ -0,0 +1,18 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "@harborclient/sdk/jsx-runtime";
2
+ import { faArrowDownShortWide } from '@fortawesome/free-solid-svg-icons';
3
+ import { FaIcon } from '../FaIcon/index.js';
4
+ import { StatusDot } from '../StatusDot/index.js';
5
+ import { cn } from '../utils.js';
6
+ /**
7
+ * Sort bars icon with an optional accent corner indicator when a non-default
8
+ * sort is applied. Shared by {@link SortButton} so the active affordance stays
9
+ * consistent with {@link FilterButton}.
10
+ *
11
+ * @param active - When true, shows the accent status dot.
12
+ * @param icon - Icon to render; defaults to `faArrowDownShortWide`.
13
+ * @param className - Extra classes for the wrapper.
14
+ * @returns Relative icon wrapper with optional active indicator.
15
+ */
16
+ export function SortButtonIcon({ active = false, icon = faArrowDownShortWide, className }) {
17
+ return (_jsxs("span", { className: cn('hc-sort-button-icon relative inline-flex shrink-0', className), children: [_jsx(FaIcon, { icon: icon, className: "h-3.5 w-3.5", "aria-hidden": true }), active ? (_jsx(StatusDot, { variant: "accent", size: "sm", label: "Custom sort applied", className: "absolute -top-0.5 -right-0.5" })) : null] }));
18
+ }
@@ -0,0 +1,42 @@
1
+ import { type ReactPortal, type RefObject } from 'react';
2
+ import type { SortOption } from './sortOptions.js';
3
+ interface Props {
4
+ /**
5
+ * Sort toolbar button used to anchor the portaled listbox.
6
+ */
7
+ anchorRef: RefObject<HTMLElement | null>;
8
+ /**
9
+ * Selectable sort options to render.
10
+ */
11
+ options: readonly SortOption[];
12
+ /**
13
+ * Currently selected option id.
14
+ */
15
+ value: string;
16
+ /**
17
+ * Accessible name for the listbox.
18
+ */
19
+ ariaLabel?: string;
20
+ /**
21
+ * Applies a sort selection and should close the menu.
22
+ */
23
+ onSelect: (id: string) => void;
24
+ /**
25
+ * Closes the menu without changing the sort.
26
+ */
27
+ onClose: () => void;
28
+ }
29
+ /**
30
+ * Portaled single-select listbox of sort options. Selecting an option applies
31
+ * immediately and closes the menu (filter-menu style).
32
+ *
33
+ * @param anchorRef - Sort toolbar button used for positioning.
34
+ * @param options - Sort options to render.
35
+ * @param value - Currently selected option id.
36
+ * @param ariaLabel - Accessible name for the listbox.
37
+ * @param onSelect - Called when the user picks an option.
38
+ * @param onClose - Called when the menu should dismiss.
39
+ */
40
+ export declare function SortMenu({ anchorRef, options, value, ariaLabel, onSelect, onClose }: Props): ReactPortal | null;
41
+ export {};
42
+ //# sourceMappingURL=SortMenu.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SortMenu.d.ts","sourceRoot":"","sources":["../../../src/components/SortButton/SortMenu.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,WAAW,EAChB,KAAK,SAAS,EAOf,MAAM,OAAO,CAAC;AASf,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAQnD,UAAU,KAAK;IACb;;OAEG;IACH,SAAS,EAAE,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC;IAEzC;;OAEG;IACH,OAAO,EAAE,SAAS,UAAU,EAAE,CAAC;IAE/B;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,QAAQ,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAE/B;;OAEG;IACH,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,QAAQ,CAAC,EACvB,SAAS,EACT,OAAO,EACP,KAAK,EACL,SAAkB,EAClB,QAAQ,EACR,OAAO,EACR,EAAE,KAAK,GAAG,WAAW,GAAG,IAAI,CA0J5B"}
@@ -0,0 +1,137 @@
1
+ import { jsx as _jsx } from "@harborclient/sdk/jsx-runtime";
2
+ import { useCallback, useEffect, useId, useLayoutEffect, useRef, useState } from 'react';
3
+ import { clampMenuPosition, getTriggerAnchoredMenuPosition } from '../menuPosition.js';
4
+ import { portalToBody } from '../portalToBody.js';
5
+ import { resolveTabListKeyAction } from '../utils.js';
6
+ import { SortMenuOption } from './SortMenuOption.js';
7
+ /** Estimated width of the sort option listbox. */
8
+ const LISTBOX_WIDTH_PX = 240;
9
+ /** Estimated height before the listbox is measured. */
10
+ const LISTBOX_HEIGHT_PX = 220;
11
+ /**
12
+ * Portaled single-select listbox of sort options. Selecting an option applies
13
+ * immediately and closes the menu (filter-menu style).
14
+ *
15
+ * @param anchorRef - Sort toolbar button used for positioning.
16
+ * @param options - Sort options to render.
17
+ * @param value - Currently selected option id.
18
+ * @param ariaLabel - Accessible name for the listbox.
19
+ * @param onSelect - Called when the user picks an option.
20
+ * @param onClose - Called when the menu should dismiss.
21
+ */
22
+ export function SortMenu({ anchorRef, options, value, ariaLabel = 'Sort', onSelect, onClose }) {
23
+ const listboxId = useId();
24
+ const listboxRef = useRef(null);
25
+ const optionRefs = useRef([]);
26
+ const [position, setPosition] = useState(null);
27
+ const [focusedIndex, setFocusedIndex] = useState(() => Math.max(0, options.findIndex((option) => option.id === value)));
28
+ /**
29
+ * Repositions the listbox under the trigger button.
30
+ */
31
+ const updatePosition = useCallback(() => {
32
+ const trigger = anchorRef.current;
33
+ if (!trigger) {
34
+ setPosition(null);
35
+ return;
36
+ }
37
+ const triggerRect = trigger.getBoundingClientRect();
38
+ const menuSize = {
39
+ width: LISTBOX_WIDTH_PX,
40
+ height: listboxRef.current?.offsetHeight ?? LISTBOX_HEIGHT_PX
41
+ };
42
+ const requested = getTriggerAnchoredMenuPosition(triggerRect, menuSize, 'down');
43
+ setPosition(clampMenuPosition(requested, menuSize));
44
+ }, [anchorRef]);
45
+ /**
46
+ * Anchors the listbox when it mounts and when its option count changes.
47
+ */
48
+ useLayoutEffect(() => {
49
+ updatePosition();
50
+ }, [updatePosition, options.length]);
51
+ /**
52
+ * Keeps the listbox aligned when the sidebar or viewport moves.
53
+ */
54
+ useEffect(() => {
55
+ window.addEventListener('scroll', updatePosition, true);
56
+ window.addEventListener('resize', updatePosition);
57
+ return () => {
58
+ window.removeEventListener('scroll', updatePosition, true);
59
+ window.removeEventListener('resize', updatePosition);
60
+ };
61
+ }, [updatePosition]);
62
+ /**
63
+ * Focuses the active option when the listbox mounts or the focused index changes.
64
+ */
65
+ useEffect(() => {
66
+ requestAnimationFrame(() => {
67
+ optionRefs.current[focusedIndex]?.focus();
68
+ });
69
+ }, [focusedIndex]);
70
+ /**
71
+ * Closes on outside pointer interaction or Escape.
72
+ */
73
+ useEffect(() => {
74
+ /**
75
+ * Closes when the user activates outside the trigger and listbox.
76
+ */
77
+ const handlePointerDown = (event) => {
78
+ const target = event.target;
79
+ if (!(target instanceof Node)) {
80
+ return;
81
+ }
82
+ if (anchorRef.current?.contains(target) || listboxRef.current?.contains(target)) {
83
+ return;
84
+ }
85
+ onClose();
86
+ };
87
+ /**
88
+ * Closes the listbox when the user presses Escape.
89
+ */
90
+ const handleKeyDown = (event) => {
91
+ if (event.key === 'Escape') {
92
+ event.preventDefault();
93
+ event.stopPropagation();
94
+ onClose();
95
+ }
96
+ };
97
+ document.addEventListener('pointerdown', handlePointerDown);
98
+ document.addEventListener('keydown', handleKeyDown, true);
99
+ return () => {
100
+ document.removeEventListener('pointerdown', handlePointerDown);
101
+ document.removeEventListener('keydown', handleKeyDown, true);
102
+ };
103
+ }, [anchorRef, onClose]);
104
+ /**
105
+ * Focuses a listbox option by index for roving tabindex navigation.
106
+ *
107
+ * @param index - Option index to focus.
108
+ */
109
+ const focusOption = useCallback((index) => {
110
+ setFocusedIndex(index);
111
+ requestAnimationFrame(() => {
112
+ optionRefs.current[index]?.focus();
113
+ });
114
+ }, []);
115
+ /**
116
+ * Handles arrow-key navigation and Tab-to-close inside the open listbox.
117
+ *
118
+ * @param event - Keyboard event from the listbox panel.
119
+ */
120
+ const handleListboxKeyDown = (event) => {
121
+ if (event.key === 'Tab') {
122
+ onClose();
123
+ return;
124
+ }
125
+ const arrowIndex = resolveTabListKeyAction(event.key, focusedIndex, options.length);
126
+ if (arrowIndex !== null) {
127
+ event.preventDefault();
128
+ focusOption(arrowIndex);
129
+ }
130
+ };
131
+ if (position == null) {
132
+ return null;
133
+ }
134
+ return portalToBody(_jsx("div", { ref: listboxRef, id: listboxId, role: "listbox", "aria-label": ariaLabel, className: "hc-sort-menu-listbox app-no-drag fixed z-50 max-h-[280px] overflow-y-auto rounded-md border border-separator bg-surface py-1 shadow-md", style: { top: position.y, left: position.x, width: LISTBOX_WIDTH_PX }, onKeyDown: handleListboxKeyDown, children: options.map((option, index) => (_jsx(SortMenuOption, { label: option.label, selected: option.id === value, focused: index === focusedIndex, optionRef: (element) => {
135
+ optionRefs.current[index] = element;
136
+ }, onSelect: () => onSelect(option.id) }, option.id))) }));
137
+ }
@@ -0,0 +1,35 @@
1
+ import type { JSX, Ref } from 'react';
2
+ interface Props {
3
+ /**
4
+ * Visible option label.
5
+ */
6
+ label: string;
7
+ /**
8
+ * Whether this option is the current sort selection.
9
+ */
10
+ selected: boolean;
11
+ /**
12
+ * Whether this option currently holds keyboard focus (roving tabindex).
13
+ */
14
+ focused: boolean;
15
+ /**
16
+ * Ref callback so the listbox can focus this option.
17
+ */
18
+ optionRef: Ref<HTMLButtonElement>;
19
+ /**
20
+ * Called when the user activates this option.
21
+ */
22
+ onSelect: () => void;
23
+ }
24
+ /**
25
+ * Single checkable row inside a {@link SortMenu} listbox.
26
+ *
27
+ * @param label - Visible option text.
28
+ * @param selected - Whether this option is the active sort mode.
29
+ * @param focused - Whether this option has the roving tabindex.
30
+ * @param optionRef - Ref callback for focus management.
31
+ * @param onSelect - Called when the option is activated.
32
+ */
33
+ export declare function SortMenuOption({ label, selected, focused, optionRef, onSelect }: Props): JSX.Element;
34
+ export {};
35
+ //# sourceMappingURL=SortMenuOption.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SortMenuOption.d.ts","sourceRoot":"","sources":["../../../src/components/SortButton/SortMenuOption.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAGtC,UAAU,KAAK;IACb;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,QAAQ,EAAE,OAAO,CAAC;IAElB;;OAEG;IACH,OAAO,EAAE,OAAO,CAAC;IAEjB;;OAEG;IACH,SAAS,EAAE,GAAG,CAAC,iBAAiB,CAAC,CAAC;IAElC;;OAEG;IACH,QAAQ,EAAE,MAAM,IAAI,CAAC;CACtB;AAED;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAAC,EAC7B,KAAK,EACL,QAAQ,EACR,OAAO,EACP,SAAS,EACT,QAAQ,EACT,EAAE,KAAK,GAAG,GAAG,CAAC,OAAO,CAoBrB"}
@@ -0,0 +1,18 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "@harborclient/sdk/jsx-runtime";
2
+ import { faCheck } from '@fortawesome/free-solid-svg-icons';
3
+ import { FaIcon } from '../FaIcon/index.js';
4
+ /**
5
+ * Single checkable row inside a {@link SortMenu} listbox.
6
+ *
7
+ * @param label - Visible option text.
8
+ * @param selected - Whether this option is the active sort mode.
9
+ * @param focused - Whether this option has the roving tabindex.
10
+ * @param optionRef - Ref callback for focus management.
11
+ * @param onSelect - Called when the option is activated.
12
+ */
13
+ export function SortMenuOption({ label, selected, focused, optionRef, onSelect }) {
14
+ return (_jsxs("button", { ref: optionRef, type: "button", role: "option", "aria-selected": selected, tabIndex: focused ? 0 : -1, className: "app-no-drag flex w-full cursor-pointer items-center gap-2 border-none bg-transparent px-3.5 py-1.5 text-left text-[14px] text-text hover:bg-selection", onClick: (event) => {
15
+ event.stopPropagation();
16
+ onSelect();
17
+ }, children: [_jsx("span", { className: "inline-flex w-4 shrink-0 justify-center", "aria-hidden": true, children: selected ? _jsx(FaIcon, { icon: faCheck, className: "h-3 w-3" }) : null }), _jsx("span", { className: "min-w-0 truncate", children: label })] }));
18
+ }
@@ -0,0 +1,32 @@
1
+ import type { IconDefinition } from '@fortawesome/fontawesome-svg-core';
2
+ import type { ComponentPropsWithoutRef, JSX, RefObject } from 'react';
3
+ interface Props extends Omit<ComponentPropsWithoutRef<'button'>, 'children' | 'aria-label'> {
4
+ /**
5
+ * When true, shows the accent sort-active indicator and full-contrast icon
6
+ * color. When false, the icon uses muted text until hover.
7
+ */
8
+ active?: boolean;
9
+ /**
10
+ * Font Awesome icon to render. Defaults to `faArrowDownShortWide`.
11
+ */
12
+ icon?: IconDefinition;
13
+ /**
14
+ * Accessible name for the icon-only control.
15
+ */
16
+ 'aria-label': string;
17
+ /**
18
+ * Ref forwarded to the underlying native button for popover anchoring.
19
+ */
20
+ innerRef?: RefObject<HTMLButtonElement | null>;
21
+ }
22
+ /**
23
+ * Toolbar sort trigger with an optional accent corner indicator when a
24
+ * non-default sort is in effect. Matches the SegmentedTabs indicator color
25
+ * (`bg-accent`) and mirrors {@link FilterButton}.
26
+ *
27
+ * Defaults to `type="button"`. Pass `title` for a native tooltip; when omitted,
28
+ * the tooltip falls back to `aria-label`.
29
+ */
30
+ export declare function SortButton({ active, icon, className, title, innerRef, type, 'aria-label': ariaLabel, ...props }: Props): JSX.Element;
31
+ export {};
32
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/SortButton/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AACxE,OAAO,KAAK,EAAE,wBAAwB,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAKtE,UAAU,KAAM,SAAQ,IAAI,CAAC,wBAAwB,CAAC,QAAQ,CAAC,EAAE,UAAU,GAAG,YAAY,CAAC;IACzF;;;OAGG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IAEjB;;OAEG;IACH,IAAI,CAAC,EAAE,cAAc,CAAC;IAEtB;;OAEG;IACH,YAAY,EAAE,MAAM,CAAC;IAErB;;OAEG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC,iBAAiB,GAAG,IAAI,CAAC,CAAC;CAChD;AAED;;;;;;;GAOG;AACH,wBAAgB,UAAU,CAAC,EACzB,MAAc,EACd,IAAI,EACJ,SAAS,EACT,KAAK,EACL,QAAQ,EACR,IAAe,EACf,YAAY,EAAE,SAAS,EACvB,GAAG,KAAK,EACT,EAAE,KAAK,GAAG,GAAG,CAAC,OAAO,CAkBrB"}