@harborclient/sdk 1.0.6 → 1.0.9
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.js +1 -1
- package/dist/components/Autocomplete/AutocompleteInput.js +1 -1
- package/dist/components/BackButton/index.d.ts +6 -6
- package/dist/components/BackButton/index.d.ts.map +1 -1
- package/dist/components/BackButton/index.js +8 -8
- package/dist/components/Badge/index.js +1 -1
- package/dist/components/BusyIndicator/index.js +1 -1
- package/dist/components/Button/index.d.ts.map +1 -1
- package/dist/components/Button/index.js +3 -1
- package/dist/components/CodeEditor/index.js +2 -2
- package/dist/components/EmptyState/index.js +1 -1
- package/dist/components/FaIcon/index.d.ts.map +1 -1
- package/dist/components/FaIcon/index.js +2 -1
- package/dist/components/FieldError/index.js +1 -1
- package/dist/components/FooterButton/index.d.ts.map +1 -1
- package/dist/components/FooterButton/index.js +3 -1
- package/dist/components/FooterIcon/index.d.ts.map +1 -1
- package/dist/components/FooterIcon/index.js +3 -1
- package/dist/components/FormDataEditor/index.js +1 -1
- package/dist/components/FormGroup/index.d.ts.map +1 -1
- package/dist/components/FormGroup/index.js +16 -8
- package/dist/components/KeyValueEditor/index.js +1 -1
- package/dist/components/MethodSelect/index.js +1 -1
- package/dist/components/Modal/index.js +1 -1
- package/dist/components/OverlayCloseButton/index.d.ts.map +1 -1
- package/dist/components/OverlayCloseButton/index.js +3 -1
- package/dist/components/Page/index.js +3 -3
- package/dist/components/PageHeader/index.js +2 -2
- package/dist/components/PageSidebar/index.js +1 -1
- package/dist/components/PanelCloseButton/index.d.ts.map +1 -1
- package/dist/components/PanelCloseButton/index.js +3 -1
- package/dist/components/Resizable/Resizable.js +1 -1
- package/dist/components/ResourceList/index.js +1 -1
- package/dist/components/RowActionsMenu/index.js +1 -1
- package/dist/components/SegmentedTabs/index.js +1 -1
- package/dist/components/SidebarLayout/index.js +2 -2
- package/dist/components/Spinner/index.js +1 -1
- package/dist/components/StatusMessage/index.js +1 -1
- package/dist/components/TabCloseButton/index.js +1 -1
- package/dist/components/Table/index.js +2 -2
- package/dist/components/VariableInput/index.d.ts.map +1 -1
- package/dist/components/VariableInput/index.js +3 -1
- package/dist/components/VariableTable/index.js +1 -1
- package/dist/components/forms/Checkbox.js +2 -2
- package/dist/components/forms/Input.js +1 -1
- package/dist/components/forms/Radio.js +2 -2
- package/dist/components/forms/Select.js +1 -1
- package/dist/components/forms/Textarea.d.ts.map +1 -1
- package/dist/components/forms/Textarea.js +1 -1
- package/dist/components/forms/classes.d.ts +3 -2
- package/dist/components/forms/classes.d.ts.map +1 -1
- package/dist/components/forms/classes.js +7 -9
- package/package.json +1 -1
|
@@ -20,7 +20,7 @@ export function LoadingMessage({ children = 'Loading…', className }) {
|
|
|
20
20
|
* @param retryLabel - Visible retry button label.
|
|
21
21
|
*/
|
|
22
22
|
export function ErrorRetry({ error, onRetry, retryLabel = 'Retry' }) {
|
|
23
|
-
return (_jsxs("div", { className: "flex flex-wrap items-center gap-2", children: [_jsx(FieldError, { spacing: "field", className: "mb-0 mt-0", children: error }), _jsx(Button, { type: "button", variant: "secondary", onClick: onRetry, children: retryLabel })] }));
|
|
23
|
+
return (_jsxs("div", { className: "hc-error-retry flex flex-wrap items-center gap-2", children: [_jsx(FieldError, { spacing: "field", className: "mb-0 mt-0", children: error }), _jsx(Button, { type: "button", variant: "secondary", onClick: onRetry, children: retryLabel })] }));
|
|
24
24
|
}
|
|
25
25
|
/**
|
|
26
26
|
* Switches between loading, error-with-retry, empty, and ready list content for
|
|
@@ -12,7 +12,7 @@ export function AutocompleteInput({ value, onChange, source, className, onFocus,
|
|
|
12
12
|
value: safeValue,
|
|
13
13
|
onSelect: onChange
|
|
14
14
|
});
|
|
15
|
-
return (_jsxs(_Fragment, { children: [_jsx(Input, { ...props, ref: anchorRef, role: source ? 'combobox' : undefined, "aria-autocomplete": source ? 'list' : undefined, "aria-expanded": source ? open : undefined, "aria-controls": source && open ? listboxId : undefined, "aria-activedescendant": source && open && activeIndex >= 0 ? `${listboxId}-option-${activeIndex}` : undefined, className: className, value: safeValue, onChange: (event) => onChange(event.target.value), onFocus: (event) => {
|
|
15
|
+
return (_jsxs(_Fragment, { children: [_jsx(Input, { ...props, ref: anchorRef, role: source ? 'combobox' : undefined, "aria-autocomplete": source ? 'list' : undefined, "aria-expanded": source ? open : undefined, "aria-controls": source && open ? listboxId : undefined, "aria-activedescendant": source && open && activeIndex >= 0 ? `${listboxId}-option-${activeIndex}` : undefined, className: className ? `hc-autocomplete-input ${className}` : 'hc-autocomplete-input', value: safeValue, onChange: (event) => onChange(event.target.value), onFocus: (event) => {
|
|
16
16
|
openAutocomplete();
|
|
17
17
|
onFocus?.(event);
|
|
18
18
|
}, onBlur: (event) => {
|
|
@@ -5,11 +5,11 @@ interface Props {
|
|
|
5
5
|
*/
|
|
6
6
|
onClick: () => void;
|
|
7
7
|
/**
|
|
8
|
-
*
|
|
8
|
+
* Visible button text and default accessible name when `ariaLabel` is not provided.
|
|
9
9
|
*/
|
|
10
10
|
label?: string;
|
|
11
11
|
/**
|
|
12
|
-
* Accessible name when it should differ from `label`.
|
|
12
|
+
* Accessible name when it should differ from the visible `label`.
|
|
13
13
|
*/
|
|
14
14
|
ariaLabel?: string;
|
|
15
15
|
/**
|
|
@@ -18,13 +18,13 @@ interface Props {
|
|
|
18
18
|
className?: string;
|
|
19
19
|
}
|
|
20
20
|
/**
|
|
21
|
-
* Secondary
|
|
21
|
+
* Secondary back control for nested panel and overlay headers.
|
|
22
22
|
*
|
|
23
|
-
* Matches {@link PanelCloseButton}
|
|
23
|
+
* Matches {@link PanelCloseButton} sizing with a left-angle icon and visible label.
|
|
24
24
|
*
|
|
25
25
|
* @param onClick - Back navigation handler.
|
|
26
|
-
* @param label -
|
|
27
|
-
* @param ariaLabel - Accessible name override
|
|
26
|
+
* @param label - Visible button text; defaults to "Back".
|
|
27
|
+
* @param ariaLabel - Accessible name override when it should differ from `label`.
|
|
28
28
|
* @param className - Extra classes appended after the layout preset.
|
|
29
29
|
*/
|
|
30
30
|
export declare function BackButton({ onClick, label, ariaLabel, className }: Props): JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/BackButton/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;;;;;;;;;GASG;AACH,wBAAgB,UAAU,CAAC,EAAE,OAAO,EAAE,KAAc,EAAE,SAAS,EAAE,SAAS,EAAE,EAAE,KAAK,GAAG,GAAG,CAAC,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/BackButton/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;;;;;;;;;GASG;AACH,wBAAgB,UAAU,CAAC,EAAE,OAAO,EAAE,KAAc,EAAE,SAAS,EAAE,SAAS,EAAE,EAAE,KAAK,GAAG,GAAG,CAAC,OAAO,CAgBhG"}
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { jsx as _jsx } from "@harborclient/sdk/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "@harborclient/sdk/jsx-runtime";
|
|
2
2
|
import { Button } from '../Button/index.js';
|
|
3
3
|
import { FaIcon } from '../FaIcon/index.js';
|
|
4
4
|
import { faAngleLeft } from '@fortawesome/free-solid-svg-icons';
|
|
5
5
|
/**
|
|
6
|
-
* Secondary
|
|
6
|
+
* Secondary back control for nested panel and overlay headers.
|
|
7
7
|
*
|
|
8
|
-
* Matches {@link PanelCloseButton}
|
|
8
|
+
* Matches {@link PanelCloseButton} sizing with a left-angle icon and visible label.
|
|
9
9
|
*
|
|
10
10
|
* @param onClick - Back navigation handler.
|
|
11
|
-
* @param label -
|
|
12
|
-
* @param ariaLabel - Accessible name override
|
|
11
|
+
* @param label - Visible button text; defaults to "Back".
|
|
12
|
+
* @param ariaLabel - Accessible name override when it should differ from `label`.
|
|
13
13
|
* @param className - Extra classes appended after the layout preset.
|
|
14
14
|
*/
|
|
15
15
|
export function BackButton({ onClick, label = 'Back', ariaLabel, className }) {
|
|
16
|
-
const base = 'inline-flex shrink-0 items-center justify-center py-
|
|
17
|
-
const classes = className ?
|
|
18
|
-
return (
|
|
16
|
+
const base = 'inline-flex shrink-0 items-center justify-center gap-1.5 py-1 text-[14px] h-6';
|
|
17
|
+
const classes = className ? `hc-back-button ${base} ${className}` : `hc-back-button ${base}`;
|
|
18
|
+
return (_jsxs(Button, { type: "button", variant: "toolbar", className: classes, "aria-label": ariaLabel, onClick: onClick, children: [_jsx(FaIcon, { icon: faAngleLeft, className: "h-4 w-4", "aria-hidden": true }), _jsx("span", { children: label })] }));
|
|
19
19
|
}
|
|
@@ -26,7 +26,7 @@ function variantClasses(variant) {
|
|
|
26
26
|
* @param className - Extra classes appended after the variant preset.
|
|
27
27
|
*/
|
|
28
28
|
export function Badge({ children, variant = 'muted', className }) {
|
|
29
|
-
const base = `inline-flex shrink-0 items-center rounded px-1.5 py-0.5 text-[14px] ${variantClasses(variant)}`;
|
|
29
|
+
const base = `hc-badge inline-flex shrink-0 items-center rounded px-1.5 py-0.5 text-[14px] ${variantClasses(variant)}`;
|
|
30
30
|
const classes = className ? `${base} ${className}` : base;
|
|
31
31
|
return _jsx("span", { className: classes, children: children });
|
|
32
32
|
}
|
|
@@ -82,5 +82,5 @@ export function BusyIndicator({ isBusy }) {
|
|
|
82
82
|
if (!visible) {
|
|
83
83
|
return null;
|
|
84
84
|
}
|
|
85
|
-
return (_jsxs(_Fragment, { children: [_jsx("div", { className: "pointer-events-none fixed inset-x-0 top-0 z-[100] h-0.5 overflow-hidden bg-separator", "aria-hidden": "true", children: _jsx("div", { className: "busy-progress-bar h-full w-1/3 bg-accent" }) }), _jsx("div", { className: "pointer-events-none fixed right-3 top-3 z-[100] flex h-6 w-6 items-center justify-center rounded-full border border-separator bg-surface shadow-sm", role: "status", "aria-label": "Working", children: _jsx(Spinner, { size: "sm" }) })] }));
|
|
85
|
+
return (_jsxs(_Fragment, { children: [_jsx("div", { className: "hc-busy-indicator pointer-events-none fixed inset-x-0 top-0 z-[100] h-0.5 overflow-hidden bg-separator", "aria-hidden": "true", children: _jsx("div", { className: "busy-progress-bar h-full w-1/3 bg-accent" }) }), _jsx("div", { className: "pointer-events-none fixed right-3 top-3 z-[100] flex h-6 w-6 items-center justify-center rounded-full border border-separator bg-surface shadow-sm", role: "status", "aria-label": "Working", children: _jsx(Spinner, { size: "sm" }) })] }));
|
|
86
86
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Button/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElE;;GAEG;AACH,MAAM,MAAM,aAAa,GACrB,SAAS,GACT,WAAW,GACX,eAAe,GACf,iBAAiB,GACjB,SAAS,GACT,MAAM,GACN,YAAY,CAAC;AAEjB,KAAK,iBAAiB,GAAG,MAAM,GAAG,YAAY,CAAC;AAE/C,KAAK,cAAc,GACf;IAAE,YAAY,EAAE,MAAM,CAAC;IAAC,iBAAiB,CAAC,EAAE,SAAS,CAAA;CAAE,GACvD;IAAE,iBAAiB,EAAE,MAAM,CAAC;IAAC,YAAY,CAAC,EAAE,SAAS,CAAA;CAAE,CAAC;AAE5D,KAAK,SAAS,GAAG,IAAI,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EAAE,YAAY,GAAG,iBAAiB,CAAC,GAAG;IACjG;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC,iBAAiB,GAAG,IAAI,CAAC,CAAC;CAChD,CAAC;AAEF,MAAM,MAAM,WAAW,GACnB,CAAC,SAAS,GAAG;IAAE,OAAO,EAAE,iBAAiB,CAAA;CAAE,GAAG,cAAc,CAAC,GAC7D,CAAC,SAAS,GAAG;IAAE,OAAO,CAAC,EAAE,OAAO,CAAC,aAAa,EAAE,iBAAiB,CAAC,CAAA;CAAE,CAAC,CAAC;AAc1E;;;;;;;;;;;;GAYG;AACH,wBAAgB,MAAM,CAAC,EACrB,OAAmB,EACnB,SAAS,EACT,IAAe,EACf,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,WAAW,GAAG,GAAG,CAAC,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Button/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElE;;GAEG;AACH,MAAM,MAAM,aAAa,GACrB,SAAS,GACT,WAAW,GACX,eAAe,GACf,iBAAiB,GACjB,SAAS,GACT,MAAM,GACN,YAAY,CAAC;AAEjB,KAAK,iBAAiB,GAAG,MAAM,GAAG,YAAY,CAAC;AAE/C,KAAK,cAAc,GACf;IAAE,YAAY,EAAE,MAAM,CAAC;IAAC,iBAAiB,CAAC,EAAE,SAAS,CAAA;CAAE,GACvD;IAAE,iBAAiB,EAAE,MAAM,CAAC;IAAC,YAAY,CAAC,EAAE,SAAS,CAAA;CAAE,CAAC;AAE5D,KAAK,SAAS,GAAG,IAAI,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EAAE,YAAY,GAAG,iBAAiB,CAAC,GAAG;IACjG;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC,iBAAiB,GAAG,IAAI,CAAC,CAAC;CAChD,CAAC;AAEF,MAAM,MAAM,WAAW,GACnB,CAAC,SAAS,GAAG;IAAE,OAAO,EAAE,iBAAiB,CAAA;CAAE,GAAG,cAAc,CAAC,GAC7D,CAAC,SAAS,GAAG;IAAE,OAAO,CAAC,EAAE,OAAO,CAAC,aAAa,EAAE,iBAAiB,CAAC,CAAA;CAAE,CAAC,CAAC;AAc1E;;;;;;;;;;;;GAYG;AACH,wBAAgB,MAAM,CAAC,EACrB,OAAmB,EACnB,SAAS,EACT,IAAe,EACf,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,WAAW,GAAG,GAAG,CAAC,OAAO,CAK3B"}
|
|
@@ -23,6 +23,8 @@ const VARIANT_CLASSES = {
|
|
|
23
23
|
* @param type - Native button type; defaults to `button`.
|
|
24
24
|
*/
|
|
25
25
|
export function Button({ variant = 'primary', className, type = 'button', innerRef, ...props }) {
|
|
26
|
-
const classes = className
|
|
26
|
+
const classes = className
|
|
27
|
+
? `hc-button ${VARIANT_CLASSES[variant]} ${className}`
|
|
28
|
+
: `hc-button ${VARIANT_CLASSES[variant]}`;
|
|
27
29
|
return _jsx("button", { ref: innerRef, type: type, className: classes, ...props });
|
|
28
30
|
}
|
|
@@ -420,8 +420,8 @@ export function CodeEditor({ value, onChange, language = 'text', readOnly = fals
|
|
|
420
420
|
};
|
|
421
421
|
}, [resolvedSetup, readOnly]);
|
|
422
422
|
const wrapperClassName = readOnly
|
|
423
|
-
? `overflow-hidden rounded-md bg-control shadow-[inset_0_0.5px_1px_rgba(0,0,0,0.06)] app-no-drag ${className}`
|
|
424
|
-
: `min-h-36 resize-y overflow-hidden rounded-md border border-separator bg-control shadow-[inset_0_0.5px_1px_rgba(0,0,0,0.06)] focus-within:shadow-[0_0_0_3px_color-mix(in_srgb,var(--mac-accent)_35%,transparent),inset_0_0.5px_1px_rgba(0,0,0,0.06)] app-no-drag ${className}`;
|
|
423
|
+
? `hc-code-editor overflow-hidden rounded-md bg-control shadow-[inset_0_0.5px_1px_rgba(0,0,0,0.06)] app-no-drag ${className}`
|
|
424
|
+
: `hc-code-editor min-h-36 resize-y overflow-hidden rounded-md border border-separator bg-control shadow-[inset_0_0.5px_1px_rgba(0,0,0,0.06)] focus-within:shadow-[0_0_0_3px_color-mix(in_srgb,var(--mac-accent)_35%,transparent),inset_0_0.5px_1px_rgba(0,0,0,0.06)] app-no-drag ${className}`;
|
|
425
425
|
const selectionTooltipContent = selectionTooltip
|
|
426
426
|
? getVariableTooltipContent(selectionTooltip.key, variables ?? [])
|
|
427
427
|
: null;
|
|
@@ -19,7 +19,7 @@ function variantClasses(variant) {
|
|
|
19
19
|
* @param className - Extra classes appended after the preset.
|
|
20
20
|
*/
|
|
21
21
|
export function EmptyState({ children, variant = 'inline', className }) {
|
|
22
|
-
const base = variantClasses(variant)
|
|
22
|
+
const base = `hc-empty-state ${variantClasses(variant)}`;
|
|
23
23
|
const classes = className ? `${base} ${className}` : base;
|
|
24
24
|
return _jsx("div", { className: classes, children: children });
|
|
25
25
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/FaIcon/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AACxE,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAEjC,UAAU,KAAK;IACb;;OAEG;IACH,IAAI,EAAE,cAAc,CAAC;IAErB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;GAEG;AACH,wBAAgB,MAAM,CAAC,EAAE,IAAI,EAAE,SAAyB,EAAE,KAAK,EAAE,EAAE,KAAK,GAAG,GAAG,CAAC,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/FaIcon/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AACxE,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAEjC,UAAU,KAAK;IACb;;OAEG;IACH,IAAI,EAAE,cAAc,CAAC;IAErB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;GAEG;AACH,wBAAgB,MAAM,CAAC,EAAE,IAAI,EAAE,SAAyB,EAAE,KAAK,EAAE,EAAE,KAAK,GAAG,GAAG,CAAC,OAAO,CAQrF"}
|
|
@@ -4,9 +4,10 @@ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
|
|
4
4
|
* Renders a Font Awesome SVG icon with consistent default sizing.
|
|
5
5
|
*/
|
|
6
6
|
export function FaIcon({ icon, className = 'h-3.5 w-3.5', title }) {
|
|
7
|
+
const classes = className ? `hc-fa-icon ${className}` : 'hc-fa-icon';
|
|
7
8
|
return createElement(FontAwesomeIcon, {
|
|
8
9
|
icon,
|
|
9
|
-
className,
|
|
10
|
+
className: classes,
|
|
10
11
|
title,
|
|
11
12
|
'aria-hidden': title ? undefined : true
|
|
12
13
|
});
|
|
@@ -28,7 +28,7 @@ function spacingClasses(spacing) {
|
|
|
28
28
|
export function FieldError({ children, id, spacing = 'field', roleAlert = true, className }) {
|
|
29
29
|
if (children == null || children === '')
|
|
30
30
|
return null;
|
|
31
|
-
const base =
|
|
31
|
+
const base = `hc-field-error ${spacingClasses(spacing)} text-[14px] text-danger`;
|
|
32
32
|
const classes = className ? `${base} ${className}` : base;
|
|
33
33
|
return (_jsx("p", { id: id, className: classes, role: roleAlert ? 'alert' : undefined, children: children }));
|
|
34
34
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/FooterButton/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAE5C,UAAU,KAAK;IACb;;OAEG;IACH,MAAM,EAAE,OAAO,CAAC;IAEhB;;OAEG;IACH,OAAO,EAAE,MAAM,IAAI,CAAC;IAEpB;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,QAAQ,EAAE,SAAS,CAAC;IAEpB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAaD;;;GAGG;AACH,wBAAgB,YAAY,CAAC,EAC3B,MAAM,EACN,OAAO,EACP,UAAU,EACV,QAAQ,EACR,SAAS,EACV,EAAE,KAAK,GAAG,GAAG,CAAC,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/FooterButton/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAE5C,UAAU,KAAK;IACb;;OAEG;IACH,MAAM,EAAE,OAAO,CAAC;IAEhB;;OAEG;IACH,OAAO,EAAE,MAAM,IAAI,CAAC;IAEpB;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,QAAQ,EAAE,SAAS,CAAC;IAEpB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAaD;;;GAGG;AACH,wBAAgB,YAAY,CAAC,EAC3B,MAAM,EACN,OAAO,EACP,UAAU,EACV,QAAQ,EACR,SAAS,EACV,EAAE,KAAK,GAAG,GAAG,CAAC,OAAO,CAgBrB"}
|
|
@@ -14,6 +14,8 @@ function footerSegment(active) {
|
|
|
14
14
|
* slide-up panels such as Console and Variables.
|
|
15
15
|
*/
|
|
16
16
|
export function FooterButton({ active, onClick, controlsId, children, className }) {
|
|
17
|
-
const classes = className
|
|
17
|
+
const classes = className
|
|
18
|
+
? `hc-footer-button ${footerSegment(active)} ${className}`
|
|
19
|
+
: `hc-footer-button ${footerSegment(active)}`;
|
|
18
20
|
return (_jsx("button", { type: "button", className: classes, onClick: onClick, "aria-expanded": active, "aria-controls": controlsId, children: children }));
|
|
19
21
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/FooterIcon/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AACxE,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAGjC,UAAU,KAAK;IACb;;OAEG;IACH,IAAI,EAAE,cAAc,CAAC;IAErB;;OAEG;IACH,MAAM,EAAE,OAAO,CAAC;IAEhB;;OAEG;IACH,OAAO,EAAE,MAAM,IAAI,CAAC;IAEpB;;;OAGG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAaD;;;GAGG;AACH,wBAAgB,UAAU,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,EAAE,KAAK,GAAG,GAAG,CAAC,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/FooterIcon/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AACxE,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAGjC,UAAU,KAAK;IACb;;OAEG;IACH,IAAI,EAAE,cAAc,CAAC;IAErB;;OAEG;IACH,MAAM,EAAE,OAAO,CAAC;IAEhB;;OAEG;IACH,OAAO,EAAE,MAAM,IAAI,CAAC;IAEpB;;;OAGG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAaD;;;GAGG;AACH,wBAAgB,UAAU,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,EAAE,KAAK,GAAG,GAAG,CAAC,OAAO,CAkB1F"}
|
|
@@ -16,6 +16,8 @@ function footerIconButton(active) {
|
|
|
16
16
|
*/
|
|
17
17
|
export function FooterIcon({ icon, active, onClick, label, className }) {
|
|
18
18
|
const accessibleLabel = active ? `Hide ${label}` : `Show ${label}`;
|
|
19
|
-
const classes = className
|
|
19
|
+
const classes = className
|
|
20
|
+
? `hc-footer-icon ${footerIconButton(active)} ${className}`
|
|
21
|
+
: `hc-footer-icon ${footerIconButton(active)}`;
|
|
20
22
|
return (_jsx("button", { type: "button", className: classes, onClick: onClick, "aria-pressed": active, "aria-label": accessibleLabel, title: accessibleLabel, children: _jsx(FaIcon, { icon: icon, className: "h-4 w-4" }) }));
|
|
21
23
|
}
|
|
@@ -70,7 +70,7 @@ export function FormDataEditor({ parts, onChange, variables, onSelectFiles, onEd
|
|
|
70
70
|
const currentFiles = rows[index]?.files ?? [];
|
|
71
71
|
updateRow(index, { files: currentFiles.filter((file) => file !== filePath) });
|
|
72
72
|
};
|
|
73
|
-
return (_jsxs(Table, { children: [_jsx(TableHeader, { children: _jsxs("tr", { children: [_jsx(TableHead, { className: "w-6 p-0", children: _jsx("span", { className: "sr-only", children: "Enable" }) }), _jsx(TableHead, { children: "Key" }), _jsx(TableHead, { className: "w-24", children: "Type" }), _jsx(TableHead, { children: "Value" }), _jsx(TableHead, { className: "w-7 p-0" })] }) }), _jsx(TableBody, { children: rows.map((row, index) => (_jsxs("tr", { children: [_jsx(TableCell, { className: "w-6 p-1 text-center", children: _jsx(Checkbox, { className: "app-no-drag", checked: row.enabled, onChange: (e) => updateRow(index, { enabled: e.target.checked }), "aria-label": `Enable row ${index + 1}`, title: "Enable" }) }), _jsx(TableCell, { children: _jsx(Input, { type: "text", className: "w-full", value: row.key, placeholder: "field", "aria-label": `Key, row ${index + 1}`, onChange: (e) => updateRow(index, { key: e.target.value }) }) }), _jsx(TableCell, { children: _jsxs(Select, { className: "w-full", value: row.type, "aria-label": `Type, row ${index + 1}`, onChange: (e) => {
|
|
73
|
+
return (_jsxs(Table, { className: "hc-form-data-editor", children: [_jsx(TableHeader, { children: _jsxs("tr", { children: [_jsx(TableHead, { className: "w-6 p-0", children: _jsx("span", { className: "sr-only", children: "Enable" }) }), _jsx(TableHead, { children: "Key" }), _jsx(TableHead, { className: "w-24", children: "Type" }), _jsx(TableHead, { children: "Value" }), _jsx(TableHead, { className: "w-7 p-0" })] }) }), _jsx(TableBody, { children: rows.map((row, index) => (_jsxs("tr", { children: [_jsx(TableCell, { className: "w-6 p-1 text-center", children: _jsx(Checkbox, { className: "app-no-drag", checked: row.enabled, onChange: (e) => updateRow(index, { enabled: e.target.checked }), "aria-label": `Enable row ${index + 1}`, title: "Enable" }) }), _jsx(TableCell, { children: _jsx(Input, { type: "text", className: "w-full", value: row.key, placeholder: "field", "aria-label": `Key, row ${index + 1}`, onChange: (e) => updateRow(index, { key: e.target.value }) }) }), _jsx(TableCell, { children: _jsxs(Select, { className: "w-full", value: row.type, "aria-label": `Type, row ${index + 1}`, onChange: (e) => {
|
|
74
74
|
const type = e.target.value;
|
|
75
75
|
updateRow(index, {
|
|
76
76
|
type,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/FormGroup/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAI5C;;GAEG;AACH,MAAM,MAAM,eAAe,GACvB,SAAS,GACT,UAAU,GACV,QAAQ,GACR,OAAO,GACP,kBAAkB,GAClB,YAAY,CAAC;AAEjB;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG,SAAS,GAAG,OAAO,CAAC;AAErD,UAAU,KAAK;IACb;;OAEG;IACH,KAAK,EAAE,SAAS,CAAC;IAEjB;;OAEG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;IAErB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,WAAW,CAAC,EAAE,SAAS,CAAC;IAExB;;OAEG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;IAElB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB;;OAEG;IACH,MAAM,CAAC,EAAE,eAAe,CAAC;IAEzB;;OAEG;IACH,SAAS,CAAC,EAAE,kBAAkB,CAAC;IAE/B;;OAEG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IAEjB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAqBD;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,SAAS,CAAC,EACxB,KAAK,EACL,QAAQ,EACR,OAAO,EACP,WAAW,EACX,KAAK,EACL,OAAO,EACP,aAAa,EACb,MAAkB,EAClB,SAAqB,EACrB,MAAc,EACd,SAAS,EACT,cAAc,EACf,EAAE,KAAK,GAAG,GAAG,CAAC,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/FormGroup/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAI5C;;GAEG;AACH,MAAM,MAAM,eAAe,GACvB,SAAS,GACT,UAAU,GACV,QAAQ,GACR,OAAO,GACP,kBAAkB,GAClB,YAAY,CAAC;AAEjB;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG,SAAS,GAAG,OAAO,CAAC;AAErD,UAAU,KAAK;IACb;;OAEG;IACH,KAAK,EAAE,SAAS,CAAC;IAEjB;;OAEG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;IAErB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,WAAW,CAAC,EAAE,SAAS,CAAC;IAExB;;OAEG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;IAElB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB;;OAEG;IACH,MAAM,CAAC,EAAE,eAAe,CAAC;IAEzB;;OAEG;IACH,SAAS,CAAC,EAAE,kBAAkB,CAAC;IAE/B;;OAEG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IAEjB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAqBD;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,SAAS,CAAC,EACxB,KAAK,EACL,QAAQ,EACR,OAAO,EACP,WAAW,EACX,KAAK,EACL,OAAO,EACP,aAAa,EACb,MAAkB,EAClB,SAAqB,EACrB,MAAc,EACd,SAAS,EACT,cAAc,EACf,EAAE,KAAK,GAAG,GAAG,CAAC,OAAO,CA8GrB"}
|
|
@@ -43,31 +43,37 @@ export function FormGroup({ label, children, htmlFor, description, error, errorI
|
|
|
43
43
|
const controlId = htmlFor ?? generatedId;
|
|
44
44
|
const extra = className ?? '';
|
|
45
45
|
if (layout === 'associated') {
|
|
46
|
-
const associatedClasses = labelClassName
|
|
46
|
+
const associatedClasses = labelClassName
|
|
47
|
+
? `hc-form-group ${labelClassName}`
|
|
48
|
+
: 'hc-form-group text-[14px] text-text';
|
|
47
49
|
return (_jsx("label", { htmlFor: htmlFor, className: associatedClasses, children: label }));
|
|
48
50
|
}
|
|
49
51
|
if (layout === 'checkboxAdjacent') {
|
|
50
|
-
const wrapperClasses = extra
|
|
52
|
+
const wrapperClasses = extra
|
|
53
|
+
? `hc-form-group flex items-start gap-2 ${extra}`
|
|
54
|
+
: 'hc-form-group flex items-start gap-2';
|
|
51
55
|
const adjacentLabelClasses = labelClassName ?? 'min-w-0 flex-1 text-[14px] text-text';
|
|
52
56
|
const linkedChildren = enhanceControl(children, { id: controlId });
|
|
53
57
|
return (_jsxs("div", { className: wrapperClasses, children: [linkedChildren, _jsx("label", { htmlFor: controlId, className: adjacentLabelClasses, children: label })] }));
|
|
54
58
|
}
|
|
55
59
|
if (layout === 'radio') {
|
|
56
60
|
const wrapperClasses = extra
|
|
57
|
-
? `inline-flex cursor-pointer items-center gap-1.5 text-[14px] text-text app-no-drag ${extra}`
|
|
58
|
-
: 'inline-flex cursor-pointer items-center gap-1.5 text-[14px] text-text app-no-drag';
|
|
61
|
+
? `hc-form-group inline-flex cursor-pointer items-center gap-1.5 text-[14px] text-text app-no-drag ${extra}`
|
|
62
|
+
: 'hc-form-group inline-flex cursor-pointer items-center gap-1.5 text-[14px] text-text app-no-drag';
|
|
59
63
|
const linkedChildren = enhanceControl(children, { id: controlId });
|
|
60
64
|
return (_jsxs("label", { htmlFor: controlId, className: wrapperClasses, children: [linkedChildren, label] }));
|
|
61
65
|
}
|
|
62
66
|
if (layout === 'checkbox') {
|
|
63
|
-
const wrapperClasses = extra
|
|
67
|
+
const wrapperClasses = extra
|
|
68
|
+
? `hc-form-group flex items-center gap-2 ${extra}`
|
|
69
|
+
: 'hc-form-group flex items-center gap-2';
|
|
64
70
|
const linkedChildren = enhanceControl(children, { id: controlId });
|
|
65
71
|
return (_jsxs("label", { htmlFor: controlId, className: wrapperClasses, children: [linkedChildren, _jsx("span", { className: labelClasses(labelTone, srOnly, false), children: label })] }));
|
|
66
72
|
}
|
|
67
73
|
if (layout === 'inline') {
|
|
68
74
|
const wrapperClasses = extra
|
|
69
|
-
? `flex min-w-0 flex-1 items-center gap-2 ${extra}`
|
|
70
|
-
: 'flex min-w-0 flex-1 items-center gap-2';
|
|
75
|
+
? `hc-form-group flex min-w-0 flex-1 items-center gap-2 ${extra}`
|
|
76
|
+
: 'hc-form-group flex min-w-0 flex-1 items-center gap-2';
|
|
71
77
|
const linkedChildren = enhanceControl(children, { id: controlId });
|
|
72
78
|
return (_jsxs("label", { htmlFor: controlId, className: wrapperClasses, children: [_jsx("span", { className: labelClasses(labelTone, srOnly, true), children: label }), linkedChildren] }));
|
|
73
79
|
}
|
|
@@ -84,6 +90,8 @@ export function FormGroup({ label, children, htmlFor, description, error, errorI
|
|
|
84
90
|
invalid: resolvedErrorId != null,
|
|
85
91
|
id: htmlFor
|
|
86
92
|
});
|
|
87
|
-
const wrapperClasses = extra
|
|
93
|
+
const wrapperClasses = extra
|
|
94
|
+
? `hc-form-group flex flex-col gap-1 ${extra}`
|
|
95
|
+
: 'hc-form-group flex flex-col gap-1';
|
|
88
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 }), control, resolvedDescriptionId ? (_jsx("p", { id: resolvedDescriptionId, className: "m-0 text-[14px] text-muted", children: description })) : null] }), resolvedErrorId ? (_jsx(FieldError, { id: resolvedErrorId, spacing: "field", children: error })) : null] }));
|
|
89
97
|
}
|
|
@@ -46,7 +46,7 @@ export function KeyValueEditor({ rows, onChange, placeholderKey = 'Key', placeho
|
|
|
46
46
|
value: row.value ?? '',
|
|
47
47
|
enabled: row.enabled ?? true
|
|
48
48
|
});
|
|
49
|
-
return (_jsxs(Table, { children: [_jsx(TableHeader, { children: _jsxs("tr", { children: [_jsx(TableHead, { className: "w-6 p-0", children: _jsx("span", { className: "sr-only", children: "Enable" }) }), _jsx(TableHead, { children: "Key" }), _jsx(TableHead, { children: "Value" }), _jsx(TableHead, { className: "w-7 p-0" })] }) }), _jsx(TableBody, { children: rows.map((row, index) => {
|
|
49
|
+
return (_jsxs(Table, { className: "hc-key-value-editor", children: [_jsx(TableHeader, { children: _jsxs("tr", { children: [_jsx(TableHead, { className: "w-6 p-0", children: _jsx("span", { className: "sr-only", children: "Enable" }) }), _jsx(TableHead, { children: "Key" }), _jsx(TableHead, { children: "Value" }), _jsx(TableHead, { className: "w-7 p-0" })] }) }), _jsx(TableBody, { children: rows.map((row, index) => {
|
|
50
50
|
const normalizedRow = normalizeRow(row);
|
|
51
51
|
return (_jsxs("tr", { children: [_jsx(TableCell, { className: "w-6 p-1 text-center", children: _jsx(Checkbox, { className: "app-no-drag", checked: normalizedRow.enabled, onChange: (e) => updateRow(index, { enabled: e.target.checked }), "aria-label": `Enable row ${index + 1}`, title: "Enable" }) }), _jsx(TableCell, { children: _jsx(AutocompleteInput, { type: "text", className: "w-full", value: normalizedRow.key, source: keySource, placeholder: placeholderKey, "aria-label": `Key, row ${index + 1}`, onChange: (key) => updateRow(index, { key }) }) }), _jsx(TableCell, { children: _jsx(VariableInput, { wrapperClassName: `${fieldFrame} w-full`, className: "app-no-drag", value: normalizedRow.value, onChange: (value) => updateRow(index, { value }), variables: variables, source: valueSource, placeholder: placeholderValue, "aria-label": `Value, row ${index + 1}`, onEditVariable: onEditVariable }) }), _jsx(TableCell, { className: "w-7 p-1 text-center", children: _jsx(Button, { type: "button", variant: "iconDanger", onClick: () => removeRow(index), title: "Remove", "aria-label": `Remove row ${index + 1}`, children: _jsx(FaIcon, { icon: faXmark, className: "h-3.5 w-3.5" }) }) })] }, index));
|
|
52
52
|
}) })] }));
|
|
@@ -5,5 +5,5 @@ const METHODS = ['GET', 'POST', 'PUT', 'PATCH', 'DELETE', 'HEAD', 'OPTIONS'];
|
|
|
5
5
|
* Dropdown for selecting an HTTP request method.
|
|
6
6
|
*/
|
|
7
7
|
export function MethodSelect({ value, onChange }) {
|
|
8
|
-
return (_jsx(Select, { variant: "plain", className: "w-[100px] shrink-0 cursor-pointer appearance-none border-none bg-transparent px-2 py-1 text-[14px] font-semibold app-no-drag", value: value, "aria-label": "HTTP method", onChange: (e) => onChange(e.target.value), children: METHODS.map((method) => (_jsx("option", { value: method, children: method }, method))) }));
|
|
8
|
+
return (_jsx(Select, { variant: "plain", className: "hc-method-select w-[100px] shrink-0 cursor-pointer appearance-none border-none bg-transparent px-2 py-1 text-[14px] font-semibold app-no-drag", value: value, "aria-label": "HTTP method", onChange: (e) => onChange(e.target.value), children: METHODS.map((method) => (_jsx("option", { value: method, children: method }, method))) }));
|
|
9
9
|
}
|
|
@@ -30,7 +30,7 @@ export function Modal({ onClose, className = 'w-96', overlayClassName, disableEs
|
|
|
30
30
|
document.addEventListener('keydown', handleKeyDown);
|
|
31
31
|
return () => document.removeEventListener('keydown', handleKeyDown);
|
|
32
32
|
}, [disableEscape, onClose]);
|
|
33
|
-
const overlayClass = `fixed inset-0 flex items-center justify-center bg-black/40 ${overlayClassName ?? 'z-50'}`;
|
|
33
|
+
const overlayClass = `hc-modal fixed inset-0 flex items-center justify-center bg-black/40 ${overlayClassName ?? 'z-50'}`;
|
|
34
34
|
const panelClass = title
|
|
35
35
|
? `${className} flex max-h-[85vh] flex-col overflow-hidden rounded-lg border border-separator bg-surface shadow-xl`
|
|
36
36
|
: `${className} rounded-lg border border-separator bg-surface p-4 shadow-xl`;
|
|
@@ -1 +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,
|
|
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,CAU9F"}
|
|
@@ -10,6 +10,8 @@ import { FaIcon } from '../FaIcon/index.js';
|
|
|
10
10
|
* @param className - Extra classes appended after the overlay preset.
|
|
11
11
|
*/
|
|
12
12
|
export function OverlayCloseButton({ label = 'Close', onClose, className }) {
|
|
13
|
-
const classes = className
|
|
13
|
+
const classes = className
|
|
14
|
+
? `hc-overlay-close-button text-[28px] ${className}`
|
|
15
|
+
: 'hc-overlay-close-button text-[28px]';
|
|
14
16
|
return (_jsx(Button, { type: "button", variant: "icon", className: classes, "aria-label": label, onClick: onClose, children: _jsx(FaIcon, { icon: faXmark, className: "h-4 w-4" }) }));
|
|
15
17
|
}
|
|
@@ -8,11 +8,11 @@ import { PageHeader } from '../PageHeader/index.js';
|
|
|
8
8
|
export function Page({ title, description, icon, actions, footer, embedded = false, className, children }) {
|
|
9
9
|
const header = (_jsx(PageHeader, { title: title, description: description, icon: icon, children: actions }));
|
|
10
10
|
if (embedded) {
|
|
11
|
-
const outer = className
|
|
11
|
+
const outer = className ? `hc-page ${className}` : 'hc-page';
|
|
12
12
|
return (_jsxs("div", { className: outer, children: [header, children, footer] }));
|
|
13
13
|
}
|
|
14
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';
|
|
15
|
+
? `hc-page flex min-h-0 flex-1 flex-col overflow-y-auto p-6 ${className}`
|
|
16
|
+
: 'hc-page flex min-h-0 flex-1 flex-col overflow-y-auto p-6';
|
|
17
17
|
return (_jsx("div", { className: outer, children: _jsxs("div", { className: "mx-auto w-full", children: [header, children, footer] }) }));
|
|
18
18
|
}
|
|
@@ -6,7 +6,7 @@ import { FaIcon } from '../FaIcon/index.js';
|
|
|
6
6
|
*/
|
|
7
7
|
export function PageHeader({ title, description, icon, children, className }) {
|
|
8
8
|
const wrapperClassName = className
|
|
9
|
-
?
|
|
10
|
-
: '-mx-6 mb-4 flex flex-wrap items-center gap-2 border-b border-separator px-6 py-3';
|
|
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
|
+
: 'hc-page-header -mx-6 mb-4 flex flex-wrap items-center gap-2 border-b border-separator px-6 py-3';
|
|
11
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
12
|
}
|
|
@@ -14,7 +14,7 @@ function sidebarRow(active) {
|
|
|
14
14
|
* Narrow sidebar navigation for multi-section pages such as settings overlays.
|
|
15
15
|
*/
|
|
16
16
|
export function PageSidebar({ items, selected, onSelect, ariaLabel }) {
|
|
17
|
-
return (_jsx("nav", { className: "flex w-[180px] shrink-0 flex-col gap-0.5 border-r border-separator bg-sidebar px-2 py-3", "aria-label": ariaLabel, children: items.map((item) => {
|
|
17
|
+
return (_jsx("nav", { className: "hc-page-sidebar flex w-[180px] shrink-0 flex-col gap-0.5 border-r border-separator bg-sidebar px-2 py-3", "aria-label": ariaLabel, children: items.map((item) => {
|
|
18
18
|
const active = selected === item.value;
|
|
19
19
|
const rowClass = item.icon
|
|
20
20
|
? `${sidebarRow(active)} w-full gap-2 border-none text-left text-[14px] app-no-drag`
|
|
@@ -1 +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,
|
|
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,CAiBrB"}
|
|
@@ -12,6 +12,8 @@ import { faXmark } from '@fortawesome/free-solid-svg-icons';
|
|
|
12
12
|
*/
|
|
13
13
|
export function PanelCloseButton({ onClose, label = 'Close', ariaLabel, className }) {
|
|
14
14
|
const base = 'inline-flex shrink-0 items-center justify-center py-2';
|
|
15
|
-
const classes = className
|
|
15
|
+
const classes = className
|
|
16
|
+
? `hc-panel-close-button ${base} ${className}`
|
|
17
|
+
: `hc-panel-close-button ${base}`;
|
|
16
18
|
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
19
|
}
|
|
@@ -28,5 +28,5 @@ export function Resizable({ id, open, onClose, closeLabel, storageKey, title, he
|
|
|
28
28
|
});
|
|
29
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
30
|
const body = unmountWhenClosed && !open ? null : children;
|
|
31
|
-
return (_jsxs("div", { ref: containerRef, id: id, className: footerPanelClassName(open)
|
|
31
|
+
return (_jsxs("div", { ref: containerRef, id: id, className: `hc-resizable ${footerPanelClassName(open)}`, style: { height }, role: "region", "aria-label": `${closeLabel} panel`, "aria-hidden": !open, inert: !open || undefined, 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
32
|
}
|
|
@@ -8,7 +8,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "@harborclient/sdk/jsx-runtime";
|
|
|
8
8
|
* @param aria-labelledby - Id of a visible heading that names the list.
|
|
9
9
|
*/
|
|
10
10
|
export function ResourceList({ children, className, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy }) {
|
|
11
|
-
const base = 'm-0 flex list-none flex-col gap-2 p-0';
|
|
11
|
+
const base = 'hc-resource-list m-0 flex list-none flex-col gap-2 p-0';
|
|
12
12
|
const classes = className ? `${base} ${className}` : base;
|
|
13
13
|
return (_jsx("ul", { className: classes, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, children: children }));
|
|
14
14
|
}
|
|
@@ -169,7 +169,7 @@ export function RowActionsMenu({ groups, menuId, openMenuId, onOpenChange }) {
|
|
|
169
169
|
focusItem(typeahead.index);
|
|
170
170
|
}
|
|
171
171
|
};
|
|
172
|
-
return (_jsxs("div", { ref: rootRef, className: "relative shrink-0", children: [_jsx(Button, { innerRef: triggerRef, type: "button", variant: "icon", title: "Actions", "aria-label": "Row actions", "aria-haspopup": "menu", "aria-expanded": isOpen, "aria-controls": isOpen ? menuElementId : undefined, onClick: (e) => {
|
|
172
|
+
return (_jsxs("div", { ref: rootRef, className: "hc-row-actions-menu relative shrink-0", children: [_jsx(Button, { innerRef: triggerRef, type: "button", variant: "icon", title: "Actions", "aria-label": "Row actions", "aria-haspopup": "menu", "aria-expanded": isOpen, "aria-controls": isOpen ? menuElementId : undefined, onClick: (e) => {
|
|
173
173
|
e.stopPropagation();
|
|
174
174
|
if (isOpen) {
|
|
175
175
|
closeMenu();
|
|
@@ -33,7 +33,7 @@ export function SegmentedTabs({ tabs, value: valueProp, onChange: onChangeProp,
|
|
|
33
33
|
? (tabValue) => context.getPanelId(tabValue)
|
|
34
34
|
: (tabValue) => `${standaloneId}-panel-${tabValue}`;
|
|
35
35
|
const visibleTabs = tabs.filter((tab) => !tab.hidden);
|
|
36
|
-
const groupClassName = [segmentGroup, fullWidth ? 'w-full' : '', className]
|
|
36
|
+
const groupClassName = ['hc-segmented-tabs', segmentGroup, fullWidth ? 'w-full' : '', className]
|
|
37
37
|
.filter(Boolean)
|
|
38
38
|
.join(' ');
|
|
39
39
|
/**
|
|
@@ -5,7 +5,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "@harborclient/sdk/jsx-runtime";
|
|
|
5
5
|
*/
|
|
6
6
|
export function SidebarLayout({ sidebar, children, className }) {
|
|
7
7
|
const outer = className
|
|
8
|
-
? `flex min-h-0 flex-1 flex-col ${className}`
|
|
9
|
-
: 'flex min-h-0 flex-1 flex-col';
|
|
8
|
+
? `hc-sidebar-layout flex min-h-0 flex-1 flex-col ${className}`
|
|
9
|
+
: 'hc-sidebar-layout flex min-h-0 flex-1 flex-col';
|
|
10
10
|
return (_jsx("div", { className: outer, children: _jsxs("div", { className: "flex min-h-0 flex-1", children: [sidebar, _jsx("div", { className: "flex-1 overflow-y-auto p-6 pt-0!", children: children })] }) }));
|
|
11
11
|
}
|
|
@@ -16,7 +16,7 @@ function sizeClasses(size) {
|
|
|
16
16
|
* @param className - Extra classes on the wrapper span.
|
|
17
17
|
*/
|
|
18
18
|
export function Spinner({ size = 'md', label, className }) {
|
|
19
|
-
const wrapperBase = 'inline-flex items-center justify-center';
|
|
19
|
+
const wrapperBase = 'hc-spinner inline-flex items-center justify-center';
|
|
20
20
|
const wrapperClasses = className ? `${wrapperBase} ${className}` : wrapperBase;
|
|
21
21
|
return (_jsx("span", { className: wrapperClasses, role: label ? 'status' : undefined, "aria-label": label, children: _jsxs("svg", { className: `${sizeClasses(size)} animate-spin text-accent`, viewBox: "0 0 24 24", fill: "none", "aria-hidden": label ? true : undefined, children: [_jsx("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }), _jsx("path", { className: "opacity-75", fill: "currentColor", d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z" })] }) }));
|
|
22
22
|
}
|
|
@@ -7,7 +7,7 @@ import { jsx as _jsx } from "@harborclient/sdk/jsx-runtime";
|
|
|
7
7
|
* @param className - Extra classes appended after the preset.
|
|
8
8
|
*/
|
|
9
9
|
export function StatusMessage({ children, live = true, id, className }) {
|
|
10
|
-
const base = 'text-[14px] text-muted';
|
|
10
|
+
const base = 'hc-status-message text-[14px] text-muted';
|
|
11
11
|
const classes = className ? `${base} ${className}` : base;
|
|
12
12
|
return (_jsx("p", { id: id, className: classes, role: live ? 'status' : undefined, "aria-live": live ? 'polite' : undefined, children: children }));
|
|
13
13
|
}
|
|
@@ -9,5 +9,5 @@ import { FaIcon } from '../FaIcon/index.js';
|
|
|
9
9
|
* @param title - Optional native tooltip text.
|
|
10
10
|
*/
|
|
11
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 hover:bg-selection hover:text-text focus-visible:bg-selection focus-visible:text-text app-no-drag", title: title, "aria-label": ariaLabel, onClick: onClick, children: _jsx(FaIcon, { icon: faXmark, className: "h-3.5 w-3.5" }) }));
|
|
12
|
+
return (_jsx("button", { type: "button", className: "hc-tab-close-button inline-flex aspect-square shrink-0 cursor-pointer items-center justify-center self-stretch rounded-md border-none bg-transparent text-[14px] text-muted hover:bg-selection hover:text-text focus-visible:bg-selection focus-visible: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
13
|
}
|
|
@@ -44,11 +44,11 @@ function mergeClasses(base, className) {
|
|
|
44
44
|
*/
|
|
45
45
|
export function Table({ children, variant = 'bordered', className }) {
|
|
46
46
|
if (variant === 'loose') {
|
|
47
|
-
const tableBase = 'w-full border-separate border-spacing-x-1.5 border-spacing-y-1.5';
|
|
47
|
+
const tableBase = 'hc-table w-full border-separate border-spacing-x-1.5 border-spacing-y-1.5';
|
|
48
48
|
const tableClasses = className ? `${tableBase} ${className}` : tableBase;
|
|
49
49
|
return createElement(TableVariantContext.Provider, { value: variant }, createElement('table', { className: tableClasses }, children));
|
|
50
50
|
}
|
|
51
|
-
const wrapperBase = 'overflow-hidden rounded-md border border-separator';
|
|
51
|
+
const wrapperBase = 'hc-table overflow-hidden rounded-md border border-separator';
|
|
52
52
|
const wrapperClasses = className ? `${wrapperBase} ${className}` : wrapperBase;
|
|
53
53
|
return createElement(TableVariantContext.Provider, { value: variant }, createElement('div', { className: wrapperClasses }, createElement('table', { className: 'w-full border-collapse' }, children)));
|
|
54
54
|
}
|
|
@@ -1 +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;AAS/C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAYnE,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;IAE3B;;OAEG;IACH,MAAM,CAAC,EAAE,kBAAkB,CAAC;CAC7B;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,EACjC,MAAM,EACP,EAAE,KAAK,GAAG,GAAG,CAAC,OAAO,
|
|
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;AAS/C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAYnE,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;IAE3B;;OAEG;IACH,MAAM,CAAC,EAAE,kBAAkB,CAAC;CAC7B;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,EACjC,MAAM,EACP,EAAE,KAAK,GAAG,GAAG,CAAC,OAAO,CA6SrB"}
|
|
@@ -161,7 +161,9 @@ export function VariableInput({ value, onChange, variables, placeholder, onKeyDo
|
|
|
161
161
|
}
|
|
162
162
|
};
|
|
163
163
|
const tooltipContent = tooltip ? getVariableTooltipContent(tooltip.key, variables) : null;
|
|
164
|
-
return (_jsxs("div", { className: wrapperClassName
|
|
164
|
+
return (_jsxs("div", { className: wrapperClassName
|
|
165
|
+
? `hc-variable-input relative min-w-0 ${wrapperClassName}`
|
|
166
|
+
: 'hc-variable-input 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: safeValue ? (tokens.map((token, index) => token.key ? (_jsx("span", { ref: (el) => {
|
|
165
167
|
if (el)
|
|
166
168
|
spanRefs.current.set(index, el);
|
|
167
169
|
else
|
|
@@ -39,5 +39,5 @@ export function VariableTable({ variables, onChange, description }) {
|
|
|
39
39
|
}
|
|
40
40
|
onChange(variables.filter((_, i) => i !== index));
|
|
41
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, { variant: "loose", children: [_jsx(TableHeader, { children: _jsxs("tr", { children: [_jsx(TableHead, { children: "Key" }), _jsx(TableHead, { children: "Value" }), _jsx(TableHead, { children: "Default" }), _jsx(TableHead, { className: "w-14 text-center", children: "Share" }), _jsx(TableHead, { className: "w-7 p-0 text-center" })] }) }), _jsx(TableBody, { children: variables.map((variable, index) => (_jsxs("tr", { children: [_jsx(TableCell, { 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(TableCell, { 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(TableCell, { 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(TableCell, { className: "w-14 text-center", children: _jsx(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(TableCell, { className: "w-7 p-0 text-center", children: _jsx(Button, { type: "button", variant: "iconDanger", onClick: () => removeVariable(index), title: "Remove", "aria-label": `Remove row ${index + 1}`, 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"] })] })] }));
|
|
42
|
+
return (_jsxs("div", { className: "hc-variable-table", 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, { variant: "loose", children: [_jsx(TableHeader, { children: _jsxs("tr", { children: [_jsx(TableHead, { children: "Key" }), _jsx(TableHead, { children: "Value" }), _jsx(TableHead, { children: "Default" }), _jsx(TableHead, { className: "w-14 text-center", children: "Share" }), _jsx(TableHead, { className: "w-7 p-0 text-center" })] }) }), _jsx(TableBody, { children: variables.map((variable, index) => (_jsxs("tr", { children: [_jsx(TableCell, { 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(TableCell, { 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(TableCell, { 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(TableCell, { className: "w-14 text-center", children: _jsx(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(TableCell, { className: "w-7 p-0 text-center", children: _jsx(Button, { type: "button", variant: "iconDanger", onClick: () => removeVariable(index), title: "Remove", "aria-label": `Remove row ${index + 1}`, 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
43
|
}
|
|
@@ -5,7 +5,7 @@ import { checkboxBox, checkboxInput } from './classes.js';
|
|
|
5
5
|
*/
|
|
6
6
|
export function Checkbox({ ref, className, ...props }) {
|
|
7
7
|
const wrapperClasses = className
|
|
8
|
-
? `relative inline-flex h-[18px] w-[18px] shrink-0 leading-none ${className}`
|
|
9
|
-
: 'relative inline-flex h-[18px] w-[18px] shrink-0 leading-none';
|
|
8
|
+
? `hc-checkbox relative inline-flex h-[18px] w-[18px] shrink-0 leading-none ${className}`
|
|
9
|
+
: 'hc-checkbox relative inline-flex h-[18px] w-[18px] shrink-0 leading-none';
|
|
10
10
|
return (_jsxs("span", { className: wrapperClasses, children: [_jsx("input", { ref: ref, type: "checkbox", className: checkboxInput, ...props }), _jsx("span", { className: checkboxBox, "aria-hidden": true, children: _jsx("svg", { className: "h-3 w-3", viewBox: "0 0 12 12", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: _jsx("path", { d: "M2.5 6L5 8.5L9.5 3.5", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) }) })] }));
|
|
11
11
|
}
|
|
@@ -5,5 +5,5 @@ import { mergeFieldClasses } from './classes.js';
|
|
|
5
5
|
*/
|
|
6
6
|
export function Input({ ref, variant = 'control', type, className, ...props }) {
|
|
7
7
|
const resolvedVariant = type === 'checkbox' || type === 'radio' ? 'plain' : variant;
|
|
8
|
-
return (_jsx("input", { ref: ref, type: type, className: mergeFieldClasses(resolvedVariant, className), ...props }));
|
|
8
|
+
return (_jsx("input", { ref: ref, type: type, className: mergeFieldClasses(resolvedVariant, className, 'hc-input'), ...props }));
|
|
9
9
|
}
|
|
@@ -5,7 +5,7 @@ import { radioCircle, radioInput } from './classes.js';
|
|
|
5
5
|
*/
|
|
6
6
|
export function Radio({ ref, className, ...props }) {
|
|
7
7
|
const wrapperClasses = className
|
|
8
|
-
? `relative inline-flex h-[18px] w-[18px] shrink-0 leading-none ${className}`
|
|
9
|
-
: 'relative inline-flex h-[18px] w-[18px] shrink-0 leading-none';
|
|
8
|
+
? `hc-radio relative inline-flex h-[18px] w-[18px] shrink-0 leading-none ${className}`
|
|
9
|
+
: 'hc-radio relative inline-flex h-[18px] w-[18px] shrink-0 leading-none';
|
|
10
10
|
return (_jsxs("span", { className: wrapperClasses, children: [_jsx("input", { ref: ref, type: "radio", className: radioInput, ...props }), _jsx("span", { className: radioCircle, "aria-hidden": true, children: _jsx("span", { className: "h-2 w-2 rounded-full bg-accent" }) })] }));
|
|
11
11
|
}
|
|
@@ -6,5 +6,5 @@ import { mergeFieldClasses } from './classes.js';
|
|
|
6
6
|
* Children should be plain `<option>` elements.
|
|
7
7
|
*/
|
|
8
8
|
export function Select({ ref, variant = 'control', className, children, ...props }) {
|
|
9
|
-
return (_jsx("select", { ref: ref, className: mergeFieldClasses(variant, className), ...props, children: children }));
|
|
9
|
+
return (_jsx("select", { ref: ref, className: mergeFieldClasses(variant, className, 'hc-select'), ...props, children: children }));
|
|
10
10
|
}
|
|
@@ -1 +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,
|
|
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,CAQ9F"}
|
|
@@ -4,5 +4,5 @@ import { mergeFieldClasses } from './classes.js';
|
|
|
4
4
|
* macOS-style multiline input with shared field styling presets.
|
|
5
5
|
*/
|
|
6
6
|
export function Textarea({ ref, variant = 'control', className, ...props }) {
|
|
7
|
-
return _jsx("textarea", { ref: ref, className: mergeFieldClasses(variant, className), ...props });
|
|
7
|
+
return (_jsx("textarea", { ref: ref, className: mergeFieldClasses(variant, className, 'hc-textarea'), ...props }));
|
|
8
8
|
}
|
|
@@ -26,7 +26,8 @@ export declare const radioCircle = "pointer-events-none flex h-[18px] w-[18px] s
|
|
|
26
26
|
*
|
|
27
27
|
* @param variant - Base styling preset; `plain` applies no preset classes.
|
|
28
28
|
* @param className - Additional Tailwind classes appended after the preset.
|
|
29
|
-
* @
|
|
29
|
+
* @param rootClass - Stable component root class prepended to the result.
|
|
30
|
+
* @returns Combined class string, or undefined when all inputs are empty.
|
|
30
31
|
*/
|
|
31
|
-
export declare function mergeFieldClasses(variant: FieldVariant, className?: string): string | undefined;
|
|
32
|
+
export declare function mergeFieldClasses(variant: FieldVariant, className?: string, rootClass?: string): string | undefined;
|
|
32
33
|
//# sourceMappingURL=classes.d.ts.map
|
|
@@ -1 +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;AAEvF,uEAAuE;AACvE,eAAO,MAAM,aAAa,iGACsE,CAAC;AAEjG,qGAAqG;AACrG,eAAO,MAAM,WAAW,qaAC4Y,CAAC;AAEra,oEAAoE;AACpE,eAAO,MAAM,UAAU,iGACyE,CAAC;AAEjG,kGAAkG;AAClG,eAAO,MAAM,WAAW,0YACiX,CAAC;AAO1Y
|
|
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;AAEvF,uEAAuE;AACvE,eAAO,MAAM,aAAa,iGACsE,CAAC;AAEjG,qGAAqG;AACrG,eAAO,MAAM,WAAW,qaAC4Y,CAAC;AAEra,oEAAoE;AACpE,eAAO,MAAM,UAAU,iGACyE,CAAC;AAEjG,kGAAkG;AAClG,eAAO,MAAM,WAAW,0YACiX,CAAC;AAO1Y;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,YAAY,EACrB,SAAS,CAAC,EAAE,MAAM,EAClB,SAAS,CAAC,EAAE,MAAM,GACjB,MAAM,GAAG,SAAS,CAOpB"}
|
|
@@ -26,15 +26,13 @@ const VARIANT_CLASSES = {
|
|
|
26
26
|
*
|
|
27
27
|
* @param variant - Base styling preset; `plain` applies no preset classes.
|
|
28
28
|
* @param className - Additional Tailwind classes appended after the preset.
|
|
29
|
-
* @
|
|
29
|
+
* @param rootClass - Stable component root class prepended to the result.
|
|
30
|
+
* @returns Combined class string, or undefined when all inputs are empty.
|
|
30
31
|
*/
|
|
31
|
-
export function mergeFieldClasses(variant, className) {
|
|
32
|
+
export function mergeFieldClasses(variant, className, rootClass) {
|
|
32
33
|
const base = variant === 'plain' ? '' : VARIANT_CLASSES[variant];
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
if (className)
|
|
38
|
-
return className;
|
|
39
|
-
return undefined;
|
|
34
|
+
const parts = [rootClass, base, className].filter((part) => part != null && part !== '');
|
|
35
|
+
if (parts.length === 0)
|
|
36
|
+
return undefined;
|
|
37
|
+
return parts.join(' ');
|
|
40
38
|
}
|