@harborclient/sdk 1.0.75 → 1.1.0

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.
@@ -0,0 +1,28 @@
1
+ /**
2
+ * Default preset swatches for sidebar item color coding (two rows of five).
3
+ */
4
+ export declare const DEFAULT_COLOR_PICKER_PRESETS: readonly string[];
5
+ /** Number of user-defined custom swatch slots in the picker grid. */
6
+ export declare const CUSTOM_SWATCH_SLOT_COUNT = 5;
7
+ /**
8
+ * Normalizes a CSS color string to lowercase hex when possible.
9
+ *
10
+ * @param value - Raw color string from storage or user input.
11
+ * @returns Normalized color for comparison, or the trimmed input.
12
+ */
13
+ export declare function normalizeCssColor(value: string): string;
14
+ /**
15
+ * Returns whether two CSS color strings represent the same color.
16
+ *
17
+ * @param a - First color string.
18
+ * @param b - Second color string.
19
+ */
20
+ export declare function colorsMatch(a: string | null | undefined, b: string | null | undefined): boolean;
21
+ /**
22
+ * Coerces a stored value to a valid hex color for native color inputs (`#rrggbb`).
23
+ *
24
+ * @param value - CSS color string.
25
+ * @returns Hex suitable for `<input type="color">`, or `#808080` when unrecognized.
26
+ */
27
+ export declare function toHexColorInputValue(value: string | null | undefined): string;
28
+ //# sourceMappingURL=colorUtils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"colorUtils.d.ts","sourceRoot":"","sources":["../../../src/components/ColorPicker/colorUtils.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,4BAA4B,EAAE,SAAS,MAAM,EAWhD,CAAC;AAEX,qEAAqE;AACrE,eAAO,MAAM,wBAAwB,IAAI,CAAC;AAE1C;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAEvD;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,OAAO,CAK/F;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,CAgB7E"}
@@ -0,0 +1,59 @@
1
+ /**
2
+ * Default preset swatches for sidebar item color coding (two rows of five).
3
+ */
4
+ export const DEFAULT_COLOR_PICKER_PRESETS = [
5
+ '#1e3a5f',
6
+ '#0d9488',
7
+ '#ca8a04',
8
+ '#b91c1c',
9
+ '#be185d',
10
+ '#3b82f6',
11
+ '#16a34a',
12
+ '#ea580c',
13
+ '#dc2626',
14
+ '#9333ea'
15
+ ];
16
+ /** Number of user-defined custom swatch slots in the picker grid. */
17
+ export const CUSTOM_SWATCH_SLOT_COUNT = 5;
18
+ /**
19
+ * Normalizes a CSS color string to lowercase hex when possible.
20
+ *
21
+ * @param value - Raw color string from storage or user input.
22
+ * @returns Normalized color for comparison, or the trimmed input.
23
+ */
24
+ export function normalizeCssColor(value) {
25
+ return value.trim().toLowerCase();
26
+ }
27
+ /**
28
+ * Returns whether two CSS color strings represent the same color.
29
+ *
30
+ * @param a - First color string.
31
+ * @param b - Second color string.
32
+ */
33
+ export function colorsMatch(a, b) {
34
+ if (a == null || b == null) {
35
+ return false;
36
+ }
37
+ return normalizeCssColor(a) === normalizeCssColor(b);
38
+ }
39
+ /**
40
+ * Coerces a stored value to a valid hex color for native color inputs (`#rrggbb`).
41
+ *
42
+ * @param value - CSS color string.
43
+ * @returns Hex suitable for `<input type="color">`, or `#808080` when unrecognized.
44
+ */
45
+ export function toHexColorInputValue(value) {
46
+ if (value == null || value.trim() === '') {
47
+ return '#808080';
48
+ }
49
+ const trimmed = value.trim();
50
+ const hexMatch = /^#([0-9a-f]{3}|[0-9a-f]{6})$/i.exec(trimmed);
51
+ if (hexMatch) {
52
+ const hex = hexMatch[1];
53
+ if (hex.length === 3) {
54
+ return `#${hex[0]}${hex[0]}${hex[1]}${hex[1]}${hex[2]}${hex[2]}`.toLowerCase();
55
+ }
56
+ return `#${hex.toLowerCase()}`;
57
+ }
58
+ return '#808080';
59
+ }
@@ -0,0 +1,23 @@
1
+ /** Default localStorage key for persisted custom color swatches. */
2
+ export declare const DEFAULT_CUSTOM_SWATCHES_STORAGE_KEY = "hc.sidebarCustomSwatches";
3
+ /**
4
+ * Loads custom swatch colors from localStorage.
5
+ *
6
+ * @param storageKey - localStorage key for the swatch array.
7
+ * @returns Up to five hex color strings; empty slots are omitted.
8
+ */
9
+ export declare function loadCustomSwatches(storageKey: string): string[];
10
+ /**
11
+ * Persists custom swatch colors to localStorage.
12
+ *
13
+ * @param storageKey - localStorage key for the swatch array.
14
+ * @param swatches - Hex colors for each custom slot (length up to five).
15
+ */
16
+ export declare function persistCustomSwatches(storageKey: string, swatches: string[]): void;
17
+ /**
18
+ * Returns the custom swatch slot values padded to the fixed slot count.
19
+ *
20
+ * @param swatches - Loaded custom swatches.
21
+ */
22
+ export declare function padCustomSwatchSlots(swatches: string[]): string[];
23
+ //# sourceMappingURL=customSwatches.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"customSwatches.d.ts","sourceRoot":"","sources":["../../../src/components/ColorPicker/customSwatches.ts"],"names":[],"mappings":"AAEA,oEAAoE;AACpE,eAAO,MAAM,mCAAmC,6BAA6B,CAAC;AAE9E;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,EAAE,CA0B/D;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,IAAI,CAUlF;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,CAMjE"}
@@ -0,0 +1,65 @@
1
+ import { CUSTOM_SWATCH_SLOT_COUNT } from './colorUtils.js';
2
+ /** Default localStorage key for persisted custom color swatches. */
3
+ export const DEFAULT_CUSTOM_SWATCHES_STORAGE_KEY = 'hc.sidebarCustomSwatches';
4
+ /**
5
+ * Loads custom swatch colors from localStorage.
6
+ *
7
+ * @param storageKey - localStorage key for the swatch array.
8
+ * @returns Up to five hex color strings; empty slots are omitted.
9
+ */
10
+ export function loadCustomSwatches(storageKey) {
11
+ try {
12
+ const raw = localStorage.getItem(storageKey);
13
+ if (!raw) {
14
+ return [];
15
+ }
16
+ const parsed = JSON.parse(raw);
17
+ if (!Array.isArray(parsed)) {
18
+ return [];
19
+ }
20
+ const result = [];
21
+ for (const entry of parsed) {
22
+ if (typeof entry !== 'string' || entry.trim() === '') {
23
+ continue;
24
+ }
25
+ result.push(entry.trim());
26
+ if (result.length >= CUSTOM_SWATCH_SLOT_COUNT) {
27
+ break;
28
+ }
29
+ }
30
+ return result;
31
+ }
32
+ catch {
33
+ return [];
34
+ }
35
+ }
36
+ /**
37
+ * Persists custom swatch colors to localStorage.
38
+ *
39
+ * @param storageKey - localStorage key for the swatch array.
40
+ * @param swatches - Hex colors for each custom slot (length up to five).
41
+ */
42
+ export function persistCustomSwatches(storageKey, swatches) {
43
+ try {
44
+ const normalized = swatches
45
+ .slice(0, CUSTOM_SWATCH_SLOT_COUNT)
46
+ .map((entry) => entry.trim())
47
+ .filter((entry) => entry.length > 0);
48
+ localStorage.setItem(storageKey, JSON.stringify(normalized));
49
+ }
50
+ catch {
51
+ // Ignore quota or privacy-mode failures.
52
+ }
53
+ }
54
+ /**
55
+ * Returns the custom swatch slot values padded to the fixed slot count.
56
+ *
57
+ * @param swatches - Loaded custom swatches.
58
+ */
59
+ export function padCustomSwatchSlots(swatches) {
60
+ const slots = swatches.slice(0, CUSTOM_SWATCH_SLOT_COUNT);
61
+ while (slots.length < CUSTOM_SWATCH_SLOT_COUNT) {
62
+ slots.push('');
63
+ }
64
+ return slots;
65
+ }
@@ -0,0 +1,39 @@
1
+ import type { ComponentPropsWithoutRef, JSX } from 'react';
2
+ export interface Props extends Omit<ComponentPropsWithoutRef<'div'>, 'children' | 'className' | 'onChange'> {
3
+ /**
4
+ * Currently selected color, or null when no color is assigned.
5
+ */
6
+ value: string | null;
7
+ /**
8
+ * Called when the user picks a preset or custom swatch color.
9
+ */
10
+ onChange: (color: string) => void;
11
+ /**
12
+ * Called when the user clears the current color. Omitted when clearing is disabled.
13
+ */
14
+ onClear?: () => void;
15
+ /**
16
+ * Fixed preset swatches (defaults to two rows of five HarborClient colors).
17
+ */
18
+ presets?: readonly string[];
19
+ /**
20
+ * localStorage key for persisting custom swatch slot colors.
21
+ */
22
+ customSwatchesStorageKey?: string;
23
+ /**
24
+ * Accessible name for the swatch grid.
25
+ */
26
+ 'aria-label'?: string;
27
+ /**
28
+ * Additional classes on the outer wrapper.
29
+ */
30
+ className?: string;
31
+ }
32
+ /**
33
+ * Swatch-grid color picker with preset rows and user-defined custom slots.
34
+ *
35
+ * Custom slots open the native OS color picker via a hidden `<input type="color">`.
36
+ * Chosen custom colors are saved to localStorage for reuse.
37
+ */
38
+ export declare function ColorPicker({ value, onChange, onClear, presets, customSwatchesStorageKey, 'aria-label': ariaLabel, className, ...props }: Props): JSX.Element;
39
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/ColorPicker/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,wBAAwB,EAAE,GAAG,EAAiB,MAAM,OAAO,CAAC;AAW1E,MAAM,WAAW,KAAM,SAAQ,IAAI,CACjC,wBAAwB,CAAC,KAAK,CAAC,EAC/B,UAAU,GAAG,WAAW,GAAG,UAAU,CACtC;IACC;;OAEG;IACH,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IAErB;;OAEG;IACH,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAElC;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IAErB;;OAEG;IACH,OAAO,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAE5B;;OAEG;IACH,wBAAwB,CAAC,EAAE,MAAM,CAAC;IAElC;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,EAC1B,KAAK,EACL,QAAQ,EACR,OAAO,EACP,OAAsC,EACtC,wBAA8D,EAC9D,YAAY,EAAE,SAA4B,EAC1C,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,GAAG,GAAG,CAAC,OAAO,CAgLrB"}
@@ -0,0 +1,103 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "@harborclient/sdk/jsx-runtime";
2
+ import { faCheck } from '@fortawesome/free-solid-svg-icons';
3
+ import { useCallback, useEffect, useId, useRef, useState } from '@harborclient/sdk/react';
4
+ import { FaIcon } from '../FaIcon/index.js';
5
+ import { cn } from '../utils.js';
6
+ import { DEFAULT_COLOR_PICKER_PRESETS, colorsMatch, toHexColorInputValue } from './colorUtils.js';
7
+ import { DEFAULT_CUSTOM_SWATCHES_STORAGE_KEY, loadCustomSwatches, padCustomSwatchSlots, persistCustomSwatches } from './customSwatches.js';
8
+ /**
9
+ * Swatch-grid color picker with preset rows and user-defined custom slots.
10
+ *
11
+ * Custom slots open the native OS color picker via a hidden `<input type="color">`.
12
+ * Chosen custom colors are saved to localStorage for reuse.
13
+ */
14
+ export function ColorPicker({ value, onChange, onClear, presets = DEFAULT_COLOR_PICKER_PRESETS, customSwatchesStorageKey = DEFAULT_CUSTOM_SWATCHES_STORAGE_KEY, 'aria-label': ariaLabel = 'Choose a color', className, ...props }) {
15
+ const groupId = useId();
16
+ const nativeInputRef = useRef(null);
17
+ const pendingCustomSlotRef = useRef(null);
18
+ const [customSlots, setCustomSlots] = useState(() => padCustomSwatchSlots(loadCustomSwatches(customSwatchesStorageKey)));
19
+ /**
20
+ * Reloads custom swatches when the storage key changes (e.g. isolated tests).
21
+ */
22
+ useEffect(() => {
23
+ setCustomSlots(padCustomSwatchSlots(loadCustomSwatches(customSwatchesStorageKey)));
24
+ }, [customSwatchesStorageKey]);
25
+ /**
26
+ * Persists custom slot colors whenever they change.
27
+ */
28
+ useEffect(() => {
29
+ persistCustomSwatches(customSwatchesStorageKey, customSlots);
30
+ }, [customSlots, customSwatchesStorageKey]);
31
+ /**
32
+ * Applies a color chosen from the native picker to the pending custom slot.
33
+ *
34
+ * @param hex - Hex color from the native input.
35
+ */
36
+ const applyNativePickerColor = useCallback((hex) => {
37
+ const slotIndex = pendingCustomSlotRef.current;
38
+ if (slotIndex == null) {
39
+ return;
40
+ }
41
+ setCustomSlots((current) => {
42
+ const next = [...current];
43
+ next[slotIndex] = hex;
44
+ return next;
45
+ });
46
+ onChange(hex);
47
+ pendingCustomSlotRef.current = null;
48
+ }, [onChange]);
49
+ /**
50
+ * Opens the native color picker for an empty or filled custom slot.
51
+ *
52
+ * @param slotIndex - Zero-based custom slot index.
53
+ * @param currentSlotColor - Existing color in the slot, if any.
54
+ */
55
+ const openNativePickerForSlot = useCallback((slotIndex, currentSlotColor) => {
56
+ pendingCustomSlotRef.current = slotIndex;
57
+ const input = nativeInputRef.current;
58
+ if (!input) {
59
+ return;
60
+ }
61
+ input.value = toHexColorInputValue(currentSlotColor || null);
62
+ input.click();
63
+ }, []);
64
+ /**
65
+ * Renders one circular swatch button with optional selection checkmark.
66
+ *
67
+ * @param color - CSS background color for the swatch.
68
+ * @param label - Accessible name for the swatch.
69
+ * @param selected - Whether this swatch matches the current value.
70
+ * @param onSelect - Called when the swatch is activated.
71
+ * @param onEdit - When set, double-click or a modifier opens the native picker.
72
+ */
73
+ const renderSwatch = (color, label, selected, onSelect, onEdit) => {
74
+ /**
75
+ * Activates the swatch on Enter or Space.
76
+ *
77
+ * @param event - Keyboard event on the swatch button.
78
+ */
79
+ const handleKeyDown = (event) => {
80
+ if (event.key === 'Enter' || event.key === ' ') {
81
+ event.preventDefault();
82
+ onSelect();
83
+ }
84
+ };
85
+ return (_jsx("button", { type: "button", role: "radio", "aria-checked": selected, "aria-label": label, className: cn('relative flex h-8 w-8 shrink-0 items-center justify-center rounded-full border border-separator', 'focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-accent'), style: { backgroundColor: color }, onClick: onSelect, onDoubleClick: onEdit
86
+ ? (event) => {
87
+ event.preventDefault();
88
+ onEdit();
89
+ }
90
+ : undefined, onKeyDown: handleKeyDown, children: selected ? (_jsx(FaIcon, { icon: faCheck, className: "h-3.5 w-3.5 text-white drop-shadow-sm", "aria-hidden": true })) : null }, `${label}-${color}`));
91
+ };
92
+ return (_jsxs("div", { className: cn('flex flex-col gap-2', className), role: "radiogroup", "aria-label": ariaLabel, id: groupId, ...props, children: [_jsx("div", { className: "grid grid-cols-5 gap-2", children: presets.map((color, index) => renderSwatch(color, `Preset color ${index + 1}`, colorsMatch(value, color), () => onChange(color))) }), _jsx("div", { className: "grid grid-cols-5 gap-2", children: customSlots.map((slotColor, index) => {
93
+ const hasColor = slotColor.trim() !== '';
94
+ const displayColor = hasColor ? slotColor : '#d4d4d4';
95
+ return renderSwatch(displayColor, hasColor ? `Custom color ${index + 1}` : `Define custom color ${index + 1}`, hasColor && colorsMatch(value, slotColor), () => {
96
+ if (hasColor) {
97
+ onChange(slotColor);
98
+ return;
99
+ }
100
+ openNativePickerForSlot(index, slotColor);
101
+ }, () => openNativePickerForSlot(index, slotColor));
102
+ }) }), onClear != null && value != null && value.trim() !== '' ? (_jsx("button", { type: "button", className: "self-start text-[14px] text-muted hover:text-text focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-accent", onClick: onClear, children: "Clear color" })) : null, _jsx("input", { ref: nativeInputRef, type: "color", className: "sr-only", tabIndex: -1, "aria-hidden": true, onChange: (event) => applyNativePickerColor(event.target.value) })] }));
103
+ }
@@ -1,6 +1,10 @@
1
1
  export { AsyncListState, ErrorRetry, LoadingMessage } from './AsyncListState/index.js';
2
2
  export { AutocompleteInput, SuggestionList, useAutocomplete, type AutocompleteInputProps, type AutocompleteSource } from './Autocomplete/index.js';
3
3
  export { Card } from './Card/index.js';
4
+ export { ColorPicker } from './ColorPicker/index.js';
5
+ export type { Props as ColorPickerProps } from './ColorPicker/index.js';
6
+ export { colorsMatch, CUSTOM_SWATCH_SLOT_COUNT, DEFAULT_COLOR_PICKER_PRESETS, normalizeCssColor, toHexColorInputValue } from './ColorPicker/colorUtils.js';
7
+ export { DEFAULT_CUSTOM_SWATCHES_STORAGE_KEY, loadCustomSwatches, padCustomSwatchSlots, persistCustomSwatches } from './ColorPicker/customSwatches.js';
4
8
  export { BusyIndicator } from './BusyIndicator/index.js';
5
9
  export type { Props as BusyIndicatorProps } from './BusyIndicator/index.js';
6
10
  export { BackButton } from './BackButton/index.js';
@@ -29,6 +33,7 @@ export { MethodSelect } from './MethodSelect/index.js';
29
33
  export { Modal, ModalFooter, ModalFormLayout } from './Modal/index.js';
30
34
  export { ModalHeader } from './Modal/ModalHeader.js';
31
35
  export { portalToBody } from './portalToBody.js';
36
+ export { clampMenuPosition, getSubmenuAnchoredPosition, getTriggerAnchoredMenuPosition, MENU_MIN_WIDTH_PX, MENU_TRIGGER_OFFSET_PX, MENU_VIEWPORT_MARGIN_PX, type MenuPosition, type MenuSize } from './menuPosition.js';
32
37
  export { OverlayCloseButton } from './OverlayCloseButton/index.js';
33
38
  export { Page } from './Page/index.js';
34
39
  export { PageHeader } from './PageHeader/index.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AACvF,OAAO,EACL,iBAAiB,EACjB,cAAc,EACd,eAAe,EACf,KAAK,sBAAsB,EAC3B,KAAK,kBAAkB,EACxB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AACvC,OA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AE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,YAAY,EAAE,KAAK,IAAI,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAC5E,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EACL,oBAAoB,EACpB,6BAA6B,EAC7B,uBAAuB,EACxB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,YAAY,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,EAAE,cAAc,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAC;AACrE,YAAY,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAC3E,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAC9D,YAAY,EAAE,YAAY,EAAE,gBAAgB,EAAE,UAAU,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC"}
@@ -1,6 +1,9 @@
1
1
  export { AsyncListState, ErrorRetry, LoadingMessage } from './AsyncListState/index.js';
2
2
  export { AutocompleteInput, SuggestionList, useAutocomplete } from './Autocomplete/index.js';
3
3
  export { Card } from './Card/index.js';
4
+ export { ColorPicker } from './ColorPicker/index.js';
5
+ export { colorsMatch, CUSTOM_SWATCH_SLOT_COUNT, DEFAULT_COLOR_PICKER_PRESETS, normalizeCssColor, toHexColorInputValue } from './ColorPicker/colorUtils.js';
6
+ export { DEFAULT_CUSTOM_SWATCHES_STORAGE_KEY, loadCustomSwatches, padCustomSwatchSlots, persistCustomSwatches } from './ColorPicker/customSwatches.js';
4
7
  export { BusyIndicator } from './BusyIndicator/index.js';
5
8
  export { BackButton } from './BackButton/index.js';
6
9
  export { Badge } from './Badge/index.js';
@@ -22,6 +25,7 @@ export { MethodSelect } from './MethodSelect/index.js';
22
25
  export { Modal, ModalFooter, ModalFormLayout } from './Modal/index.js';
23
26
  export { ModalHeader } from './Modal/ModalHeader.js';
24
27
  export { portalToBody } from './portalToBody.js';
28
+ export { clampMenuPosition, getSubmenuAnchoredPosition, getTriggerAnchoredMenuPosition, MENU_MIN_WIDTH_PX, MENU_TRIGGER_OFFSET_PX, MENU_VIEWPORT_MARGIN_PX } from './menuPosition.js';
25
29
  export { OverlayCloseButton } from './OverlayCloseButton/index.js';
26
30
  export { Page } from './Page/index.js';
27
31
  export { PageHeader } from './PageHeader/index.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@harborclient/sdk",
3
- "version": "1.0.75",
3
+ "version": "1.1.0",
4
4
  "description": "TypeScript SDK for HarborClient development.",
5
5
  "keywords": [
6
6
  "harborclient",