@harborclient/sdk 1.0.11 → 1.0.13
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.
|
@@ -21,7 +21,7 @@ interface Props {
|
|
|
21
21
|
*/
|
|
22
22
|
htmlFor?: string;
|
|
23
23
|
/**
|
|
24
|
-
* Muted helper text rendered below the control (stacked layout only).
|
|
24
|
+
* Muted helper text rendered below the label and above the control (stacked layout only).
|
|
25
25
|
*/
|
|
26
26
|
description?: ReactNode;
|
|
27
27
|
/**
|
|
@@ -65,7 +65,7 @@ interface Props {
|
|
|
65
65
|
* @param label - Field label text.
|
|
66
66
|
* @param children - Input, select, or composite control content.
|
|
67
67
|
* @param htmlFor - ID of the primary associated control.
|
|
68
|
-
* @param description - Optional helper text below the control.
|
|
68
|
+
* @param description - Optional helper text below the label and above the control.
|
|
69
69
|
* @param error - Optional validation error below the control.
|
|
70
70
|
* @param errorId - Explicit error element id for `aria-describedby`.
|
|
71
71
|
* @param descriptionId - Explicit description element id for `aria-describedby`.
|
|
@@ -28,7 +28,7 @@ function labelClasses(tone, srOnly, inline) {
|
|
|
28
28
|
* @param label - Field label text.
|
|
29
29
|
* @param children - Input, select, or composite control content.
|
|
30
30
|
* @param htmlFor - ID of the primary associated control.
|
|
31
|
-
* @param description - Optional helper text below the control.
|
|
31
|
+
* @param description - Optional helper text below the label and above the control.
|
|
32
32
|
* @param error - Optional validation error below the control.
|
|
33
33
|
* @param errorId - Explicit error element id for `aria-describedby`.
|
|
34
34
|
* @param descriptionId - Explicit description element id for `aria-describedby`.
|
|
@@ -93,5 +93,5 @@ export function FormGroup({ label, children, htmlFor, description, error, errorI
|
|
|
93
93
|
const wrapperClasses = extra
|
|
94
94
|
? `hc-form-group flex flex-col gap-1 ${extra}`
|
|
95
95
|
: 'hc-form-group flex flex-col gap-1';
|
|
96
|
-
return (_jsxs("div", { className: wrapperClasses, children: [_jsxs("label", { htmlFor: htmlFor, className: "flex flex-col gap-1", children: [_jsx("span", { className: labelClasses(labelTone, srOnly, false), children: label }),
|
|
96
|
+
return (_jsxs("div", { className: wrapperClasses, children: [_jsxs("label", { htmlFor: htmlFor, className: "flex flex-col gap-1", children: [_jsx("span", { className: labelClasses(labelTone, srOnly, false), children: label }), resolvedDescriptionId ? (_jsx("p", { id: resolvedDescriptionId, className: "hc-form-description m-0 text-[14px] text-muted", children: description })) : null, control] }), resolvedErrorId ? (_jsx(FieldError, { id: resolvedErrorId, spacing: "field", children: error })) : null] }));
|
|
97
97
|
}
|
|
@@ -8,5 +8,5 @@ export function PageHeader({ title, description, icon, children, className }) {
|
|
|
8
8
|
const wrapperClassName = className
|
|
9
9
|
? `hc-page-header -mx-6 mb-4 flex flex-wrap items-center gap-2 border-b border-separator px-6 py-3 ${className}`
|
|
10
10
|
: 'hc-page-header -mx-6 mb-4 flex flex-wrap items-center gap-2 border-b border-separator px-6 py-3';
|
|
11
|
-
return (_jsxs("div", { className: wrapperClassName, children: [_jsxs("div", { className: "min-w-0 flex-1", children: [_jsxs("h2", { className: "m-0 flex items-center gap-2 text-[
|
|
11
|
+
return (_jsxs("div", { className: wrapperClassName, children: [_jsxs("div", { className: "min-w-0 flex-1", children: [_jsxs("h2", { className: "m-0 flex items-center gap-2 text-[18px] font-semibold text-text leading-none", children: [icon ? _jsx(FaIcon, { icon: icon, className: "h-5 w-5 shrink-0 text-muted", "aria-hidden": true }) : null, title] }), description ? _jsx("p", { className: "m-0 mt-1 text-[14px] text-muted", children: description }) : null] }), children ? _jsx("div", { className: "flex flex-wrap items-center gap-2", children: children }) : null] }));
|
|
12
12
|
}
|
|
@@ -42,7 +42,7 @@ export function VariableInput({ value, onChange, variables, placeholder, onKeyDo
|
|
|
42
42
|
*/
|
|
43
43
|
const scheduleHide = () => {
|
|
44
44
|
cancelHide();
|
|
45
|
-
hideTimer.current = window.setTimeout(() => setTooltip(null),
|
|
45
|
+
hideTimer.current = window.setTimeout(() => setTooltip(null), 400);
|
|
46
46
|
};
|
|
47
47
|
/**
|
|
48
48
|
* Clears any pending tooltip hide timer when the component unmounts.
|
|
@@ -127,7 +127,7 @@ export function VariableInput({ value, onChange, variables, placeholder, onKeyDo
|
|
|
127
127
|
return;
|
|
128
128
|
}
|
|
129
129
|
}
|
|
130
|
-
|
|
130
|
+
scheduleHide();
|
|
131
131
|
};
|
|
132
132
|
/**
|
|
133
133
|
* Handles keyboard events on the input, including tooltip dismissal.
|
|
@@ -176,7 +176,7 @@ export function VariableInput({ value, onChange, variables, placeholder, onKeyDo
|
|
|
176
176
|
}, onFocus: () => {
|
|
177
177
|
openAutocomplete();
|
|
178
178
|
updateTooltipFromCaret();
|
|
179
|
-
}, onBlur: closeAutocomplete, onKeyDown: handleKeyDown, onKeyUp: handleKeyUp, onSelect: updateTooltipFromCaret, onClick: updateTooltipFromCaret, onScroll: syncScroll, onMouseMove: handleMouseMove, onMouseLeave: scheduleHide }), source && (_jsx(SuggestionList, { open: autocompleteOpen, items: autocompleteItems, activeIndex: autocompleteActiveIndex, anchorRef: inputRef, listboxId: listboxId, onSelect: selectItem, onActiveIndexChange: setActiveIndex, onClose: closeSuggestions })), tooltip && tooltipContent && (_jsxs("div", { id: tooltipId, role: "tooltip", className: "pointer-events-auto fixed z-50 flex max-w-sm -translate-x-1/2 -translate-y-full flex-col gap-
|
|
179
|
+
}, onBlur: closeAutocomplete, onKeyDown: handleKeyDown, onKeyUp: handleKeyUp, onSelect: updateTooltipFromCaret, onClick: updateTooltipFromCaret, onScroll: syncScroll, onMouseMove: handleMouseMove, onMouseLeave: scheduleHide }), source && (_jsx(SuggestionList, { open: autocompleteOpen, items: autocompleteItems, activeIndex: autocompleteActiveIndex, anchorRef: inputRef, listboxId: listboxId, onSelect: selectItem, onActiveIndexChange: setActiveIndex, onClose: closeSuggestions })), tooltip && tooltipContent && (_jsxs("div", { id: tooltipId, role: "tooltip", className: "pointer-events-auto fixed z-50 flex max-w-sm -translate-x-1/2 -translate-y-full flex-col gap-2 rounded-md border border-separator bg-surface px-4 py-3 text-[14px] text-text shadow-md after:pointer-events-auto after:absolute after:-bottom-2 after:left-0 after:right-0 after:h-2 after:content-['']", style: { top: tooltip.top - 4, left: tooltip.left }, onMouseEnter: cancelHide, onMouseLeave: scheduleHide, children: [_jsx("span", { className: tooltipContent.muted ? 'text-muted' : undefined, children: tooltipContent.text }), onEditVariable && (_jsx("button", { type: "button", className: "-mx-1 self-start rounded px-1 py-0.5 text-[14px] text-accent hover:underline app-no-drag", "aria-label": `Edit value for ${tooltip.key}`, onClick: () => {
|
|
180
180
|
onEditVariable();
|
|
181
181
|
setTooltip(null);
|
|
182
182
|
}, children: "Edit value" }))] }))] }));
|