@harborclient/sdk 0.4.6 → 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 +100 -0
- 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 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/StatusMessage/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAE5C,UAAU,KAAK;IACb;;OAEG;IACH,QAAQ,EAAE,SAAS,CAAC;IAEpB;;OAEG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IAEf;;OAEG;IACH,EAAE,CAAC,EAAE,MAAM,CAAC;IAEZ;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,EAAE,QAAQ,EAAE,IAAW,EAAE,EAAE,EAAE,SAAS,EAAE,EAAE,KAAK,GAAG,GAAG,CAAC,OAAO,CAc1F"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { jsx as _jsx } from "@harborclient/sdk/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* Muted helper or progress text with optional polite live-region semantics.
|
|
4
|
+
*
|
|
5
|
+
* @param children - Status message content.
|
|
6
|
+
* @param live - Whether to set `role="status"` and `aria-live="polite"`.
|
|
7
|
+
* @param className - Extra classes appended after the preset.
|
|
8
|
+
*/
|
|
9
|
+
export function StatusMessage({ children, live = true, id, className }) {
|
|
10
|
+
const base = 'text-[14px] text-muted';
|
|
11
|
+
const classes = className ? `${base} ${className}` : base;
|
|
12
|
+
return (_jsx("p", { id: id, className: classes, role: live ? 'status' : undefined, "aria-live": live ? 'polite' : undefined, children: children }));
|
|
13
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { JSX } from 'react';
|
|
2
|
+
interface Props {
|
|
3
|
+
/**
|
|
4
|
+
* Accessible name for the close control, typically including the tab title.
|
|
5
|
+
*/
|
|
6
|
+
ariaLabel: string;
|
|
7
|
+
/**
|
|
8
|
+
* Called when the user activates the close button.
|
|
9
|
+
*/
|
|
10
|
+
onClick: (event: React.MouseEvent<HTMLButtonElement>) => void;
|
|
11
|
+
/**
|
|
12
|
+
* Optional tooltip label; defaults to "Close tab".
|
|
13
|
+
*/
|
|
14
|
+
title?: string;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Hover-reveal close control for document-style tabs in the request editor and AI chat.
|
|
18
|
+
*
|
|
19
|
+
* @param ariaLabel - Accessible name describing which tab closes.
|
|
20
|
+
* @param onClick - Click handler; callers should stop propagation when needed.
|
|
21
|
+
* @param title - Optional native tooltip text.
|
|
22
|
+
*/
|
|
23
|
+
export declare function TabCloseButton({ ariaLabel, onClick, title }: 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/TabCloseButton/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAIjC,UAAU,KAAK;IACb;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,OAAO,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,iBAAiB,CAAC,KAAK,IAAI,CAAC;IAE9D;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,EAAE,SAAS,EAAE,OAAO,EAAE,KAAmB,EAAE,EAAE,KAAK,GAAG,GAAG,CAAC,OAAO,CAY9F"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { jsx as _jsx } from "@harborclient/sdk/jsx-runtime";
|
|
2
|
+
import { faXmark } from '@fortawesome/free-solid-svg-icons';
|
|
3
|
+
import { FaIcon } from '../FaIcon/index.js';
|
|
4
|
+
/**
|
|
5
|
+
* Hover-reveal close control for document-style tabs in the request editor and AI chat.
|
|
6
|
+
*
|
|
7
|
+
* @param ariaLabel - Accessible name describing which tab closes.
|
|
8
|
+
* @param onClick - Click handler; callers should stop propagation when needed.
|
|
9
|
+
* @param title - Optional native tooltip text.
|
|
10
|
+
*/
|
|
11
|
+
export function TabCloseButton({ ariaLabel, onClick, title = 'Close tab' }) {
|
|
12
|
+
return (_jsx("button", { type: "button", className: "inline-flex aspect-square shrink-0 cursor-pointer items-center justify-center self-stretch rounded-md border-none bg-transparent text-[14px] text-muted opacity-0 transition-opacity group-hover:opacity-100 group-focus-within:opacity-100 focus:opacity-100 focus-visible:opacity-100 hover:bg-selection hover:text-text app-no-drag", title: title, "aria-label": ariaLabel, onClick: onClick, children: _jsx(FaIcon, { icon: faXmark, className: "h-3.5 w-3.5" }) }));
|
|
13
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import type { JSX, KeyboardEvent } from 'react';
|
|
2
|
+
import type { Variable } from '../../types.js';
|
|
3
|
+
export interface Props {
|
|
4
|
+
/**
|
|
5
|
+
* Current input value.
|
|
6
|
+
*/
|
|
7
|
+
value: string;
|
|
8
|
+
/**
|
|
9
|
+
* Called when the value changes.
|
|
10
|
+
*
|
|
11
|
+
* @param value - Updated input value.
|
|
12
|
+
*/
|
|
13
|
+
onChange: (value: string) => void;
|
|
14
|
+
/**
|
|
15
|
+
* Collection-scoped variables for highlighting and tooltips.
|
|
16
|
+
*/
|
|
17
|
+
variables: Variable[];
|
|
18
|
+
/**
|
|
19
|
+
* Placeholder shown when value is empty.
|
|
20
|
+
*/
|
|
21
|
+
placeholder?: string;
|
|
22
|
+
/**
|
|
23
|
+
* Optional keyboard handler (e.g. Enter to submit).
|
|
24
|
+
*/
|
|
25
|
+
onKeyDown?: (e: KeyboardEvent<HTMLInputElement>) => void;
|
|
26
|
+
/**
|
|
27
|
+
* Additional classes applied to the input element.
|
|
28
|
+
*/
|
|
29
|
+
className?: string;
|
|
30
|
+
/**
|
|
31
|
+
* Classes applied to the outer wrapper (e.g. field border and tint for table cells).
|
|
32
|
+
*/
|
|
33
|
+
wrapperClassName?: string;
|
|
34
|
+
/**
|
|
35
|
+
* Opens collection settings to edit the hovered variable.
|
|
36
|
+
*/
|
|
37
|
+
onEditVariable?: () => void;
|
|
38
|
+
/**
|
|
39
|
+
* DOM id forwarded to the underlying input for label association.
|
|
40
|
+
*/
|
|
41
|
+
id?: string;
|
|
42
|
+
/**
|
|
43
|
+
* Accessible name when no visible label is associated via `htmlFor`.
|
|
44
|
+
*/
|
|
45
|
+
'aria-label'?: string;
|
|
46
|
+
/**
|
|
47
|
+
* Id of the element that labels this input when using `aria-labelledby`.
|
|
48
|
+
*/
|
|
49
|
+
'aria-labelledby'?: string;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Text input that highlights {{variable}} tokens and shows resolved values on hover.
|
|
53
|
+
*
|
|
54
|
+
* Token highlight color (`text-[#32D2E2]`) and the tooltip `app-no-drag` class rely on
|
|
55
|
+
* host styling in HarborClient `styles.css`.
|
|
56
|
+
*/
|
|
57
|
+
export declare function VariableInput({ value, onChange, variables, placeholder, onKeyDown, className, wrapperClassName, onEditVariable, id, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy }: Props): JSX.Element;
|
|
58
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/VariableInput/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,GAAG,EAAE,aAAa,EAAc,MAAM,OAAO,CAAC;AAC5D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAgB/C,MAAM,WAAW,KAAK;IACpB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;;;OAIG;IACH,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAElC;;OAEG;IACH,SAAS,EAAE,QAAQ,EAAE,CAAC;IAEtB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;OAEG;IACH,SAAS,CAAC,EAAE,CAAC,CAAC,EAAE,aAAa,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAC;IAEzD;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAE1B;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,IAAI,CAAC;IAE5B;;OAEG;IACH,EAAE,CAAC,EAAE,MAAM,CAAC;IAEZ;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;OAEG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,EAC5B,KAAK,EACL,QAAQ,EACR,SAAS,EACT,WAAW,EACX,SAAS,EACT,SAAc,EACd,gBAAgB,EAChB,cAAc,EACd,EAAE,EACF,YAAY,EAAE,SAAS,EACvB,iBAAiB,EAAE,cAAc,EAClC,EAAE,KAAK,GAAG,GAAG,CAAC,OAAO,CAiKrB"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "@harborclient/sdk/jsx-runtime";
|
|
2
|
+
import { useEffect, useMemo, useRef, useState } from '@harborclient/sdk/react';
|
|
3
|
+
import { getDynamicVariableDescription, resolveVariable, tokenizeVariables } from '../../variables/index.js';
|
|
4
|
+
import { Input } from '../forms/index.js';
|
|
5
|
+
/**
|
|
6
|
+
* Text input that highlights {{variable}} tokens and shows resolved values on hover.
|
|
7
|
+
*
|
|
8
|
+
* Token highlight color (`text-[#32D2E2]`) and the tooltip `app-no-drag` class rely on
|
|
9
|
+
* host styling in HarborClient `styles.css`.
|
|
10
|
+
*/
|
|
11
|
+
export function VariableInput({ value, onChange, variables, placeholder, onKeyDown, className = '', wrapperClassName, onEditVariable, id, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy }) {
|
|
12
|
+
const inputRef = useRef(null);
|
|
13
|
+
const backdropRef = useRef(null);
|
|
14
|
+
const spanRefs = useRef(new Map());
|
|
15
|
+
const hideTimer = useRef(null);
|
|
16
|
+
const [tooltip, setTooltip] = useState(null);
|
|
17
|
+
/**
|
|
18
|
+
* Splits the input value into plain text and {{variable}} token spans for highlighting.
|
|
19
|
+
*/
|
|
20
|
+
const tokens = useMemo(() => tokenizeVariables(value), [value]);
|
|
21
|
+
/**
|
|
22
|
+
* Clears any pending tooltip hide timer.
|
|
23
|
+
*/
|
|
24
|
+
const cancelHide = () => {
|
|
25
|
+
if (hideTimer.current != null) {
|
|
26
|
+
window.clearTimeout(hideTimer.current);
|
|
27
|
+
hideTimer.current = null;
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* Hides the tooltip after a short grace period so the pointer can reach it.
|
|
32
|
+
*/
|
|
33
|
+
const scheduleHide = () => {
|
|
34
|
+
cancelHide();
|
|
35
|
+
hideTimer.current = window.setTimeout(() => setTooltip(null), 120);
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* Clears any pending tooltip hide timer when the component unmounts.
|
|
39
|
+
*/
|
|
40
|
+
useEffect(() => () => cancelHide(), []);
|
|
41
|
+
/**
|
|
42
|
+
* Keeps the colored backdrop aligned with horizontal scroll in the input.
|
|
43
|
+
*/
|
|
44
|
+
const syncScroll = () => {
|
|
45
|
+
const input = inputRef.current;
|
|
46
|
+
const backdrop = backdropRef.current;
|
|
47
|
+
if (input && backdrop) {
|
|
48
|
+
backdrop.scrollLeft = input.scrollLeft;
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
/**
|
|
52
|
+
* Shows a tooltip when the pointer is over a variable token span.
|
|
53
|
+
*
|
|
54
|
+
* @param e - Mouse move event from the input.
|
|
55
|
+
*/
|
|
56
|
+
const handleMouseMove = (e) => {
|
|
57
|
+
cancelHide();
|
|
58
|
+
for (const [index, token] of tokens.entries()) {
|
|
59
|
+
if (!token.key)
|
|
60
|
+
continue;
|
|
61
|
+
const span = spanRefs.current.get(index);
|
|
62
|
+
if (!span)
|
|
63
|
+
continue;
|
|
64
|
+
const rect = span.getBoundingClientRect();
|
|
65
|
+
if (e.clientX >= rect.left &&
|
|
66
|
+
e.clientX <= rect.right &&
|
|
67
|
+
e.clientY >= rect.top &&
|
|
68
|
+
e.clientY <= rect.bottom) {
|
|
69
|
+
setTooltip({
|
|
70
|
+
key: token.key,
|
|
71
|
+
value: resolveVariable(token.key, variables),
|
|
72
|
+
dynamicDescription: getDynamicVariableDescription(token.key),
|
|
73
|
+
top: rect.top,
|
|
74
|
+
left: rect.left + rect.width / 2
|
|
75
|
+
});
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
setTooltip(null);
|
|
80
|
+
};
|
|
81
|
+
return (_jsxs("div", { className: wrapperClassName ? `relative min-w-0 ${wrapperClassName}` : 'relative min-w-0 flex-1', children: [_jsx("div", { ref: backdropRef, "aria-hidden": true, className: "pointer-events-none absolute inset-0 overflow-hidden whitespace-nowrap px-2 py-1.5 text-[14px] text-inherit", children: value ? (tokens.map((token, index) => token.key ? (_jsx("span", { ref: (el) => {
|
|
82
|
+
if (el)
|
|
83
|
+
spanRefs.current.set(index, el);
|
|
84
|
+
else
|
|
85
|
+
spanRefs.current.delete(index);
|
|
86
|
+
}, className: "text-[#32D2E2]", children: token.text }, index)) : (_jsx("span", { children: token.text }, index)))) : (_jsx("span", { className: "text-muted", children: placeholder })) }), _jsx(Input, { ref: inputRef, id: id, variant: "plain", "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, className: `relative w-full min-w-0 border-none bg-transparent px-2 py-1.5 text-[14px] text-transparent caret-text focus-visible:shadow-none ${className}`, type: "text", placeholder: placeholder, value: value, onChange: (e) => onChange(e.target.value), onKeyDown: onKeyDown, onScroll: syncScroll, onMouseMove: handleMouseMove, onMouseLeave: scheduleHide }), tooltip && (_jsxs("div", { className: "pointer-events-auto fixed z-50 flex max-w-sm -translate-x-1/2 -translate-y-full flex-col gap-1.5 rounded-md border border-separator bg-surface px-3 py-2 text-[14px] text-text shadow-md", style: { top: tooltip.top - 4, left: tooltip.left }, onMouseEnter: cancelHide, onMouseLeave: () => setTooltip(null), children: [tooltip.value !== undefined ? (tooltip.value) : tooltip.dynamicDescription ? (_jsxs("span", { className: "text-muted", children: ["Dynamic: ", tooltip.dynamicDescription] })) : (_jsx("span", { className: "text-muted", children: "Not defined" })), onEditVariable && (_jsx("button", { type: "button", className: "self-start text-[14px] text-accent hover:underline app-no-drag", onClick: () => {
|
|
87
|
+
onEditVariable();
|
|
88
|
+
setTooltip(null);
|
|
89
|
+
}, children: "Edit value" }))] }))] }));
|
|
90
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { JSX } from 'react';
|
|
2
|
+
import type { Variable } from '../../types.js';
|
|
3
|
+
interface Props {
|
|
4
|
+
/**
|
|
5
|
+
* Variable rows to display.
|
|
6
|
+
*/
|
|
7
|
+
variables: Variable[];
|
|
8
|
+
/**
|
|
9
|
+
* Called when variable rows change.
|
|
10
|
+
*/
|
|
11
|
+
onChange: (variables: Variable[]) => void;
|
|
12
|
+
/**
|
|
13
|
+
* Optional helper text above the table.
|
|
14
|
+
*/
|
|
15
|
+
description?: string;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Editable table for key/value/default/share variable rows.
|
|
19
|
+
*/
|
|
20
|
+
export declare function VariableTable({ variables, onChange, description }: Props): JSX.Element;
|
|
21
|
+
export {};
|
|
22
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/VariableTable/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAa/C,UAAU,KAAK;IACb;;OAEG;IACH,SAAS,EAAE,QAAQ,EAAE,CAAC;IAEtB;;OAEG;IACH,QAAQ,EAAE,CAAC,SAAS,EAAE,QAAQ,EAAE,KAAK,IAAI,CAAC;IAE1C;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,WAAW,EAAE,EAAE,KAAK,GAAG,GAAG,CAAC,OAAO,CAkHtF"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "@harborclient/sdk/jsx-runtime";
|
|
2
|
+
import { Button } from '../Button/index.js';
|
|
3
|
+
import { FaIcon } from '../FaIcon/index.js';
|
|
4
|
+
import { faPlus, faXmark } from '@fortawesome/free-solid-svg-icons';
|
|
5
|
+
import { Input } from '../forms/index.js';
|
|
6
|
+
/**
|
|
7
|
+
* Returns a blank variable row for new table entries.
|
|
8
|
+
*/
|
|
9
|
+
const emptyVariable = () => ({ key: '', value: '', defaultValue: '', share: false });
|
|
10
|
+
const thClass = 'pb-1 text-left text-[14px] font-medium uppercase tracking-wide text-muted';
|
|
11
|
+
/**
|
|
12
|
+
* Editable table for key/value/default/share variable rows.
|
|
13
|
+
*/
|
|
14
|
+
export function VariableTable({ variables, onChange, description }) {
|
|
15
|
+
/**
|
|
16
|
+
* Updates a single variable row by index.
|
|
17
|
+
*
|
|
18
|
+
* @param index - Row index to update.
|
|
19
|
+
* @param patch - Partial fields to merge into the row.
|
|
20
|
+
*/
|
|
21
|
+
const updateVariable = (index, patch) => {
|
|
22
|
+
onChange(variables.map((row, i) => (i === index ? { ...row, ...patch } : row)));
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* Appends a blank variable row.
|
|
26
|
+
*/
|
|
27
|
+
const addVariable = () => {
|
|
28
|
+
onChange([...variables, emptyVariable()]);
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* Removes a variable row, keeping at least one empty row.
|
|
32
|
+
*
|
|
33
|
+
* @param index - Row index to remove.
|
|
34
|
+
*/
|
|
35
|
+
const removeVariable = (index) => {
|
|
36
|
+
if (variables.length === 1) {
|
|
37
|
+
onChange([emptyVariable()]);
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
onChange(variables.filter((_, i) => i !== index));
|
|
41
|
+
};
|
|
42
|
+
return (_jsxs("div", { children: [description && _jsx("p", { className: "mb-3 text-[14px] text-muted", children: description }), _jsxs("div", { className: "flex flex-col gap-1.5", children: [_jsxs("table", { className: "w-full border-separate border-spacing-x-1.5 border-spacing-y-1.5", children: [_jsx("thead", { children: _jsxs("tr", { children: [_jsx("th", { className: thClass, children: "Key" }), _jsx("th", { className: thClass, children: "Value" }), _jsx("th", { className: thClass, children: "Default" }), _jsx("th", { className: `${thClass} w-14 text-center`, children: "Share" }), _jsx("th", { className: `${thClass} w-7 p-0 text-center` })] }) }), _jsx("tbody", { children: variables.map((variable, index) => (_jsxs("tr", { className: "group", children: [_jsx("td", { children: _jsx(Input, { type: "text", className: "w-full", value: variable.key, placeholder: "variable", "aria-label": `Key, row ${index + 1}`, onChange: (e) => updateVariable(index, { key: e.target.value }) }) }), _jsx("td", { children: _jsx(Input, { type: "text", className: "w-full", value: variable.value, placeholder: "value", "aria-label": `Value, row ${index + 1}`, onChange: (e) => updateVariable(index, { value: e.target.value }) }) }), _jsx("td", { children: _jsx(Input, { type: "text", className: "w-full", value: variable.defaultValue, placeholder: "default", "aria-label": `Default, row ${index + 1}`, onChange: (e) => updateVariable(index, { defaultValue: e.target.value }) }) }), _jsx("td", { className: "w-14 text-center", children: _jsx(Input, { type: "checkbox", checked: variable.share, onChange: (e) => updateVariable(index, { share: e.target.checked }), "aria-label": `Include value in export, row ${index + 1}`, title: "Include value in export" }) }), _jsx("td", { className: "w-7 p-0 text-center", children: _jsx(Button, { type: "button", variant: "iconDanger", onClick: () => removeVariable(index), title: "Remove", children: _jsx(FaIcon, { icon: faXmark, className: "h-3.5 w-3.5" }) }) })] }, index))) })] }), _jsxs(Button, { type: "button", variant: "toolbar", className: "inline-flex items-center gap-1 self-start", onClick: addVariable, children: [_jsx(FaIcon, { icon: faPlus, className: "h-3 w-3" }), "Add variable"] })] })] }));
|
|
43
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared macOS-style Tailwind class strings for SDK UI components.
|
|
3
|
+
*/
|
|
4
|
+
export declare const segmentGroup = "inline-flex rounded-md p-0.5 shadow-[inset_0_0.5px_1px_rgba(0,0,0,0.06)] app-no-drag";
|
|
5
|
+
/**
|
|
6
|
+
* Tailwind classes for a segmented control button.
|
|
7
|
+
*
|
|
8
|
+
* @param active - Whether this segment is selected.
|
|
9
|
+
*/
|
|
10
|
+
export declare function segment(active: boolean): string;
|
|
11
|
+
//# sourceMappingURL=classes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"classes.d.ts","sourceRoot":"","sources":["../../src/components/classes.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,eAAO,MAAM,YAAY,yFAC+D,CAAC;AAEzF;;;;GAIG;AACH,wBAAgB,OAAO,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,CAI/C"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared macOS-style Tailwind class strings for SDK UI components.
|
|
3
|
+
*/
|
|
4
|
+
export const segmentGroup = 'inline-flex rounded-md p-0.5 shadow-[inset_0_0.5px_1px_rgba(0,0,0,0.06)] app-no-drag';
|
|
5
|
+
/**
|
|
6
|
+
* Tailwind classes for a segmented control button.
|
|
7
|
+
*
|
|
8
|
+
* @param active - Whether this segment is selected.
|
|
9
|
+
*/
|
|
10
|
+
export function segment(active) {
|
|
11
|
+
return active
|
|
12
|
+
? 'cursor-pointer rounded-[5px] border-none bg-control px-3 py-1 text-[15px] text-text shadow-sm app-no-drag'
|
|
13
|
+
: 'cursor-pointer rounded-[5px] border-none bg-transparent px-3 py-1 text-[15px] text-muted hover:text-text app-no-drag';
|
|
14
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { InputHTMLAttributes, JSX, Ref } from 'react';
|
|
2
|
+
import { type FieldVariant } from './classes.js';
|
|
3
|
+
interface Props extends InputHTMLAttributes<HTMLInputElement> {
|
|
4
|
+
/**
|
|
5
|
+
* Base field styling preset. Checkbox and radio inputs default to `plain`.
|
|
6
|
+
*/
|
|
7
|
+
variant?: FieldVariant;
|
|
8
|
+
/**
|
|
9
|
+
* Additional Tailwind classes merged after the variant preset.
|
|
10
|
+
*/
|
|
11
|
+
className?: string;
|
|
12
|
+
/**
|
|
13
|
+
* Ref forwarded to the underlying native input.
|
|
14
|
+
*/
|
|
15
|
+
ref?: Ref<HTMLInputElement>;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* macOS-style text and choice input with shared field styling presets.
|
|
19
|
+
*/
|
|
20
|
+
export declare function Input({ ref, variant, type, className, ...props }: Props): JSX.Element;
|
|
21
|
+
export {};
|
|
22
|
+
//# sourceMappingURL=Input.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Input.d.ts","sourceRoot":"","sources":["../../../src/components/forms/Input.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAC3D,OAAO,EAAqB,KAAK,YAAY,EAAE,MAAM,cAAc,CAAC;AAEpE,UAAU,KAAM,SAAQ,mBAAmB,CAAC,gBAAgB,CAAC;IAC3D;;OAEG;IACH,OAAO,CAAC,EAAE,YAAY,CAAC;IAEvB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,GAAG,CAAC,EAAE,GAAG,CAAC,gBAAgB,CAAC,CAAC;CAC7B;AAED;;GAEG;AACH,wBAAgB,KAAK,CAAC,EAAE,GAAG,EAAE,OAAmB,EAAE,IAAI,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,GAAG,GAAG,CAAC,OAAO,CAWjG"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx as _jsx } from "@harborclient/sdk/jsx-runtime";
|
|
2
|
+
import { mergeFieldClasses } from './classes.js';
|
|
3
|
+
/**
|
|
4
|
+
* macOS-style text and choice input with shared field styling presets.
|
|
5
|
+
*/
|
|
6
|
+
export function Input({ ref, variant = 'control', type, className, ...props }) {
|
|
7
|
+
const resolvedVariant = type === 'checkbox' || type === 'radio' ? 'plain' : variant;
|
|
8
|
+
return (_jsx("input", { ref: ref, type: type, className: mergeFieldClasses(resolvedVariant, className), ...props }));
|
|
9
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { JSX, Ref, SelectHTMLAttributes } from 'react';
|
|
2
|
+
import { type FieldVariant } from './classes.js';
|
|
3
|
+
interface Props extends SelectHTMLAttributes<HTMLSelectElement> {
|
|
4
|
+
/**
|
|
5
|
+
* Base field styling preset.
|
|
6
|
+
*/
|
|
7
|
+
variant?: FieldVariant;
|
|
8
|
+
/**
|
|
9
|
+
* Additional Tailwind classes merged after the variant preset.
|
|
10
|
+
*/
|
|
11
|
+
className?: string;
|
|
12
|
+
/**
|
|
13
|
+
* Ref forwarded to the underlying native select.
|
|
14
|
+
*/
|
|
15
|
+
ref?: Ref<HTMLSelectElement>;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* macOS-style select menu with shared field styling presets.
|
|
19
|
+
*
|
|
20
|
+
* Children should be plain `<option>` elements.
|
|
21
|
+
*/
|
|
22
|
+
export declare function Select({ ref, variant, className, children, ...props }: Props): JSX.Element;
|
|
23
|
+
export {};
|
|
24
|
+
//# sourceMappingURL=Select.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Select.d.ts","sourceRoot":"","sources":["../../../src/components/forms/Select.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,oBAAoB,EAAE,MAAM,OAAO,CAAC;AAC5D,OAAO,EAAqB,KAAK,YAAY,EAAE,MAAM,cAAc,CAAC;AAEpE,UAAU,KAAM,SAAQ,oBAAoB,CAAC,iBAAiB,CAAC;IAC7D;;OAEG;IACH,OAAO,CAAC,EAAE,YAAY,CAAC;IAEvB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,GAAG,CAAC,EAAE,GAAG,CAAC,iBAAiB,CAAC,CAAC;CAC9B;AAED;;;;GAIG;AACH,wBAAgB,MAAM,CAAC,EACrB,GAAG,EACH,OAAmB,EACnB,SAAS,EACT,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,KAAK,GAAG,GAAG,CAAC,OAAO,CAMrB"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { jsx as _jsx } from "@harborclient/sdk/jsx-runtime";
|
|
2
|
+
import { mergeFieldClasses } from './classes.js';
|
|
3
|
+
/**
|
|
4
|
+
* macOS-style select menu with shared field styling presets.
|
|
5
|
+
*
|
|
6
|
+
* Children should be plain `<option>` elements.
|
|
7
|
+
*/
|
|
8
|
+
export function Select({ ref, variant = 'control', className, children, ...props }) {
|
|
9
|
+
return (_jsx("select", { ref: ref, className: mergeFieldClasses(variant, className), ...props, children: children }));
|
|
10
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { JSX, Ref, TextareaHTMLAttributes } from 'react';
|
|
2
|
+
import { type FieldVariant } from './classes.js';
|
|
3
|
+
interface Props extends TextareaHTMLAttributes<HTMLTextAreaElement> {
|
|
4
|
+
/**
|
|
5
|
+
* Base field styling preset.
|
|
6
|
+
*/
|
|
7
|
+
variant?: FieldVariant;
|
|
8
|
+
/**
|
|
9
|
+
* Additional Tailwind classes merged after the variant preset.
|
|
10
|
+
*/
|
|
11
|
+
className?: string;
|
|
12
|
+
/**
|
|
13
|
+
* Ref forwarded to the underlying native textarea.
|
|
14
|
+
*/
|
|
15
|
+
ref?: Ref<HTMLTextAreaElement>;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* macOS-style multiline input with shared field styling presets.
|
|
19
|
+
*/
|
|
20
|
+
export declare function Textarea({ ref, variant, className, ...props }: Props): JSX.Element;
|
|
21
|
+
export {};
|
|
22
|
+
//# sourceMappingURL=Textarea.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Textarea.d.ts","sourceRoot":"","sources":["../../../src/components/forms/Textarea.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,sBAAsB,EAAE,MAAM,OAAO,CAAC;AAC9D,OAAO,EAAqB,KAAK,YAAY,EAAE,MAAM,cAAc,CAAC;AAEpE,UAAU,KAAM,SAAQ,sBAAsB,CAAC,mBAAmB,CAAC;IACjE;;OAEG;IACH,OAAO,CAAC,EAAE,YAAY,CAAC;IAEvB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,GAAG,CAAC,EAAE,GAAG,CAAC,mBAAmB,CAAC,CAAC;CAChC;AAED;;GAEG;AACH,wBAAgB,QAAQ,CAAC,EAAE,GAAG,EAAE,OAAmB,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,GAAG,GAAG,CAAC,OAAO,CAE9F"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { jsx as _jsx } from "@harborclient/sdk/jsx-runtime";
|
|
2
|
+
import { mergeFieldClasses } from './classes.js';
|
|
3
|
+
/**
|
|
4
|
+
* macOS-style multiline input with shared field styling presets.
|
|
5
|
+
*/
|
|
6
|
+
export function Textarea({ ref, variant = 'control', className, ...props }) {
|
|
7
|
+
return _jsx("textarea", { ref: ref, className: mergeFieldClasses(variant, className), ...props });
|
|
8
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared Tailwind class strings for macOS-style form controls.
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Visual style preset for form field wrappers.
|
|
6
|
+
*/
|
|
7
|
+
export type FieldVariant = 'control' | 'surface' | 'plain';
|
|
8
|
+
/**
|
|
9
|
+
* Border and subtle tint shell for composite inputs (e.g. VariableInput wrappers).
|
|
10
|
+
*/
|
|
11
|
+
export declare const fieldFrame = "overflow-hidden rounded-md border border-separator bg-field";
|
|
12
|
+
/** Inset control style for standard settings and editor fields. */
|
|
13
|
+
export declare const field = "rounded-md border border-separator bg-field px-2 py-1 text-[15px] text-text app-no-drag";
|
|
14
|
+
/** Surface style for modal and Team Hub form fields. */
|
|
15
|
+
export declare const surfaceField = "w-full rounded-md border border-separator bg-field px-3 py-2 text-[14px] text-text";
|
|
16
|
+
/**
|
|
17
|
+
* Merges a field variant preset with optional caller classes.
|
|
18
|
+
*
|
|
19
|
+
* @param variant - Base styling preset; `plain` applies no preset classes.
|
|
20
|
+
* @param className - Additional Tailwind classes appended after the preset.
|
|
21
|
+
* @returns Combined class string, or undefined when both inputs are empty.
|
|
22
|
+
*/
|
|
23
|
+
export declare function mergeFieldClasses(variant: FieldVariant, className?: string): string | undefined;
|
|
24
|
+
//# sourceMappingURL=classes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"classes.d.ts","sourceRoot":"","sources":["../../../src/components/forms/classes.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,CAAC;AAE3D;;GAEG;AACH,eAAO,MAAM,UAAU,gEAAgE,CAAC;AAExF,mEAAmE;AACnE,eAAO,MAAM,KAAK,4FACyE,CAAC;AAE5F,wDAAwD;AACxD,eAAO,MAAM,YAAY,uFAC6D,CAAC;AAOvF;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,YAAY,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAM/F"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared Tailwind class strings for macOS-style form controls.
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Border and subtle tint shell for composite inputs (e.g. VariableInput wrappers).
|
|
6
|
+
*/
|
|
7
|
+
export const fieldFrame = 'overflow-hidden rounded-md border border-separator bg-field';
|
|
8
|
+
/** Inset control style for standard settings and editor fields. */
|
|
9
|
+
export const field = 'rounded-md border border-separator bg-field px-2 py-1 text-[15px] text-text app-no-drag';
|
|
10
|
+
/** Surface style for modal and Team Hub form fields. */
|
|
11
|
+
export const surfaceField = 'w-full rounded-md border border-separator bg-field px-3 py-2 text-[14px] text-text';
|
|
12
|
+
const VARIANT_CLASSES = {
|
|
13
|
+
control: field,
|
|
14
|
+
surface: surfaceField
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Merges a field variant preset with optional caller classes.
|
|
18
|
+
*
|
|
19
|
+
* @param variant - Base styling preset; `plain` applies no preset classes.
|
|
20
|
+
* @param className - Additional Tailwind classes appended after the preset.
|
|
21
|
+
* @returns Combined class string, or undefined when both inputs are empty.
|
|
22
|
+
*/
|
|
23
|
+
export function mergeFieldClasses(variant, className) {
|
|
24
|
+
const base = variant === 'plain' ? '' : VARIANT_CLASSES[variant];
|
|
25
|
+
if (base && className)
|
|
26
|
+
return `${base} ${className}`;
|
|
27
|
+
if (base)
|
|
28
|
+
return base;
|
|
29
|
+
if (className)
|
|
30
|
+
return className;
|
|
31
|
+
return undefined;
|
|
32
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/forms/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,EACL,UAAU,EACV,YAAY,EACZ,iBAAiB,EACjB,KAAK,YAAY,EAClB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
export { AsyncListState, ErrorRetry, LoadingMessage } from './AsyncListState/index.js';
|
|
2
|
+
export { BusyIndicator } from './BusyIndicator/index.js';
|
|
3
|
+
export type { Props as BusyIndicatorProps } from './BusyIndicator/index.js';
|
|
4
|
+
export { BackButton } from './BackButton/index.js';
|
|
5
|
+
export { Badge } from './Badge/index.js';
|
|
6
|
+
export type { BadgeVariant } from './Badge/index.js';
|
|
7
|
+
export { Button } from './Button/index.js';
|
|
8
|
+
export { CodeEditor, CODE_EDITOR_THEME_OPTIONS } from './CodeEditor/index.js';
|
|
9
|
+
export { CodeEditorConfigProvider, useCodeEditorConfig, DEFAULT_CODE_EDITOR_CONFIG } from './CodeEditor/config.js';
|
|
10
|
+
export type { CodeEditorConfig } from './CodeEditor/config.js';
|
|
11
|
+
export type { Props as CodeEditorProps, CodeEditorLanguage } from './CodeEditor/index.js';
|
|
12
|
+
export { EmptyState } from './EmptyState/index.js';
|
|
13
|
+
export { FaIcon } from './FaIcon/index.js';
|
|
14
|
+
export { FieldError } from './FieldError/index.js';
|
|
15
|
+
export { FormDataEditor } from './FormDataEditor/index.js';
|
|
16
|
+
export type { Props as FormDataEditorProps } from './FormDataEditor/index.js';
|
|
17
|
+
export { FooterButton } from './FooterButton/index.js';
|
|
18
|
+
export { FooterIcon } from './FooterIcon/index.js';
|
|
19
|
+
export { FormGroup } from './FormGroup/index.js';
|
|
20
|
+
export { Input, Select, Textarea, field, fieldFrame, surfaceField, mergeFieldClasses } from './forms/index.js';
|
|
21
|
+
export type { FieldVariant } from './forms/classes.js';
|
|
22
|
+
export { KeyValueEditor } from './KeyValueEditor/index.js';
|
|
23
|
+
export type { Props as KeyValueEditorProps } from './KeyValueEditor/index.js';
|
|
24
|
+
export { MethodSelect } from './MethodSelect/index.js';
|
|
25
|
+
export { Modal, ModalFooter, ModalFormLayout } from './Modal/index.js';
|
|
26
|
+
export { ModalHeader } from './Modal/ModalHeader.js';
|
|
27
|
+
export { OverlayCloseButton } from './OverlayCloseButton/index.js';
|
|
28
|
+
export { OverlayPage } from './OverlayPage/index.js';
|
|
29
|
+
export { PageHeader } from './PageHeader/index.js';
|
|
30
|
+
export { PanelCloseButton } from './PanelCloseButton/index.js';
|
|
31
|
+
export { Resizable, ResizeHandle, useResizable } from './Resizable/index.js';
|
|
32
|
+
export type { UseResizableOptions, UseResizableResult } from './Resizable/useResizable.js';
|
|
33
|
+
export { DEFAULT_HEIGHT, MIN_HEIGHT, footerPanelClassName, footerPanelCloseButtonClassName, getFooterPanelMaxSize } from './Resizable/footerPanelUtils.js';
|
|
34
|
+
export { ResourceList, ResourceListRow, ResourceListPrimary, ResourceListEmptyItem } from './ResourceList/index.js';
|
|
35
|
+
export { RowActionsMenu } from './RowActionsMenu/index.js';
|
|
36
|
+
export type { MenuItem } from './RowActionsMenu/index.js';
|
|
37
|
+
export { buildReorderMenuGroup } from './rowActionsMenuHelpers.js';
|
|
38
|
+
export { SegmentedTabs, SegmentedTabsGroup, SegmentedTabPanel } from './SegmentedTabs/index.js';
|
|
39
|
+
export type { TabItem } from './SegmentedTabs/index.js';
|
|
40
|
+
export { Spinner } from './Spinner/index.js';
|
|
41
|
+
export { StatusMessage } from './StatusMessage/index.js';
|
|
42
|
+
export { TabCloseButton } from './TabCloseButton/index.js';
|
|
43
|
+
export { VariableInput } from './VariableInput/index.js';
|
|
44
|
+
export type { Props as VariableInputProps } from './VariableInput/index.js';
|
|
45
|
+
export { VariableTable } from './VariableTable/index.js';
|
|
46
|
+
export { cleanVariables, resolveTabListKeyAction } from './utils.js';
|
|
47
|
+
export type { TabListKeyOptions } from './utils.js';
|
|
48
|
+
export { useDialogFocus, getFocusableElements } from './useDialogFocus.js';
|
|
49
|
+
export { segment, segmentGroup } from './classes.js';
|
|
50
|
+
export type { FormDataPart, FormDataPartType, HttpMethod, KeyValue, Variable } from '../types.js';
|
|
51
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
export { AsyncListState, ErrorRetry, LoadingMessage } from './AsyncListState/index.js';
|
|
2
|
+
export { BusyIndicator } from './BusyIndicator/index.js';
|
|
3
|
+
export { BackButton } from './BackButton/index.js';
|
|
4
|
+
export { Badge } from './Badge/index.js';
|
|
5
|
+
export { Button } from './Button/index.js';
|
|
6
|
+
export { CodeEditor, CODE_EDITOR_THEME_OPTIONS } from './CodeEditor/index.js';
|
|
7
|
+
export { CodeEditorConfigProvider, useCodeEditorConfig, DEFAULT_CODE_EDITOR_CONFIG } from './CodeEditor/config.js';
|
|
8
|
+
export { EmptyState } from './EmptyState/index.js';
|
|
9
|
+
export { FaIcon } from './FaIcon/index.js';
|
|
10
|
+
export { FieldError } from './FieldError/index.js';
|
|
11
|
+
export { FormDataEditor } from './FormDataEditor/index.js';
|
|
12
|
+
export { FooterButton } from './FooterButton/index.js';
|
|
13
|
+
export { FooterIcon } from './FooterIcon/index.js';
|
|
14
|
+
export { FormGroup } from './FormGroup/index.js';
|
|
15
|
+
export { Input, Select, Textarea, field, fieldFrame, surfaceField, mergeFieldClasses } from './forms/index.js';
|
|
16
|
+
export { KeyValueEditor } from './KeyValueEditor/index.js';
|
|
17
|
+
export { MethodSelect } from './MethodSelect/index.js';
|
|
18
|
+
export { Modal, ModalFooter, ModalFormLayout } from './Modal/index.js';
|
|
19
|
+
export { ModalHeader } from './Modal/ModalHeader.js';
|
|
20
|
+
export { OverlayCloseButton } from './OverlayCloseButton/index.js';
|
|
21
|
+
export { OverlayPage } from './OverlayPage/index.js';
|
|
22
|
+
export { PageHeader } from './PageHeader/index.js';
|
|
23
|
+
export { PanelCloseButton } from './PanelCloseButton/index.js';
|
|
24
|
+
export { Resizable, ResizeHandle, useResizable } from './Resizable/index.js';
|
|
25
|
+
export { DEFAULT_HEIGHT, MIN_HEIGHT, footerPanelClassName, footerPanelCloseButtonClassName, getFooterPanelMaxSize } from './Resizable/footerPanelUtils.js';
|
|
26
|
+
export { ResourceList, ResourceListRow, ResourceListPrimary, ResourceListEmptyItem } from './ResourceList/index.js';
|
|
27
|
+
export { RowActionsMenu } from './RowActionsMenu/index.js';
|
|
28
|
+
export { buildReorderMenuGroup } from './rowActionsMenuHelpers.js';
|
|
29
|
+
export { SegmentedTabs, SegmentedTabsGroup, SegmentedTabPanel } from './SegmentedTabs/index.js';
|
|
30
|
+
export { Spinner } from './Spinner/index.js';
|
|
31
|
+
export { StatusMessage } from './StatusMessage/index.js';
|
|
32
|
+
export { TabCloseButton } from './TabCloseButton/index.js';
|
|
33
|
+
export { VariableInput } from './VariableInput/index.js';
|
|
34
|
+
export { VariableTable } from './VariableTable/index.js';
|
|
35
|
+
export { cleanVariables, resolveTabListKeyAction } from './utils.js';
|
|
36
|
+
export { useDialogFocus, getFocusableElements } from './useDialogFocus.js';
|
|
37
|
+
export { segment, segmentGroup } from './classes.js';
|