@harborclient/sdk 1.0.69 → 1.0.71

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.
@@ -75,6 +75,10 @@ interface Props extends Omit<ComponentPropsWithoutRef<'div'>, 'children'> {
75
75
  * Additional classes merged onto the trigger button.
76
76
  */
77
77
  triggerClassName?: string;
78
+ /**
79
+ * Whether the menu opens below or above the trigger. Defaults to opening downward.
80
+ */
81
+ placement?: 'down' | 'up';
78
82
  }
79
83
  /**
80
84
  * Hamburger-triggered dropdown for row-level actions (rename, delete, etc.).
@@ -84,6 +88,6 @@ interface Props extends Omit<ComponentPropsWithoutRef<'div'>, 'children'> {
84
88
  * `submenu` open a nested flyout panel beside them on hover, click, or
85
89
  * `ArrowRight`/`Enter`.
86
90
  */
87
- export declare function RowActionsMenu({ groups, menuId, openMenuId, onOpenChange, triggerVariant, triggerLabel, triggerIcon, triggerAriaLabel, triggerTitle, triggerClassName, className, ...props }: Props): JSX.Element;
91
+ export declare function RowActionsMenu({ groups, menuId, openMenuId, onOpenChange, triggerVariant, triggerLabel, triggerIcon, triggerAriaLabel, triggerTitle, triggerClassName, placement, className, ...props }: Props): JSX.Element;
88
92
  export {};
89
93
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/RowActionsMenu/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AAUxE,OAAO,KAAK,EAAE,wBAAwB,EAAE,GAAG,EAAiB,SAAS,EAAE,MAAM,OAAO,CAAC;AACrF,OAAO,EAAU,KAAK,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAkBhE,UAAU,YAAY;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,SAAS,GAAG,QAAQ,CAAC;IAE/B;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAEl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AGG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAE1B;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;OAEG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAE1B;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC3B;AAUD;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,EAC7B,MAAM,EACN,MAAM,EACN,UAAU,EACV,YAAY,EACZ,cAAc,EACd,YAAY,EACZ,WAAoB,EACpB,gBAAgB,EAChB,YAAY,EACZ,gBAAgB,EAChB,SAAkB,EAClB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,GAAG,GAAG,CAAC,OAAO,CAojBrB"}
@@ -21,7 +21,7 @@ const SUBMENU_CLOSE_DELAY_MS = 200;
21
21
  * `submenu` open a nested flyout panel beside them on hover, click, or
22
22
  * `ArrowRight`/`Enter`.
23
23
  */
24
- export function RowActionsMenu({ groups, menuId, openMenuId, onOpenChange, triggerVariant, triggerLabel, triggerIcon = faBars, triggerAriaLabel, triggerTitle, triggerClassName, className, ...props }) {
24
+ export function RowActionsMenu({ groups, menuId, openMenuId, onOpenChange, triggerVariant, triggerLabel, triggerIcon = faBars, triggerAriaLabel, triggerTitle, triggerClassName, placement = 'down', className, ...props }) {
25
25
  const isOpen = openMenuId === menuId;
26
26
  const menuElementId = `${menuId}-menu`;
27
27
  const submenuElementId = `${menuId}-submenu`;
@@ -186,13 +186,13 @@ export function RowActionsMenu({ groups, menuId, openMenuId, onOpenChange, trigg
186
186
  width: panelRect?.width ?? MENU_MIN_WIDTH_PX,
187
187
  height: panelRect?.height ?? 0
188
188
  };
189
- const requested = getTriggerAnchoredMenuPosition(triggerRect, menuSize);
189
+ const requested = getTriggerAnchoredMenuPosition(triggerRect, menuSize, placement);
190
190
  if (menuSize.height > 0) {
191
191
  setMenuPosition(clampMenuPosition(requested, menuSize));
192
192
  return;
193
193
  }
194
194
  setMenuPosition(requested);
195
- }, []);
195
+ }, [placement]);
196
196
  /**
197
197
  * Moves focus into the menu after it opens and item refs are mounted.
198
198
  */
@@ -411,7 +411,7 @@ export function RowActionsMenu({ groups, menuId, openMenuId, onOpenChange, trigg
411
411
  else {
412
412
  openMenu(false);
413
413
  }
414
- }, onKeyDown: handleTriggerKeyDown, children: [_jsx(FaIcon, { icon: triggerIcon, className: "h-3.5 w-3.5", "aria-hidden": true }), triggerLabel] })) : (_jsx(Button, { innerRef: triggerRef, type: "button", variant: "icon", className: cn('hc-row-actions-menu-trigger', triggerClassName), title: resolvedTriggerTitle, "aria-label": resolvedTriggerAriaLabel, "aria-haspopup": "menu", "aria-expanded": isOpen, "aria-controls": isOpen ? menuElementId : undefined, onClick: (e) => {
414
+ }, onKeyDown: handleTriggerKeyDown, children: [_jsx(FaIcon, { icon: triggerIcon, className: "h-[1em] w-[1em] shrink-0", "aria-hidden": true }), _jsx("span", { className: "hc-row-actions-menu-trigger-label inline-flex min-w-0 flex-1 items-center truncate overflow-hidden leading-none", children: triggerLabel })] })) : (_jsx(Button, { innerRef: triggerRef, type: "button", variant: "icon", className: cn('hc-row-actions-menu-trigger', triggerClassName), title: resolvedTriggerTitle, "aria-label": resolvedTriggerAriaLabel, "aria-haspopup": "menu", "aria-expanded": isOpen, "aria-controls": isOpen ? menuElementId : undefined, onClick: (e) => {
415
415
  e.stopPropagation();
416
416
  if (isOpen) {
417
417
  closeMenu();
@@ -30,12 +30,15 @@ export declare const MENU_MIN_WIDTH_PX = 200;
30
30
  */
31
31
  export declare function clampMenuPosition(position: MenuPosition, size: MenuSize): MenuPosition;
32
32
  /**
33
- * Computes menu coordinates anchored below and right-aligned to a trigger button.
33
+ * Computes menu coordinates anchored to a trigger button, right-aligned with the
34
+ * trigger's trailing edge. Opens below by default or above when `placement` is
35
+ * `up`.
34
36
  *
35
37
  * @param triggerRect - Trigger bounding rect in viewport coordinates.
36
38
  * @param menuSize - Measured or estimated menu dimensions.
39
+ * @param placement - Whether the panel opens below or above the trigger.
37
40
  */
38
- export declare function getTriggerAnchoredMenuPosition(triggerRect: DOMRect, menuSize: MenuSize): MenuPosition;
41
+ export declare function getTriggerAnchoredMenuPosition(triggerRect: DOMRect, menuSize: MenuSize, placement?: 'down' | 'up'): MenuPosition;
39
42
  /**
40
43
  * Computes flyout coordinates anchored beside a parent menu row, preferring
41
44
  * the right side and flipping to the left when the right side would overflow
@@ -1 +1 @@
1
- {"version":3,"file":"menuPosition.d.ts","sourceRoot":"","sources":["../../src/components/menuPosition.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,oCAAoC;IACpC,CAAC,EAAE,MAAM,CAAC;IAEV,mCAAmC;IACnC,CAAC,EAAE,MAAM,CAAC;CACX;AAED;;GAEG;AACH,MAAM,WAAW,QAAQ;IACvB,6BAA6B;IAC7B,KAAK,EAAE,MAAM,CAAC;IAEd,8BAA8B;IAC9B,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,8DAA8D;AAC9D,eAAO,MAAM,uBAAuB,IAAI,CAAC;AAEzC,2DAA2D;AAC3D,eAAO,MAAM,sBAAsB,IAAI,CAAC;AAExC,oEAAoE;AACpE,eAAO,MAAM,iBAAiB,MAAM,CAAC;AAErC;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,YAAY,EAAE,IAAI,EAAE,QAAQ,GAAG,YAAY,CAQtF;AAED;;;;;GAKG;AACH,wBAAgB,8BAA8B,CAC5C,WAAW,EAAE,OAAO,EACpB,QAAQ,EAAE,QAAQ,GACjB,YAAY,CAKd;AAED;;;;;;;GAOG;AACH,wBAAgB,0BAA0B,CAAC,UAAU,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,GAAG,YAAY,CAUhG"}
1
+ {"version":3,"file":"menuPosition.d.ts","sourceRoot":"","sources":["../../src/components/menuPosition.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,oCAAoC;IACpC,CAAC,EAAE,MAAM,CAAC;IAEV,mCAAmC;IACnC,CAAC,EAAE,MAAM,CAAC;CACX;AAED;;GAEG;AACH,MAAM,WAAW,QAAQ;IACvB,6BAA6B;IAC7B,KAAK,EAAE,MAAM,CAAC;IAEd,8BAA8B;IAC9B,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,8DAA8D;AAC9D,eAAO,MAAM,uBAAuB,IAAI,CAAC;AAEzC,2DAA2D;AAC3D,eAAO,MAAM,sBAAsB,IAAI,CAAC;AAExC,oEAAoE;AACpE,eAAO,MAAM,iBAAiB,MAAM,CAAC;AAErC;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,YAAY,EAAE,IAAI,EAAE,QAAQ,GAAG,YAAY,CAQtF;AAED;;;;;;;;GAQG;AACH,wBAAgB,8BAA8B,CAC5C,WAAW,EAAE,OAAO,EACpB,QAAQ,EAAE,QAAQ,EAClB,SAAS,GAAE,MAAM,GAAG,IAAa,GAChC,YAAY,CAOd;AAED;;;;;;;GAOG;AACH,wBAAgB,0BAA0B,CAAC,UAAU,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,GAAG,YAAY,CAUhG"}
@@ -20,16 +20,20 @@ export function clampMenuPosition(position, size) {
20
20
  };
21
21
  }
22
22
  /**
23
- * Computes menu coordinates anchored below and right-aligned to a trigger button.
23
+ * Computes menu coordinates anchored to a trigger button, right-aligned with the
24
+ * trigger's trailing edge. Opens below by default or above when `placement` is
25
+ * `up`.
24
26
  *
25
27
  * @param triggerRect - Trigger bounding rect in viewport coordinates.
26
28
  * @param menuSize - Measured or estimated menu dimensions.
29
+ * @param placement - Whether the panel opens below or above the trigger.
27
30
  */
28
- export function getTriggerAnchoredMenuPosition(triggerRect, menuSize) {
29
- return {
30
- x: triggerRect.right - menuSize.width,
31
- y: triggerRect.bottom + MENU_TRIGGER_OFFSET_PX
32
- };
31
+ export function getTriggerAnchoredMenuPosition(triggerRect, menuSize, placement = 'down') {
32
+ const x = triggerRect.right - menuSize.width;
33
+ const y = placement === 'up'
34
+ ? triggerRect.top - MENU_TRIGGER_OFFSET_PX - menuSize.height
35
+ : triggerRect.bottom + MENU_TRIGGER_OFFSET_PX;
36
+ return { x, y };
33
37
  }
34
38
  /**
35
39
  * Computes flyout coordinates anchored beside a parent menu row, preferring
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@harborclient/sdk",
3
- "version": "1.0.69",
3
+ "version": "1.0.71",
4
4
  "description": "TypeScript SDK for HarborClient development.",
5
5
  "keywords": [
6
6
  "harborclient",