@harborclient/sdk 0.4.5 → 0.5.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.
- package/dist/components/AsyncListState/index.d.ts +85 -0
- package/dist/components/AsyncListState/index.d.ts.map +1 -0
- package/dist/components/AsyncListState/index.js +51 -0
- package/dist/components/BackButton/index.d.ts +32 -0
- package/dist/components/BackButton/index.d.ts.map +1 -0
- package/dist/components/BackButton/index.js +19 -0
- package/dist/components/Badge/index.d.ts +29 -0
- package/dist/components/Badge/index.d.ts.map +1 -0
- package/dist/components/Badge/index.js +32 -0
- package/dist/components/BusyIndicator/index.d.ts +16 -0
- package/dist/components/BusyIndicator/index.d.ts.map +1 -0
- package/dist/components/BusyIndicator/index.js +78 -0
- package/dist/components/Button/index.d.ts +29 -0
- package/dist/components/Button/index.d.ts.map +1 -0
- package/dist/components/Button/index.js +25 -0
- package/dist/components/CodeEditor/config.d.ts +51 -0
- package/dist/components/CodeEditor/config.d.ts.map +1 -0
- package/dist/components/CodeEditor/config.js +64 -0
- package/dist/components/CodeEditor/index.d.ts +77 -0
- package/dist/components/CodeEditor/index.d.ts.map +1 -0
- package/dist/components/CodeEditor/index.js +319 -0
- package/dist/components/CodeEditor/themes.d.ts +19 -0
- package/dist/components/CodeEditor/themes.d.ts.map +1 -0
- package/dist/components/CodeEditor/themes.js +37 -0
- package/dist/components/EmptyState/index.d.ts +26 -0
- package/dist/components/EmptyState/index.d.ts.map +1 -0
- package/dist/components/EmptyState/index.js +25 -0
- package/dist/components/FaIcon/index.d.ts +22 -0
- package/dist/components/FaIcon/index.d.ts.map +1 -0
- package/dist/components/FaIcon/index.js +13 -0
- package/dist/components/FieldError/index.d.ts +39 -0
- package/dist/components/FieldError/index.d.ts.map +1 -0
- package/dist/components/FieldError/index.js +34 -0
- package/dist/components/FooterButton/index.d.ts +30 -0
- package/dist/components/FooterButton/index.d.ts.map +1 -0
- package/dist/components/FooterButton/index.js +19 -0
- package/dist/components/FooterIcon/index.d.ts +32 -0
- package/dist/components/FooterIcon/index.d.ts.map +1 -0
- package/dist/components/FooterIcon/index.js +21 -0
- package/dist/components/FormDataEditor/index.d.ts +31 -0
- package/dist/components/FormDataEditor/index.d.ts.map +1 -0
- package/dist/components/FormDataEditor/index.js +109 -0
- package/dist/components/FormGroup/index.d.ts +75 -0
- package/dist/components/FormGroup/index.d.ts.map +1 -0
- package/dist/components/FormGroup/index.js +95 -0
- package/dist/components/KeyValueEditor/index.d.ts +35 -0
- package/dist/components/KeyValueEditor/index.d.ts.map +1 -0
- package/dist/components/KeyValueEditor/index.js +40 -0
- package/dist/components/MethodSelect/index.d.ts +20 -0
- package/dist/components/MethodSelect/index.d.ts.map +1 -0
- package/dist/components/MethodSelect/index.js +9 -0
- package/dist/components/Modal/ModalFooter.d.ts +25 -0
- package/dist/components/Modal/ModalFooter.d.ts.map +1 -0
- package/dist/components/Modal/ModalFooter.js +13 -0
- package/dist/components/Modal/ModalFormLayout.d.ts +31 -0
- package/dist/components/Modal/ModalFormLayout.d.ts.map +1 -0
- package/dist/components/Modal/ModalFormLayout.js +14 -0
- package/dist/components/Modal/ModalHeader.d.ts +34 -0
- package/dist/components/Modal/ModalHeader.d.ts.map +1 -0
- package/dist/components/Modal/ModalHeader.js +11 -0
- package/dist/components/Modal/index.d.ts +59 -0
- package/dist/components/Modal/index.d.ts.map +1 -0
- package/dist/components/Modal/index.js +37 -0
- package/dist/components/OverlayCloseButton/index.d.ts +25 -0
- package/dist/components/OverlayCloseButton/index.d.ts.map +1 -0
- package/dist/components/OverlayCloseButton/index.js +16 -0
- package/dist/components/OverlayPage/index.d.ts +40 -0
- package/dist/components/OverlayPage/index.d.ts.map +1 -0
- package/dist/components/OverlayPage/index.js +18 -0
- package/dist/components/PageHeader/index.d.ts +31 -0
- package/dist/components/PageHeader/index.d.ts.map +1 -0
- package/dist/components/PageHeader/index.js +12 -0
- package/dist/components/PanelCloseButton/index.d.ts +30 -0
- package/dist/components/PanelCloseButton/index.d.ts.map +1 -0
- package/dist/components/PanelCloseButton/index.js +17 -0
- package/dist/components/Resizable/Resizable.d.ts +48 -0
- package/dist/components/Resizable/Resizable.d.ts.map +1 -0
- package/dist/components/Resizable/Resizable.js +32 -0
- package/dist/components/Resizable/ResizeHandle.d.ts +41 -0
- package/dist/components/Resizable/ResizeHandle.d.ts.map +1 -0
- package/dist/components/Resizable/ResizeHandle.js +17 -0
- package/dist/components/Resizable/footerPanelUtils.d.ts +25 -0
- package/dist/components/Resizable/footerPanelUtils.d.ts.map +1 -0
- package/dist/components/Resizable/footerPanelUtils.js +59 -0
- package/dist/components/Resizable/index.d.ts +4 -0
- package/dist/components/Resizable/index.d.ts.map +1 -0
- package/dist/components/Resizable/index.js +3 -0
- package/dist/components/Resizable/useResizable.d.ts +42 -0
- package/dist/components/Resizable/useResizable.d.ts.map +1 -0
- package/dist/components/Resizable/useResizable.js +151 -0
- package/dist/components/ResourceList/index.d.ts +73 -0
- package/dist/components/ResourceList/index.d.ts.map +1 -0
- package/dist/components/ResourceList/index.js +44 -0
- package/dist/components/RowActionsMenu/index.d.ts +33 -0
- package/dist/components/RowActionsMenu/index.d.ts.map +1 -0
- package/dist/components/RowActionsMenu/index.js +54 -0
- package/dist/components/SegmentedTabs/index.d.ts +107 -0
- package/dist/components/SegmentedTabs/index.d.ts.map +1 -0
- package/dist/components/SegmentedTabs/index.js +111 -0
- package/dist/components/Spinner/index.d.ts +26 -0
- package/dist/components/Spinner/index.d.ts.map +1 -0
- package/dist/components/Spinner/index.js +22 -0
- package/dist/components/StatusMessage/index.d.ts +29 -0
- package/dist/components/StatusMessage/index.d.ts.map +1 -0
- package/dist/components/StatusMessage/index.js +13 -0
- package/dist/components/TabCloseButton/index.d.ts +25 -0
- package/dist/components/TabCloseButton/index.d.ts.map +1 -0
- package/dist/components/TabCloseButton/index.js +13 -0
- package/dist/components/VariableInput/index.d.ts +58 -0
- package/dist/components/VariableInput/index.d.ts.map +1 -0
- package/dist/components/VariableInput/index.js +90 -0
- package/dist/components/VariableTable/index.d.ts +22 -0
- package/dist/components/VariableTable/index.d.ts.map +1 -0
- package/dist/components/VariableTable/index.js +43 -0
- package/dist/components/classes.d.ts +11 -0
- package/dist/components/classes.d.ts.map +1 -0
- package/dist/components/classes.js +14 -0
- package/dist/components/forms/Input.d.ts +22 -0
- package/dist/components/forms/Input.d.ts.map +1 -0
- package/dist/components/forms/Input.js +9 -0
- package/dist/components/forms/Select.d.ts +24 -0
- package/dist/components/forms/Select.d.ts.map +1 -0
- package/dist/components/forms/Select.js +10 -0
- package/dist/components/forms/Textarea.d.ts +22 -0
- package/dist/components/forms/Textarea.d.ts.map +1 -0
- package/dist/components/forms/Textarea.js +8 -0
- package/dist/components/forms/classes.d.ts +24 -0
- package/dist/components/forms/classes.d.ts.map +1 -0
- package/dist/components/forms/classes.js +32 -0
- package/dist/components/forms/index.d.ts +5 -0
- package/dist/components/forms/index.d.ts.map +1 -0
- package/dist/components/forms/index.js +4 -0
- package/dist/components/index.d.ts +51 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/components/index.js +37 -0
- package/dist/components/rowActionsMenuHelpers.d.ts +13 -0
- package/dist/components/rowActionsMenuHelpers.d.ts.map +1 -0
- package/dist/components/rowActionsMenuHelpers.js +29 -0
- package/dist/components/useDialogFocus.d.ts +16 -0
- package/dist/components/useDialogFocus.d.ts.map +1 -0
- package/dist/components/useDialogFocus.js +81 -0
- package/dist/components/utils.d.ts +29 -0
- package/dist/components/utils.d.ts.map +1 -0
- package/dist/components/utils.js +89 -0
- package/dist/components/utils.test.d.ts +2 -0
- package/dist/components/utils.test.d.ts.map +1 -0
- package/dist/components/utils.test.js +27 -0
- package/dist/http/substitute.d.ts.map +1 -1
- package/dist/http/substitute.js +9 -3
- package/dist/http/substitute.test.js +8 -0
- package/dist/main.d.ts +1 -1
- package/dist/main.d.ts.map +1 -1
- package/dist/runtime/react.d.ts +16 -1
- package/dist/runtime/react.js +40 -0
- package/dist/types.d.ts +105 -2
- package/dist/types.d.ts.map +1 -1
- package/dist/ui/codeEditorSettings.d.ts +29 -0
- package/dist/ui/codeEditorSettings.d.ts.map +1 -0
- package/dist/ui/codeEditorSettings.js +52 -0
- package/dist/ui/index.d.ts +1 -0
- package/dist/ui/index.d.ts.map +1 -1
- package/dist/ui/index.js +1 -0
- package/dist/variables/dynamic.d.ts +49 -0
- package/dist/variables/dynamic.d.ts.map +1 -0
- package/dist/variables/dynamic.js +735 -0
- package/dist/variables/dynamic.test.d.ts +2 -0
- package/dist/variables/dynamic.test.d.ts.map +1 -0
- package/dist/variables/dynamic.test.js +60 -0
- package/dist/variables/index.d.ts +3 -0
- package/dist/variables/index.d.ts.map +1 -0
- package/dist/variables/index.js +2 -0
- package/dist/variables/tokens.d.ts +44 -0
- package/dist/variables/tokens.d.ts.map +1 -0
- package/dist/variables/tokens.js +76 -0
- package/dist/variables/tokens.test.d.ts +2 -0
- package/dist/variables/tokens.test.d.ts.map +1 -0
- package/dist/variables/tokens.test.js +115 -0
- package/package.json +75 -14
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import type { JSX, ReactNode } from 'react';
|
|
2
|
+
export { ModalFooter } from './ModalFooter.js';
|
|
3
|
+
export { ModalFormLayout } from './ModalFormLayout.js';
|
|
4
|
+
interface BaseProps {
|
|
5
|
+
/**
|
|
6
|
+
* Called when the backdrop is clicked or Escape is pressed.
|
|
7
|
+
*/
|
|
8
|
+
onClose: () => void;
|
|
9
|
+
/**
|
|
10
|
+
* Optional width class for the dialog panel (defaults to w-96).
|
|
11
|
+
*/
|
|
12
|
+
className?: string;
|
|
13
|
+
/**
|
|
14
|
+
* Optional classes merged onto the backdrop overlay.
|
|
15
|
+
*/
|
|
16
|
+
overlayClassName?: string;
|
|
17
|
+
/**
|
|
18
|
+
* When true, Escape does not call `onClose` (e.g. modals that require an explicit button).
|
|
19
|
+
*/
|
|
20
|
+
disableEscape?: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Dialog heading rendered in the modal header row.
|
|
23
|
+
*/
|
|
24
|
+
title?: ReactNode;
|
|
25
|
+
/**
|
|
26
|
+
* Optional muted summary shown below the title in the header.
|
|
27
|
+
*/
|
|
28
|
+
description?: ReactNode;
|
|
29
|
+
/**
|
|
30
|
+
* Extra action controls rendered before the header Close button.
|
|
31
|
+
*/
|
|
32
|
+
headerActions?: ReactNode;
|
|
33
|
+
/**
|
|
34
|
+
* When true, the header Close button is disabled.
|
|
35
|
+
*/
|
|
36
|
+
closeDisabled?: boolean;
|
|
37
|
+
/**
|
|
38
|
+
* Children to render inside the modal body.
|
|
39
|
+
*/
|
|
40
|
+
children: ReactNode;
|
|
41
|
+
}
|
|
42
|
+
type Props = BaseProps & ({
|
|
43
|
+
/**
|
|
44
|
+
* Id of the element that labels the dialog (typically the heading).
|
|
45
|
+
*/
|
|
46
|
+
labelledBy: string;
|
|
47
|
+
label?: never;
|
|
48
|
+
} | {
|
|
49
|
+
labelledBy?: never;
|
|
50
|
+
/**
|
|
51
|
+
* Accessible name when no visible heading is linked via `labelledBy`.
|
|
52
|
+
*/
|
|
53
|
+
label: string;
|
|
54
|
+
});
|
|
55
|
+
/**
|
|
56
|
+
* Shared modal backdrop and panel wrapper used by all application dialogs.
|
|
57
|
+
*/
|
|
58
|
+
export declare function Modal({ onClose, className, overlayClassName, disableEscape, title, description, headerActions, closeDisabled, labelledBy, label, children }: Props): JSX.Element;
|
|
59
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Modal/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAI5C,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAEvD,UAAU,SAAS;IACjB;;OAEG;IACH,OAAO,EAAE,MAAM,IAAI,CAAC;IAEpB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAE1B;;OAEG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IAExB;;OAEG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;IAElB;;OAEG;IACH,WAAW,CAAC,EAAE,SAAS,CAAC;IAExB;;OAEG;IACH,aAAa,CAAC,EAAE,SAAS,CAAC;IAE1B;;OAEG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IAExB;;OAEG;IACH,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED,KAAK,KAAK,GAAG,SAAS,GACpB,CACI;IACE;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC;CACf,GACD;IACE,UAAU,CAAC,EAAE,KAAK,CAAC;IACnB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;CACf,CACJ,CAAC;AAEJ;;GAEG;AACH,wBAAgB,KAAK,CAAC,EACpB,OAAO,EACP,SAAkB,EAClB,gBAAgB,EAChB,aAAqB,EACrB,KAAK,EACL,WAAW,EACX,aAAa,EACb,aAAqB,EACrB,UAAU,EACV,KAAK,EACL,QAAQ,EACT,EAAE,KAAK,GAAG,GAAG,CAAC,OAAO,CA6DrB"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "@harborclient/sdk/jsx-runtime";
|
|
2
|
+
import { useEffect, useRef } from '@harborclient/sdk/react';
|
|
3
|
+
import { useDialogFocus } from '../useDialogFocus.js';
|
|
4
|
+
import { ModalHeader } from './ModalHeader.js';
|
|
5
|
+
export { ModalFooter } from './ModalFooter.js';
|
|
6
|
+
export { ModalFormLayout } from './ModalFormLayout.js';
|
|
7
|
+
/**
|
|
8
|
+
* Shared modal backdrop and panel wrapper used by all application dialogs.
|
|
9
|
+
*/
|
|
10
|
+
export function Modal({ onClose, className = 'w-96', overlayClassName, disableEscape = false, title, description, headerActions, closeDisabled = false, labelledBy, label, children }) {
|
|
11
|
+
const panelRef = useRef(null);
|
|
12
|
+
useDialogFocus(panelRef);
|
|
13
|
+
/**
|
|
14
|
+
* Closes the modal when Escape is pressed unless disabled.
|
|
15
|
+
*/
|
|
16
|
+
useEffect(() => {
|
|
17
|
+
if (disableEscape)
|
|
18
|
+
return;
|
|
19
|
+
/**
|
|
20
|
+
* Dismisses the dialog on Escape key press.
|
|
21
|
+
*
|
|
22
|
+
* @param event - Document keydown event.
|
|
23
|
+
*/
|
|
24
|
+
const handleKeyDown = (event) => {
|
|
25
|
+
if (event.key === 'Escape') {
|
|
26
|
+
onClose();
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
document.addEventListener('keydown', handleKeyDown);
|
|
30
|
+
return () => document.removeEventListener('keydown', handleKeyDown);
|
|
31
|
+
}, [disableEscape, onClose]);
|
|
32
|
+
const overlayClass = `fixed inset-0 flex items-center justify-center bg-black/40 ${overlayClassName ?? 'z-50'}`;
|
|
33
|
+
const panelClass = title
|
|
34
|
+
? `${className} flex max-h-[85vh] flex-col overflow-hidden rounded-lg border border-separator bg-surface shadow-xl`
|
|
35
|
+
: `${className} rounded-lg border border-separator bg-surface p-4 shadow-xl`;
|
|
36
|
+
return (_jsx("div", { className: overlayClass, onClick: onClose, children: _jsx("div", { ref: panelRef, role: "dialog", "aria-modal": "true", "aria-labelledby": labelledBy, "aria-label": label, className: panelClass, onClick: (event) => event.stopPropagation(), children: title && labelledBy ? (_jsxs(_Fragment, { children: [_jsx(ModalHeader, { titleId: labelledBy, title: title, description: description, headerActions: headerActions, closeDisabled: closeDisabled, onClose: onClose }), _jsx("div", { className: "flex-1 overflow-y-auto p-4", children: children })] })) : (children) }) }));
|
|
37
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { JSX } from 'react';
|
|
2
|
+
interface Props {
|
|
3
|
+
/**
|
|
4
|
+
* Accessible name for the close control.
|
|
5
|
+
*/
|
|
6
|
+
label?: string;
|
|
7
|
+
/**
|
|
8
|
+
* Called when the user activates the close button.
|
|
9
|
+
*/
|
|
10
|
+
onClose: () => void;
|
|
11
|
+
/**
|
|
12
|
+
* Additional Tailwind classes merged onto the button element.
|
|
13
|
+
*/
|
|
14
|
+
className?: string;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Always-visible overlay close icon used on full-page settings and plugin views.
|
|
18
|
+
*
|
|
19
|
+
* @param label - Accessible name; defaults to "Close".
|
|
20
|
+
* @param onClose - Close handler.
|
|
21
|
+
* @param className - Extra classes appended after the overlay preset.
|
|
22
|
+
*/
|
|
23
|
+
export declare function OverlayCloseButton({ label, onClose, className }: Props): JSX.Element;
|
|
24
|
+
export {};
|
|
25
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/OverlayCloseButton/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAKjC,UAAU,KAAK;IACb;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,OAAO,EAAE,MAAM,IAAI,CAAC;IAEpB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,EAAE,KAAe,EAAE,OAAO,EAAE,SAAS,EAAE,EAAE,KAAK,GAAG,GAAG,CAAC,OAAO,CAS9F"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { jsx as _jsx } from "@harborclient/sdk/jsx-runtime";
|
|
2
|
+
import { faXmark } from '@fortawesome/free-solid-svg-icons';
|
|
3
|
+
import { Button } from '../Button/index.js';
|
|
4
|
+
import { FaIcon } from '../FaIcon/index.js';
|
|
5
|
+
/**
|
|
6
|
+
* Always-visible overlay close icon used on full-page settings and plugin views.
|
|
7
|
+
*
|
|
8
|
+
* @param label - Accessible name; defaults to "Close".
|
|
9
|
+
* @param onClose - Close handler.
|
|
10
|
+
* @param className - Extra classes appended after the overlay preset.
|
|
11
|
+
*/
|
|
12
|
+
export function OverlayCloseButton({ label = 'Close', onClose, className }) {
|
|
13
|
+
const base = 'opacity-100 text-[28px]';
|
|
14
|
+
const classes = className ? `${base} ${className}` : base;
|
|
15
|
+
return (_jsx(Button, { type: "button", variant: "icon", className: classes, "aria-label": label, onClick: onClose, children: _jsx(FaIcon, { icon: faXmark, className: "h-4 w-4" }) }));
|
|
16
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { JSX, ReactNode } from 'react';
|
|
2
|
+
interface Props {
|
|
3
|
+
/**
|
|
4
|
+
* Page title shown in the overlay header.
|
|
5
|
+
*/
|
|
6
|
+
title: ReactNode;
|
|
7
|
+
/**
|
|
8
|
+
* Called when the user closes the overlay.
|
|
9
|
+
*/
|
|
10
|
+
onClose: () => void;
|
|
11
|
+
/**
|
|
12
|
+
* Scrollable page body content.
|
|
13
|
+
*/
|
|
14
|
+
children: ReactNode;
|
|
15
|
+
/**
|
|
16
|
+
* Optional footer actions such as Save/Cancel rows.
|
|
17
|
+
*/
|
|
18
|
+
footer?: ReactNode;
|
|
19
|
+
/**
|
|
20
|
+
* Accessible name for the header close button.
|
|
21
|
+
*/
|
|
22
|
+
closeLabel?: string;
|
|
23
|
+
/**
|
|
24
|
+
* Additional Tailwind classes merged onto the outer scroll container.
|
|
25
|
+
*/
|
|
26
|
+
className?: string;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Full-page scrollable overlay shell shared by environment, collection, and plugin views.
|
|
30
|
+
*
|
|
31
|
+
* @param title - Header title text or element.
|
|
32
|
+
* @param onClose - Close handler for the header button.
|
|
33
|
+
* @param children - Main page content.
|
|
34
|
+
* @param footer - Optional trailing action row below the body.
|
|
35
|
+
* @param closeLabel - Accessible close button label.
|
|
36
|
+
* @param className - Extra classes on the outer container.
|
|
37
|
+
*/
|
|
38
|
+
export declare function OverlayPage({ title, onClose, children, footer, closeLabel, className }: Props): JSX.Element;
|
|
39
|
+
export {};
|
|
40
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/OverlayPage/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAG5C,UAAU,KAAK;IACb;;OAEG;IACH,KAAK,EAAE,SAAS,CAAC;IAEjB;;OAEG;IACH,OAAO,EAAE,MAAM,IAAI,CAAC;IAEpB;;OAEG;IACH,QAAQ,EAAE,SAAS,CAAC;IAEpB;;OAEG;IACH,MAAM,CAAC,EAAE,SAAS,CAAC;IAEnB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;;GASG;AACH,wBAAgB,WAAW,CAAC,EAC1B,KAAK,EACL,OAAO,EACP,QAAQ,EACR,MAAM,EACN,UAAU,EACV,SAAS,EACV,EAAE,KAAK,GAAG,GAAG,CAAC,OAAO,CAiBrB"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "@harborclient/sdk/jsx-runtime";
|
|
2
|
+
import { OverlayCloseButton } from '../OverlayCloseButton/index.js';
|
|
3
|
+
/**
|
|
4
|
+
* Full-page scrollable overlay shell shared by environment, collection, and plugin views.
|
|
5
|
+
*
|
|
6
|
+
* @param title - Header title text or element.
|
|
7
|
+
* @param onClose - Close handler for the header button.
|
|
8
|
+
* @param children - Main page content.
|
|
9
|
+
* @param footer - Optional trailing action row below the body.
|
|
10
|
+
* @param closeLabel - Accessible close button label.
|
|
11
|
+
* @param className - Extra classes on the outer container.
|
|
12
|
+
*/
|
|
13
|
+
export function OverlayPage({ title, onClose, children, footer, closeLabel, className }) {
|
|
14
|
+
const outer = className
|
|
15
|
+
? `flex min-h-0 flex-1 flex-col overflow-y-auto p-6 ${className}`
|
|
16
|
+
: 'flex min-h-0 flex-1 flex-col overflow-y-auto p-6';
|
|
17
|
+
return (_jsx("div", { className: outer, children: _jsxs("div", { className: "mx-auto w-full", children: [_jsxs("div", { className: "mb-6 flex items-center justify-between gap-4", children: [_jsx("h1", { className: "m-0 text-[15px] font-semibold text-text", children: title }), _jsx(OverlayCloseButton, { label: closeLabel, onClose: onClose })] }), children, footer] }) }));
|
|
18
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { IconDefinition } from '@fortawesome/fontawesome-svg-core';
|
|
2
|
+
import type { JSX, ReactNode } from 'react';
|
|
3
|
+
interface Props {
|
|
4
|
+
/**
|
|
5
|
+
* Page heading rendered as an `h2`.
|
|
6
|
+
*/
|
|
7
|
+
title: string;
|
|
8
|
+
/**
|
|
9
|
+
* Optional muted summary shown below the title.
|
|
10
|
+
*/
|
|
11
|
+
description?: string;
|
|
12
|
+
/**
|
|
13
|
+
* Optional decorative icon shown before the title.
|
|
14
|
+
*/
|
|
15
|
+
icon?: IconDefinition;
|
|
16
|
+
/**
|
|
17
|
+
* Action controls aligned to the right side of the header row.
|
|
18
|
+
*/
|
|
19
|
+
children?: ReactNode;
|
|
20
|
+
/**
|
|
21
|
+
* Extra classes merged onto the outer header wrapper.
|
|
22
|
+
*/
|
|
23
|
+
className?: string;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Full-bleed page header with a bordered bottom edge, title block on the left,
|
|
27
|
+
* and optional action controls on the right.
|
|
28
|
+
*/
|
|
29
|
+
export declare function PageHeader({ title, description, icon, children, className }: Props): JSX.Element;
|
|
30
|
+
export {};
|
|
31
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/PageHeader/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AACxE,OAAO,KAAK,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAG5C,UAAU,KAAK;IACb;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;OAEG;IACH,IAAI,CAAC,EAAE,cAAc,CAAC;IAEtB;;OAEG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;IAErB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,EAAE,KAAK,EAAE,WAAW,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,EAAE,KAAK,GAAG,GAAG,CAAC,OAAO,CAiBhG"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "@harborclient/sdk/jsx-runtime";
|
|
2
|
+
import { FaIcon } from '../FaIcon/index.js';
|
|
3
|
+
/**
|
|
4
|
+
* Full-bleed page header with a bordered bottom edge, title block on the left,
|
|
5
|
+
* and optional action controls on the right.
|
|
6
|
+
*/
|
|
7
|
+
export function PageHeader({ title, description, icon, children, className }) {
|
|
8
|
+
const wrapperClassName = className
|
|
9
|
+
? `-mx-6 mb-4 flex flex-wrap items-center gap-2 border-b border-separator px-6 pb-6 ${className}`
|
|
10
|
+
: '-mx-6 mb-4 flex flex-wrap items-center gap-2 border-b border-separator px-6 pb-6';
|
|
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-[17px] font-semibold text-text", children: [icon ? _jsx(FaIcon, { icon: icon, className: "h-4 w-4 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
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { JSX } from 'react';
|
|
2
|
+
interface Props {
|
|
3
|
+
/**
|
|
4
|
+
* Called when the user closes the panel or overlay.
|
|
5
|
+
*/
|
|
6
|
+
onClose: () => void;
|
|
7
|
+
/**
|
|
8
|
+
* Default accessible name when `ariaLabel` is not provided.
|
|
9
|
+
*/
|
|
10
|
+
label?: string;
|
|
11
|
+
/**
|
|
12
|
+
* Accessible name when it should differ from `label`.
|
|
13
|
+
*/
|
|
14
|
+
ariaLabel?: string;
|
|
15
|
+
/**
|
|
16
|
+
* Additional Tailwind classes merged onto the button element.
|
|
17
|
+
*/
|
|
18
|
+
className?: string;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Secondary icon close control for settings headers and full-page panels.
|
|
22
|
+
*
|
|
23
|
+
* @param onClose - Close handler.
|
|
24
|
+
* @param label - Default accessible name; defaults to "Close".
|
|
25
|
+
* @param ariaLabel - Accessible name override.
|
|
26
|
+
* @param className - Extra classes appended after the layout preset.
|
|
27
|
+
*/
|
|
28
|
+
export declare function PanelCloseButton({ onClose, label, ariaLabel, className }: Props): JSX.Element;
|
|
29
|
+
export {};
|
|
30
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/PanelCloseButton/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAKjC,UAAU,KAAK;IACb;;OAEG;IACH,OAAO,EAAE,MAAM,IAAI,CAAC;IAEpB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,EAC/B,OAAO,EACP,KAAe,EACf,SAAS,EACT,SAAS,EACV,EAAE,KAAK,GAAG,GAAG,CAAC,OAAO,CAerB"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { jsx as _jsx } from "@harborclient/sdk/jsx-runtime";
|
|
2
|
+
import { Button } from '../Button/index.js';
|
|
3
|
+
import { FaIcon } from '../FaIcon/index.js';
|
|
4
|
+
import { faXmark } from '@fortawesome/free-solid-svg-icons';
|
|
5
|
+
/**
|
|
6
|
+
* Secondary icon close control for settings headers and full-page panels.
|
|
7
|
+
*
|
|
8
|
+
* @param onClose - Close handler.
|
|
9
|
+
* @param label - Default accessible name; defaults to "Close".
|
|
10
|
+
* @param ariaLabel - Accessible name override.
|
|
11
|
+
* @param className - Extra classes appended after the layout preset.
|
|
12
|
+
*/
|
|
13
|
+
export function PanelCloseButton({ onClose, label = 'Close', ariaLabel, className }) {
|
|
14
|
+
const base = 'inline-flex shrink-0 items-center justify-center py-2';
|
|
15
|
+
const classes = className ? `${base} ${className}` : base;
|
|
16
|
+
return (_jsx(Button, { type: "button", variant: "secondary", className: classes, "aria-label": ariaLabel ?? label, onClick: onClose, children: _jsx(FaIcon, { icon: faXmark, className: "h-4 w-4" }) }));
|
|
17
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { JSX, ReactNode } from 'react';
|
|
2
|
+
interface Props {
|
|
3
|
+
/**
|
|
4
|
+
* Root element id used by footer toggles via aria-controls.
|
|
5
|
+
*/
|
|
6
|
+
id: string;
|
|
7
|
+
/**
|
|
8
|
+
* Whether the panel is visible (slides up when true).
|
|
9
|
+
*/
|
|
10
|
+
open: boolean;
|
|
11
|
+
/**
|
|
12
|
+
* Closes the panel.
|
|
13
|
+
*/
|
|
14
|
+
onClose: () => void;
|
|
15
|
+
/**
|
|
16
|
+
* Plain-text name for close and resize aria labels (e.g. "console").
|
|
17
|
+
*/
|
|
18
|
+
closeLabel: string;
|
|
19
|
+
/**
|
|
20
|
+
* localStorage key for persisted panel height.
|
|
21
|
+
*/
|
|
22
|
+
storageKey: string;
|
|
23
|
+
/**
|
|
24
|
+
* Header content rendered in the title bar left side.
|
|
25
|
+
*/
|
|
26
|
+
title?: ReactNode;
|
|
27
|
+
/**
|
|
28
|
+
* When true, skips the header bar and overlays the close button on content.
|
|
29
|
+
*/
|
|
30
|
+
headerless?: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* When true, does not render children while the panel is closed.
|
|
33
|
+
*/
|
|
34
|
+
unmountWhenClosed?: boolean;
|
|
35
|
+
/**
|
|
36
|
+
* Panel body content.
|
|
37
|
+
*/
|
|
38
|
+
children: ReactNode;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Slide-up, resizable footer panel shell with optional header bar.
|
|
42
|
+
*
|
|
43
|
+
* Encapsulates resize handle wiring, height persistence, open/close animation,
|
|
44
|
+
* and close affordance shared by Console, Variables, and plugin footer panels.
|
|
45
|
+
*/
|
|
46
|
+
export declare function Resizable({ id, open, onClose, closeLabel, storageKey, title, headerless, unmountWhenClosed, children }: Props): JSX.Element;
|
|
47
|
+
export {};
|
|
48
|
+
//# sourceMappingURL=Resizable.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Resizable.d.ts","sourceRoot":"","sources":["../../../src/components/Resizable/Resizable.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAa5C,UAAU,KAAK;IACb;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;OAEG;IACH,IAAI,EAAE,OAAO,CAAC;IAEd;;OAEG;IACH,OAAO,EAAE,MAAM,IAAI,CAAC;IAEpB;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;IAElB;;OAEG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IAErB;;OAEG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAE5B;;OAEG;IACH,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,EACxB,EAAE,EACF,IAAI,EACJ,OAAO,EACP,UAAU,EACV,UAAU,EACV,KAAK,EACL,UAAkB,EAClB,iBAAyB,EACzB,QAAQ,EACT,EAAE,KAAK,GAAG,GAAG,CAAC,OAAO,CA8ErB"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "@harborclient/sdk/jsx-runtime";
|
|
2
|
+
import { useCallback, useRef } from '@harborclient/sdk/react';
|
|
3
|
+
import { FaIcon } from '../FaIcon/index.js';
|
|
4
|
+
import { faXmark } from '@fortawesome/free-solid-svg-icons';
|
|
5
|
+
import { DEFAULT_HEIGHT, MIN_HEIGHT, footerPanelClassName, footerPanelCloseButtonClassName, getFooterPanelMaxSize } from './footerPanelUtils';
|
|
6
|
+
import { ResizeHandle } from './ResizeHandle.js';
|
|
7
|
+
import { useResizable } from './useResizable.js';
|
|
8
|
+
/**
|
|
9
|
+
* Slide-up, resizable footer panel shell with optional header bar.
|
|
10
|
+
*
|
|
11
|
+
* Encapsulates resize handle wiring, height persistence, open/close animation,
|
|
12
|
+
* and close affordance shared by Console, Variables, and plugin footer panels.
|
|
13
|
+
*/
|
|
14
|
+
export function Resizable({ id, open, onClose, closeLabel, storageKey, title, headerless = false, unmountWhenClosed = false, children }) {
|
|
15
|
+
const containerRef = useRef(null);
|
|
16
|
+
/**
|
|
17
|
+
* Keeps max-size measurement stable across re-renders so useResizable
|
|
18
|
+
* does not re-run layout effects when unrelated UI updates.
|
|
19
|
+
*/
|
|
20
|
+
const getMaxSize = useCallback(() => getFooterPanelMaxSize(containerRef), []);
|
|
21
|
+
const { size: height, minSize: panelMinSize, maxSize: panelMaxSize, onResizeStart, onKeyboardResize } = useResizable({
|
|
22
|
+
axis: 'y',
|
|
23
|
+
direction: -1,
|
|
24
|
+
defaultSize: DEFAULT_HEIGHT,
|
|
25
|
+
minSize: MIN_HEIGHT,
|
|
26
|
+
getMaxSize,
|
|
27
|
+
storageKey
|
|
28
|
+
});
|
|
29
|
+
const closeButton = (_jsx("button", { type: "button", className: footerPanelCloseButtonClassName, onClick: onClose, "aria-label": `Close ${closeLabel}`, children: _jsx(FaIcon, { icon: faXmark, className: "h-3.5 w-3.5" }) }));
|
|
30
|
+
const body = unmountWhenClosed && !open ? null : children;
|
|
31
|
+
return (_jsxs("div", { ref: containerRef, id: id, className: footerPanelClassName(open), style: { height }, "aria-hidden": !open, children: [_jsx(ResizeHandle, { orientation: "horizontal", value: height, min: panelMinSize, max: panelMaxSize, onResizeStart: onResizeStart, onKeyboardResize: onKeyboardResize, ariaLabel: `Resize ${closeLabel} panel` }), headerless ? (_jsxs("div", { className: "relative flex min-h-0 flex-1 flex-col overflow-hidden", children: [_jsx("button", { type: "button", className: `absolute right-2 top-2 z-10 ${footerPanelCloseButtonClassName}`, onClick: onClose, "aria-label": `Close ${closeLabel}`, children: _jsx(FaIcon, { icon: faXmark, className: "h-3.5 w-3.5" }) }), _jsx("div", { className: "flex min-h-0 flex-1 flex-col", children: body })] })) : (_jsxs(_Fragment, { children: [_jsxs("div", { className: "flex shrink-0 items-center justify-between border-b border-separator px-3 py-2", children: [_jsx("div", { className: "min-w-0 flex-1", children: title }), closeButton] }), body] }))] }));
|
|
32
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { JSX, KeyboardEvent as ReactKeyboardEvent, MouseEvent as ReactMouseEvent } from 'react';
|
|
2
|
+
interface Props {
|
|
3
|
+
/**
|
|
4
|
+
* Handle orientation: horizontal resizes height, vertical resizes width.
|
|
5
|
+
*/
|
|
6
|
+
orientation: 'horizontal' | 'vertical';
|
|
7
|
+
/**
|
|
8
|
+
* Current panel size in pixels for valued separator semantics.
|
|
9
|
+
*/
|
|
10
|
+
value: number;
|
|
11
|
+
/**
|
|
12
|
+
* Minimum allowed panel size in pixels.
|
|
13
|
+
*/
|
|
14
|
+
min: number;
|
|
15
|
+
/**
|
|
16
|
+
* Maximum allowed panel size in pixels.
|
|
17
|
+
*/
|
|
18
|
+
max: number;
|
|
19
|
+
/**
|
|
20
|
+
* Called when the user starts dragging the handle.
|
|
21
|
+
*/
|
|
22
|
+
onResizeStart: (event: ReactMouseEvent) => void;
|
|
23
|
+
/**
|
|
24
|
+
* Called when the user presses arrow keys on the focused handle.
|
|
25
|
+
*/
|
|
26
|
+
onKeyboardResize: (event: ReactKeyboardEvent) => void;
|
|
27
|
+
/**
|
|
28
|
+
* Accessible label for the separator.
|
|
29
|
+
*/
|
|
30
|
+
ariaLabel: string;
|
|
31
|
+
/**
|
|
32
|
+
* Optional additional classes for the handle container.
|
|
33
|
+
*/
|
|
34
|
+
className?: string;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Draggable separator handle for resizable panels.
|
|
38
|
+
*/
|
|
39
|
+
export declare function ResizeHandle({ orientation, value, min, max, onResizeStart, onKeyboardResize, ariaLabel, className }: Props): JSX.Element;
|
|
40
|
+
export {};
|
|
41
|
+
//# sourceMappingURL=ResizeHandle.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ResizeHandle.d.ts","sourceRoot":"","sources":["../../../src/components/Resizable/ResizeHandle.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,GAAG,EACH,aAAa,IAAI,kBAAkB,EACnC,UAAU,IAAI,eAAe,EAC9B,MAAM,OAAO,CAAC;AAEf,UAAU,KAAK;IACb;;OAEG;IACH,WAAW,EAAE,YAAY,GAAG,UAAU,CAAC;IAEvC;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;IAEZ;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;IAEZ;;OAEG;IACH,aAAa,EAAE,CAAC,KAAK,EAAE,eAAe,KAAK,IAAI,CAAC;IAEhD;;OAEG;IACH,gBAAgB,EAAE,CAAC,KAAK,EAAE,kBAAkB,KAAK,IAAI,CAAC;IAEtD;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,EAC3B,WAAW,EACX,KAAK,EACL,GAAG,EACH,GAAG,EACH,aAAa,EACb,gBAAgB,EAChB,SAAS,EACT,SAAS,EACV,EAAE,KAAK,GAAG,GAAG,CAAC,OAAO,CAiCrB"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { jsx as _jsx } from "@harborclient/sdk/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* Draggable separator handle for resizable panels.
|
|
4
|
+
*/
|
|
5
|
+
export function ResizeHandle({ orientation, value, min, max, onResizeStart, onKeyboardResize, ariaLabel, className }) {
|
|
6
|
+
const isHorizontal = orientation === 'horizontal';
|
|
7
|
+
const containerClassName = [
|
|
8
|
+
'm-0 flex shrink-0 items-center justify-center bg-control p-0 font-inherit text-inherit appearance-none hover:bg-selection/60 app-no-drag',
|
|
9
|
+
isHorizontal
|
|
10
|
+
? 'h-1.5 w-full cursor-row-resize border-b border-separator'
|
|
11
|
+
: 'h-full w-1.5 cursor-col-resize border-r border-separator',
|
|
12
|
+
className
|
|
13
|
+
]
|
|
14
|
+
.filter(Boolean)
|
|
15
|
+
.join(' ');
|
|
16
|
+
return (_jsx("button", { type: "button", className: containerClassName, onMouseDown: onResizeStart, onKeyDown: onKeyboardResize, role: "separator", "aria-orientation": orientation, "aria-label": ariaLabel, "aria-valuenow": Math.round(value), "aria-valuemin": min, "aria-valuemax": Math.round(max), children: _jsx("div", { className: isHorizontal ? 'h-0.5 w-8 rounded-full bg-muted/50' : 'h-8 w-0.5 rounded-full bg-muted/50', "aria-hidden": true }) }));
|
|
17
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { RefObject } from 'react';
|
|
2
|
+
/** Default slide-up footer panel height in pixels. */
|
|
3
|
+
export declare const DEFAULT_HEIGHT = 280;
|
|
4
|
+
/** Minimum slide-up footer panel height in pixels. */
|
|
5
|
+
export declare const MIN_HEIGHT = 120;
|
|
6
|
+
/**
|
|
7
|
+
* Computes the maximum height for a footer slide-up panel from the main content area.
|
|
8
|
+
*
|
|
9
|
+
* Walks from the panel container up to the app shell and measures the flex row
|
|
10
|
+
* above the footer so panels cannot grow past the usable workspace.
|
|
11
|
+
*
|
|
12
|
+
* @param containerRef - Ref attached to the panel root element.
|
|
13
|
+
* @returns Maximum panel height in pixels.
|
|
14
|
+
*/
|
|
15
|
+
export declare function getFooterPanelMaxSize(containerRef: RefObject<HTMLDivElement | null>): number;
|
|
16
|
+
/**
|
|
17
|
+
* Builds slide-up footer panel class names for open/closed transform animation.
|
|
18
|
+
*
|
|
19
|
+
* @param open - Whether the panel is currently visible.
|
|
20
|
+
* @returns Tailwind class string for the panel container.
|
|
21
|
+
*/
|
|
22
|
+
export declare function footerPanelClassName(open: boolean): string;
|
|
23
|
+
/** Shared close-button styling for footer slide-up panels. */
|
|
24
|
+
export declare const footerPanelCloseButtonClassName = "inline-flex h-6 w-6 shrink-0 cursor-pointer items-center justify-center rounded-md border-none bg-transparent text-[14px] text-muted hover:bg-selection hover:text-text app-no-drag";
|
|
25
|
+
//# sourceMappingURL=footerPanelUtils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"footerPanelUtils.d.ts","sourceRoot":"","sources":["../../../src/components/Resizable/footerPanelUtils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,sDAAsD;AACtD,eAAO,MAAM,cAAc,MAAM,CAAC;AAElC,sDAAsD;AACtD,eAAO,MAAM,UAAU,MAAM,CAAC;AAiC9B;;;;;;;;GAQG;AACH,wBAAgB,qBAAqB,CAAC,YAAY,EAAE,SAAS,CAAC,cAAc,GAAG,IAAI,CAAC,GAAG,MAAM,CAI5F;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,OAAO,GAAG,MAAM,CAM1D;AAED,8DAA8D;AAC9D,eAAO,MAAM,+BAA+B,wLAC2I,CAAC"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/** Default slide-up footer panel height in pixels. */
|
|
2
|
+
export const DEFAULT_HEIGHT = 280;
|
|
3
|
+
/** Minimum slide-up footer panel height in pixels. */
|
|
4
|
+
export const MIN_HEIGHT = 120;
|
|
5
|
+
/**
|
|
6
|
+
* Resolves the main workspace row above the footer for max-height measurement.
|
|
7
|
+
*
|
|
8
|
+
* Prefers the flex row wrapping `#main-content` so measurement stays correct
|
|
9
|
+
* when the app shell includes skip links or other elements before the workspace.
|
|
10
|
+
*
|
|
11
|
+
* @param containerRef - Ref attached to the panel root element.
|
|
12
|
+
* @returns Workspace row element, if found.
|
|
13
|
+
*/
|
|
14
|
+
function resolveFooterPanelContentArea(containerRef) {
|
|
15
|
+
const mainContentParent = document.getElementById('main-content')?.parentElement;
|
|
16
|
+
if (mainContentParent instanceof HTMLElement) {
|
|
17
|
+
return mainContentParent;
|
|
18
|
+
}
|
|
19
|
+
const shell = containerRef.current?.parentElement?.parentElement;
|
|
20
|
+
if (!(shell instanceof HTMLElement)) {
|
|
21
|
+
return undefined;
|
|
22
|
+
}
|
|
23
|
+
for (const child of shell.children) {
|
|
24
|
+
if (child instanceof HTMLElement && child.classList.contains('min-h-0')) {
|
|
25
|
+
return child;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
return undefined;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Computes the maximum height for a footer slide-up panel from the main content area.
|
|
32
|
+
*
|
|
33
|
+
* Walks from the panel container up to the app shell and measures the flex row
|
|
34
|
+
* above the footer so panels cannot grow past the usable workspace.
|
|
35
|
+
*
|
|
36
|
+
* @param containerRef - Ref attached to the panel root element.
|
|
37
|
+
* @returns Maximum panel height in pixels.
|
|
38
|
+
*/
|
|
39
|
+
export function getFooterPanelMaxSize(containerRef) {
|
|
40
|
+
const contentArea = resolveFooterPanelContentArea(containerRef);
|
|
41
|
+
if (!contentArea)
|
|
42
|
+
return window.innerHeight * 0.8;
|
|
43
|
+
return Math.max(MIN_HEIGHT, contentArea.clientHeight - 40);
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Builds slide-up footer panel class names for open/closed transform animation.
|
|
47
|
+
*
|
|
48
|
+
* @param open - Whether the panel is currently visible.
|
|
49
|
+
* @returns Tailwind class string for the panel container.
|
|
50
|
+
*/
|
|
51
|
+
export function footerPanelClassName(open) {
|
|
52
|
+
return [
|
|
53
|
+
'absolute inset-x-0 bottom-full z-40 flex flex-col border-t border-separator bg-surface',
|
|
54
|
+
'shadow-[0_-4px_16px_rgba(0,0,0,0.12)] transition-transform duration-300 ease-out app-no-drag',
|
|
55
|
+
open ? 'translate-y-0' : 'translate-y-full pointer-events-none'
|
|
56
|
+
].join(' ');
|
|
57
|
+
}
|
|
58
|
+
/** Shared close-button styling for footer slide-up panels. */
|
|
59
|
+
export const footerPanelCloseButtonClassName = 'inline-flex h-6 w-6 shrink-0 cursor-pointer items-center justify-center rounded-md border-none bg-transparent text-[14px] text-muted hover:bg-selection hover:text-text app-no-drag';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Resizable/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,KAAK,mBAAmB,EAAE,KAAK,kBAAkB,EAAE,MAAM,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { KeyboardEvent as ReactKeyboardEvent, MouseEvent as ReactMouseEvent } from 'react';
|
|
2
|
+
type Axis = 'x' | 'y';
|
|
3
|
+
export interface UseResizableOptions {
|
|
4
|
+
/**
|
|
5
|
+
* Pointer axis used to compute drag delta.
|
|
6
|
+
*/
|
|
7
|
+
axis: Axis;
|
|
8
|
+
/**
|
|
9
|
+
* Sign applied to pointer delta along the axis.
|
|
10
|
+
*/
|
|
11
|
+
direction: 1 | -1;
|
|
12
|
+
/**
|
|
13
|
+
* Initial size when nothing is persisted.
|
|
14
|
+
*/
|
|
15
|
+
defaultSize: number;
|
|
16
|
+
/**
|
|
17
|
+
* Minimum allowed size in pixels.
|
|
18
|
+
*/
|
|
19
|
+
minSize: number;
|
|
20
|
+
/**
|
|
21
|
+
* Optional dynamic maximum size in pixels.
|
|
22
|
+
*/
|
|
23
|
+
getMaxSize?: () => number;
|
|
24
|
+
/**
|
|
25
|
+
* When set, size is restored from and persisted to localStorage.
|
|
26
|
+
*/
|
|
27
|
+
storageKey?: string;
|
|
28
|
+
}
|
|
29
|
+
export interface UseResizableResult {
|
|
30
|
+
size: number;
|
|
31
|
+
minSize: number;
|
|
32
|
+
maxSize: number;
|
|
33
|
+
setSize: (size: number) => void;
|
|
34
|
+
onResizeStart: (event: ReactMouseEvent) => void;
|
|
35
|
+
onKeyboardResize: (event: ReactKeyboardEvent) => void;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Tracks resizable panel size with pointer drag and optional persistence.
|
|
39
|
+
*/
|
|
40
|
+
export declare function useResizable({ axis, direction, defaultSize, minSize, getMaxSize, storageKey }: UseResizableOptions): UseResizableResult;
|
|
41
|
+
export {};
|
|
42
|
+
//# sourceMappingURL=useResizable.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useResizable.d.ts","sourceRoot":"","sources":["../../../src/components/Resizable/useResizable.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,IAAI,kBAAkB,EAAE,UAAU,IAAI,eAAe,EAAE,MAAM,OAAO,CAAC;AAEhG,KAAK,IAAI,GAAG,GAAG,GAAG,GAAG,CAAC;AAEtB,MAAM,WAAW,mBAAmB;IAClC;;OAEG;IACH,IAAI,EAAE,IAAI,CAAC;IAEX;;OAEG;IACH,SAAS,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAElB;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,MAAM,CAAC;IAE1B;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAChC,aAAa,EAAE,CAAC,KAAK,EAAE,eAAe,KAAK,IAAI,CAAC;IAChD,gBAAgB,EAAE,CAAC,KAAK,EAAE,kBAAkB,KAAK,IAAI,CAAC;CACvD;AAoCD;;GAEG;AACH,wBAAgB,YAAY,CAAC,EAC3B,IAAI,EACJ,SAAS,EACT,WAAW,EACX,OAAO,EACP,UAAU,EACV,UAAU,EACX,EAAE,mBAAmB,GAAG,kBAAkB,CAgI1C"}
|