@harborclient/sdk 1.0.29 → 1.0.31
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/build/index.d.ts.map +1 -1
- package/dist/build/index.js +1 -1
- package/dist/components/AsyncListState/ErrorRetry.d.ts +21 -0
- package/dist/components/AsyncListState/ErrorRetry.d.ts.map +1 -0
- package/dist/components/AsyncListState/ErrorRetry.js +10 -0
- package/dist/components/AsyncListState/LoadingMessage.d.ts +13 -0
- package/dist/components/AsyncListState/LoadingMessage.d.ts.map +1 -0
- package/dist/components/AsyncListState/LoadingMessage.js +8 -0
- package/dist/components/AsyncListState/index.d.ts +4 -50
- package/dist/components/AsyncListState/index.d.ts.map +1 -1
- package/dist/components/AsyncListState/index.js +5 -31
- package/dist/components/Autocomplete/AutocompleteInput.d.ts +2 -4
- package/dist/components/Autocomplete/AutocompleteInput.d.ts.map +1 -1
- package/dist/components/Autocomplete/AutocompleteInput.js +2 -1
- package/dist/components/Autocomplete/SuggestionList.d.ts +3 -7
- package/dist/components/Autocomplete/SuggestionList.d.ts.map +1 -1
- package/dist/components/Autocomplete/SuggestionList.js +3 -4
- package/dist/components/BackButton/index.d.ts +3 -16
- package/dist/components/BackButton/index.d.ts.map +1 -1
- package/dist/components/BackButton/index.js +4 -10
- package/dist/components/Badge/index.d.ts +3 -11
- package/dist/components/Badge/index.d.ts.map +1 -1
- package/dist/components/Badge/index.js +3 -9
- package/dist/components/BusyIndicator/index.js +1 -1
- package/dist/components/Button/index.d.ts +2 -6
- package/dist/components/Button/index.d.ts.map +1 -1
- package/dist/components/Button/index.js +9 -15
- package/dist/components/Card/Body.d.ts +12 -0
- package/dist/components/Card/Body.d.ts.map +1 -0
- package/dist/components/Card/Body.js +8 -0
- package/dist/components/Card/Image.d.ts +8 -0
- package/dist/components/Card/Image.d.ts.map +1 -0
- package/dist/components/Card/Image.js +8 -0
- package/dist/components/Card/index.d.ts +16 -0
- package/dist/components/Card/index.d.ts.map +1 -0
- package/dist/components/Card/index.js +13 -0
- package/dist/components/CodeEditor/index.d.ts +3 -7
- package/dist/components/CodeEditor/index.d.ts.map +1 -1
- package/dist/components/CodeEditor/index.js +5 -50
- package/dist/components/CodeEditor/renderHighlightedPlaceholder.d.ts.map +1 -1
- package/dist/components/CodeEditor/slashCommandHighlighter.d.ts.map +1 -1
- package/dist/components/CodeEditor/syntaxHighlightedPlaceholder.d.ts.map +1 -1
- package/dist/components/EmptyState/index.d.ts +3 -11
- package/dist/components/EmptyState/index.d.ts.map +1 -1
- package/dist/components/EmptyState/index.js +3 -9
- package/dist/components/FaIcon/index.d.ts +3 -10
- package/dist/components/FaIcon/index.d.ts.map +1 -1
- package/dist/components/FaIcon/index.js +5 -4
- package/dist/components/FieldError/index.d.ts +3 -17
- package/dist/components/FieldError/index.d.ts.map +1 -1
- package/dist/components/FieldError/index.js +3 -11
- package/dist/components/FooterButton/index.d.ts +3 -11
- package/dist/components/FooterButton/index.d.ts.map +1 -1
- package/dist/components/FooterButton/index.js +3 -7
- package/dist/components/FooterIcon/index.d.ts +3 -11
- package/dist/components/FooterIcon/index.d.ts.map +1 -1
- package/dist/components/FooterIcon/index.js +3 -7
- package/dist/components/FormDataEditor/index.d.ts +0 -2
- package/dist/components/FormDataEditor/index.d.ts.map +1 -1
- package/dist/components/FormDataEditor/index.js +2 -12
- package/dist/components/FormGroup/index.d.ts +3 -16
- package/dist/components/FormGroup/index.d.ts.map +1 -1
- package/dist/components/FormGroup/index.js +4 -20
- package/dist/components/KeyValueEditor/index.d.ts +0 -2
- package/dist/components/KeyValueEditor/index.d.ts.map +1 -1
- package/dist/components/KeyValueEditor/index.js +1 -8
- package/dist/components/MethodSelect/index.d.ts +3 -5
- package/dist/components/MethodSelect/index.d.ts.map +1 -1
- package/dist/components/MethodSelect/index.js +3 -2
- package/dist/components/Modal/ModalFooter.d.ts +3 -11
- package/dist/components/Modal/ModalFooter.d.ts.map +1 -1
- package/dist/components/Modal/ModalFooter.js +3 -10
- package/dist/components/Modal/ModalFormLayout.d.ts +0 -5
- package/dist/components/Modal/ModalFormLayout.d.ts.map +1 -1
- package/dist/components/Modal/ModalFormLayout.js +0 -5
- package/dist/components/Modal/ModalHeader.d.ts +3 -3
- package/dist/components/Modal/ModalHeader.d.ts.map +1 -1
- package/dist/components/Modal/ModalHeader.js +3 -2
- package/dist/components/Modal/index.d.ts +3 -3
- package/dist/components/Modal/index.d.ts.map +1 -1
- package/dist/components/Modal/index.js +6 -7
- package/dist/components/OverlayCloseButton/index.d.ts +3 -11
- package/dist/components/OverlayCloseButton/index.d.ts.map +1 -1
- package/dist/components/OverlayCloseButton/index.js +3 -9
- package/dist/components/Page/index.d.ts +3 -3
- package/dist/components/Page/index.d.ts.map +1 -1
- package/dist/components/Page/index.js +4 -7
- package/dist/components/PageHeader/index.d.ts +3 -7
- package/dist/components/PageHeader/index.d.ts.map +1 -1
- package/dist/components/PageHeader/index.js +3 -5
- package/dist/components/PageSidebar/index.d.ts +3 -5
- package/dist/components/PageSidebar/index.d.ts.map +1 -1
- package/dist/components/PageSidebar/index.js +4 -5
- package/dist/components/PanelCloseButton/index.d.ts +5 -14
- package/dist/components/PanelCloseButton/index.d.ts.map +1 -1
- package/dist/components/PanelCloseButton/index.js +4 -12
- package/dist/components/Resizable/Resizable.d.ts +3 -3
- package/dist/components/Resizable/Resizable.d.ts.map +1 -1
- package/dist/components/Resizable/Resizable.js +6 -5
- package/dist/components/Resizable/ResizeHandle.d.ts +3 -7
- package/dist/components/Resizable/ResizeHandle.d.ts.map +1 -1
- package/dist/components/Resizable/ResizeHandle.js +4 -10
- package/dist/components/ResourceList/ResourceListEmptyItem.d.ts +13 -0
- package/dist/components/ResourceList/ResourceListEmptyItem.d.ts.map +1 -0
- package/dist/components/ResourceList/ResourceListEmptyItem.js +8 -0
- package/dist/components/ResourceList/ResourceListPrimary.d.ts +13 -0
- package/dist/components/ResourceList/ResourceListPrimary.d.ts.map +1 -0
- package/dist/components/ResourceList/ResourceListPrimary.js +8 -0
- package/dist/components/ResourceList/ResourceListRow.d.ts +29 -0
- package/dist/components/ResourceList/ResourceListRow.d.ts.map +1 -0
- package/dist/components/ResourceList/ResourceListRow.js +8 -0
- package/dist/components/ResourceList/index.d.ts +6 -74
- package/dist/components/ResourceList/index.d.ts.map +1 -1
- package/dist/components/ResourceList/index.js +7 -42
- package/dist/components/RowActionsMenu/index.d.ts +3 -5
- package/dist/components/RowActionsMenu/index.d.ts.map +1 -1
- package/dist/components/RowActionsMenu/index.js +6 -16
- package/dist/components/SegmentedTabs/SegmentedTabPanel.d.ts +3 -7
- package/dist/components/SegmentedTabs/SegmentedTabPanel.d.ts.map +1 -1
- package/dist/components/SegmentedTabs/SegmentedTabPanel.js +3 -4
- package/dist/components/SegmentedTabs/SegmentedTabsGroup.d.ts +0 -2
- package/dist/components/SegmentedTabs/SegmentedTabsGroup.d.ts.map +1 -1
- package/dist/components/SegmentedTabs/SegmentedTabsVisibilityMenu.d.ts +0 -2
- package/dist/components/SegmentedTabs/SegmentedTabsVisibilityMenu.d.ts.map +1 -1
- package/dist/components/SegmentedTabs/SegmentedTabsVisibilityMenu.js +5 -13
- package/dist/components/SegmentedTabs/index.d.ts +3 -7
- package/dist/components/SegmentedTabs/index.d.ts.map +1 -1
- package/dist/components/SegmentedTabs/index.js +7 -28
- package/dist/components/SidebarLayout/index.d.ts +3 -7
- package/dist/components/SidebarLayout/index.d.ts.map +1 -1
- package/dist/components/SidebarLayout/index.js +3 -5
- package/dist/components/Spinner/index.d.ts +3 -11
- package/dist/components/Spinner/index.d.ts.map +1 -1
- package/dist/components/Spinner/index.js +3 -9
- package/dist/components/StatusMessage/index.d.ts +3 -15
- package/dist/components/StatusMessage/index.d.ts.map +1 -1
- package/dist/components/StatusMessage/index.js +3 -8
- package/dist/components/TabCloseButton/index.d.ts +4 -14
- package/dist/components/TabCloseButton/index.d.ts.map +1 -1
- package/dist/components/TabCloseButton/index.js +3 -7
- package/dist/components/Table/TableBody.d.ts +13 -0
- package/dist/components/Table/TableBody.d.ts.map +1 -0
- package/dist/components/Table/TableBody.js +11 -0
- package/dist/components/Table/TableCell.d.ts +8 -0
- package/dist/components/Table/TableCell.d.ts.map +1 -0
- package/dist/components/Table/TableCell.js +11 -0
- package/dist/components/Table/TableContext.d.ts +22 -0
- package/dist/components/Table/TableContext.d.ts.map +1 -0
- package/dist/components/Table/TableContext.js +18 -0
- package/dist/components/Table/TableHead.d.ts +8 -0
- package/dist/components/Table/TableHead.d.ts.map +1 -0
- package/dist/components/Table/TableHead.js +11 -0
- package/dist/components/Table/TableHeader.d.ts +13 -0
- package/dist/components/Table/TableHeader.d.ts.map +1 -0
- package/dist/components/Table/TableHeader.js +8 -0
- package/dist/components/Table/index.d.ts +10 -86
- package/dist/components/Table/index.d.ts.map +1 -1
- package/dist/components/Table/index.js +17 -94
- package/dist/components/Toolbar/index.d.ts +3 -11
- package/dist/components/Toolbar/index.d.ts.map +1 -1
- package/dist/components/Toolbar/index.js +3 -11
- package/dist/components/VariableInput/index.d.ts +3 -5
- package/dist/components/VariableInput/index.d.ts.map +1 -1
- package/dist/components/VariableInput/index.js +6 -17
- package/dist/components/VariableTable/index.d.ts +3 -3
- package/dist/components/VariableTable/index.d.ts.map +1 -1
- package/dist/components/VariableTable/index.js +5 -9
- package/dist/components/forms/Checkbox.d.ts +2 -2
- package/dist/components/forms/Checkbox.d.ts.map +1 -1
- package/dist/components/forms/Checkbox.js +2 -4
- package/dist/components/forms/Input.d.ts +2 -2
- package/dist/components/forms/Input.d.ts.map +1 -1
- package/dist/components/forms/Radio.d.ts +2 -2
- package/dist/components/forms/Radio.d.ts.map +1 -1
- package/dist/components/forms/Radio.js +2 -4
- package/dist/components/forms/Select.d.ts +2 -2
- package/dist/components/forms/Select.d.ts.map +1 -1
- package/dist/components/forms/Textarea.d.ts +2 -2
- package/dist/components/forms/Textarea.d.ts.map +1 -1
- package/dist/components/forms/classes.d.ts +0 -3
- package/dist/components/forms/classes.d.ts.map +1 -1
- package/dist/components/forms/classes.js +3 -9
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +1 -0
- package/dist/components/utils.d.ts +8 -0
- package/dist/components/utils.d.ts.map +1 -1
- package/dist/components/utils.js +11 -0
- package/dist/runtime/createBridgedPluginContext.js +1 -1
- package/dist/runtime/index.js +1 -1
- package/dist/runtime/react.d.ts +2 -2
- package/dist/runtime/view-host/index.js +1 -1
- package/dist/runtime/viewHost.js +1 -1
- package/dist/signing/inventory.js +1 -1
- package/package.json +7 -3
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "@harborclient/sdk/jsx-runtime";
|
|
2
|
+
import { faBars } from '@fortawesome/free-solid-svg-icons';
|
|
2
3
|
import { useCallback, useEffect, useMemo, useRef, useState } from '@harborclient/sdk/react';
|
|
3
4
|
import { Button } from '../Button/index.js';
|
|
4
5
|
import { FaIcon } from '../FaIcon/index.js';
|
|
5
|
-
import {
|
|
6
|
-
import { resolveMenuTypeahead, resolveTabListKeyAction } from '../utils.js';
|
|
6
|
+
import { cn, resolveMenuTypeahead, resolveTabListKeyAction } from '../utils.js';
|
|
7
7
|
const TYPEAHEAD_TIMEOUT_MS = 500;
|
|
8
8
|
/**
|
|
9
9
|
* Tailwind classes for a single menu item button.
|
|
10
|
-
*
|
|
11
|
-
* @param variant - Visual variant for default or destructive actions.
|
|
12
10
|
*/
|
|
13
11
|
function menuItemClass(variant) {
|
|
14
12
|
const base = 'block w-full cursor-pointer border-none bg-transparent px-3.5 py-1.5 text-left text-[16px] app-no-drag';
|
|
@@ -19,7 +17,7 @@ function menuItemClass(variant) {
|
|
|
19
17
|
/**
|
|
20
18
|
* Hamburger-triggered dropdown for row-level actions (rename, delete, etc.).
|
|
21
19
|
*/
|
|
22
|
-
export function RowActionsMenu({ groups, menuId, openMenuId, onOpenChange }) {
|
|
20
|
+
export function RowActionsMenu({ groups, menuId, openMenuId, onOpenChange, className, ...props }) {
|
|
23
21
|
const isOpen = openMenuId === menuId;
|
|
24
22
|
const menuElementId = `${menuId}-menu`;
|
|
25
23
|
const rootRef = useRef(null);
|
|
@@ -53,8 +51,6 @@ export function RowActionsMenu({ groups, menuId, openMenuId, onOpenChange }) {
|
|
|
53
51
|
}, [clearTypeahead, onOpenChange]);
|
|
54
52
|
/**
|
|
55
53
|
* Focuses a menu item by index and updates roving tabindex state.
|
|
56
|
-
*
|
|
57
|
-
* @param index - Flat index of the menu item to focus.
|
|
58
54
|
*/
|
|
59
55
|
const focusItem = useCallback((index) => {
|
|
60
56
|
setFocusedIndex(index);
|
|
@@ -64,8 +60,6 @@ export function RowActionsMenu({ groups, menuId, openMenuId, onOpenChange }) {
|
|
|
64
60
|
}, []);
|
|
65
61
|
/**
|
|
66
62
|
* Opens the menu and focuses the first or last item.
|
|
67
|
-
*
|
|
68
|
-
* @param focusLast - When true, focus the last item instead of the first.
|
|
69
63
|
*/
|
|
70
64
|
const openMenu = useCallback((focusLast = false) => {
|
|
71
65
|
if (flatItems.length === 0)
|
|
@@ -120,8 +114,6 @@ export function RowActionsMenu({ groups, menuId, openMenuId, onOpenChange }) {
|
|
|
120
114
|
}, [closeMenu, isOpen]);
|
|
121
115
|
/**
|
|
122
116
|
* Handles keyboard interaction on the menu trigger when closed.
|
|
123
|
-
*
|
|
124
|
-
* @param event - Keyboard event from the trigger button.
|
|
125
117
|
*/
|
|
126
118
|
const handleTriggerKeyDown = (event) => {
|
|
127
119
|
if (isOpen)
|
|
@@ -138,8 +130,6 @@ export function RowActionsMenu({ groups, menuId, openMenuId, onOpenChange }) {
|
|
|
138
130
|
};
|
|
139
131
|
/**
|
|
140
132
|
* Handles keyboard navigation within the open menu.
|
|
141
|
-
*
|
|
142
|
-
* @param event - Keyboard event from the menu container.
|
|
143
133
|
*/
|
|
144
134
|
const handleMenuKeyDown = (event) => {
|
|
145
135
|
if (flatItems.length === 0)
|
|
@@ -169,7 +159,7 @@ export function RowActionsMenu({ groups, menuId, openMenuId, onOpenChange }) {
|
|
|
169
159
|
focusItem(typeahead.index);
|
|
170
160
|
}
|
|
171
161
|
};
|
|
172
|
-
return (_jsxs("div", { ref: rootRef, className:
|
|
162
|
+
return (_jsxs("div", { ref: rootRef, ...props, className: cn('hc-row-actions-menu relative shrink-0', className), children: [_jsx(Button, { innerRef: triggerRef, type: "button", variant: "icon", className: "hc-row-actions-menu-trigger", title: "Actions", "aria-label": "Row actions", "aria-haspopup": "menu", "aria-expanded": isOpen, "aria-controls": isOpen ? menuElementId : undefined, onClick: (e) => {
|
|
173
163
|
e.stopPropagation();
|
|
174
164
|
if (isOpen) {
|
|
175
165
|
closeMenu();
|
|
@@ -177,7 +167,7 @@ export function RowActionsMenu({ groups, menuId, openMenuId, onOpenChange }) {
|
|
|
177
167
|
else {
|
|
178
168
|
openMenu(false);
|
|
179
169
|
}
|
|
180
|
-
}, onKeyDown: handleTriggerKeyDown, children: _jsx(FaIcon, { icon: faBars, className: "h-3.5 w-3.5" }) }), isOpen && (_jsx("div", { id: menuElementId, role: "menu", className: "hc-row-actions-menu-panel absolute right-0
|
|
170
|
+
}, onKeyDown: handleTriggerKeyDown, children: _jsx(FaIcon, { icon: faBars, className: "h-3.5 w-3.5" }) }), isOpen && (_jsx("div", { id: menuElementId, role: "menu", className: "hc-row-actions-menu-panel app-no-drag absolute top-full right-0 z-10 mt-0.5 min-w-[200px] rounded-md border border-separator bg-surface py-1 shadow-md", onKeyDown: handleMenuKeyDown, children: groups.map((group, groupIndex) => {
|
|
181
171
|
let flatIndex = groups.slice(0, groupIndex).reduce((count, g) => count + g.length, 0);
|
|
182
172
|
return (_jsx("div", { className: groupIndex > 0
|
|
183
173
|
? 'hc-row-actions-menu-group border-t border-separator'
|
|
@@ -185,7 +175,7 @@ export function RowActionsMenu({ groups, menuId, openMenuId, onOpenChange }) {
|
|
|
185
175
|
const itemIndex = flatIndex++;
|
|
186
176
|
return (_jsx("button", { ref: (el) => {
|
|
187
177
|
itemRefs.current[itemIndex] = el;
|
|
188
|
-
}, type: "button", role: "menuitem", tabIndex: itemIndex === focusedIndex ? 0 : -1, className:
|
|
178
|
+
}, type: "button", role: "menuitem", tabIndex: itemIndex === focusedIndex ? 0 : -1, className: cn('hc-row-actions-menu-item', menuItemClass(item.variant)), onClick: (e) => {
|
|
189
179
|
e.stopPropagation();
|
|
190
180
|
closeMenu();
|
|
191
181
|
item.onSelect();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { JSX, ReactNode } from 'react';
|
|
2
|
-
interface Props<T extends string> {
|
|
1
|
+
import type { ComponentPropsWithoutRef, JSX, ReactNode } from 'react';
|
|
2
|
+
interface Props<T extends string> extends Omit<ComponentPropsWithoutRef<'div'>, 'children'> {
|
|
3
3
|
/**
|
|
4
4
|
* Tab value that controls visibility of this panel.
|
|
5
5
|
*/
|
|
@@ -8,14 +8,10 @@ interface Props<T extends string> {
|
|
|
8
8
|
* Panel content shown when this tab is selected.
|
|
9
9
|
*/
|
|
10
10
|
children: ReactNode;
|
|
11
|
-
/**
|
|
12
|
-
* Additional CSS classes for the panel container.
|
|
13
|
-
*/
|
|
14
|
-
className?: string;
|
|
15
11
|
}
|
|
16
12
|
/**
|
|
17
13
|
* Renders a WAI-ARIA tab panel linked to the matching tab in the parent group.
|
|
18
14
|
*/
|
|
19
|
-
export declare function SegmentedTabPanel<T extends string>({ value, children, className }: Props<T>): JSX.Element | null;
|
|
15
|
+
export declare function SegmentedTabPanel<T extends string>({ value, children, className, ...props }: Props<T>): JSX.Element | null;
|
|
20
16
|
export {};
|
|
21
17
|
//# sourceMappingURL=SegmentedTabPanel.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SegmentedTabPanel.d.ts","sourceRoot":"","sources":["../../../src/components/SegmentedTabs/SegmentedTabPanel.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,GAAG,EAAiB,SAAS,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"SegmentedTabPanel.d.ts","sourceRoot":"","sources":["../../../src/components/SegmentedTabs/SegmentedTabPanel.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,wBAAwB,EAAE,GAAG,EAAiB,SAAS,EAAE,MAAM,OAAO,CAAC;AAIrF,UAAU,KAAK,CAAC,CAAC,SAAS,MAAM,CAAE,SAAQ,IAAI,CAAC,wBAAwB,CAAC,KAAK,CAAC,EAAE,UAAU,CAAC;IACzF;;OAEG;IACH,KAAK,EAAE,CAAC,CAAC;IAET;;OAEG;IACH,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,CAAC,SAAS,MAAM,EAAE,EAClD,KAAK,EACL,QAAQ,EACR,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,OAAO,GAAG,IAAI,CA2C/B"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { jsx as _jsx } from "@harborclient/sdk/jsx-runtime";
|
|
2
2
|
import { useCallback, useContext } from '@harborclient/sdk/react';
|
|
3
|
+
import { cn } from '../utils.js';
|
|
3
4
|
import { SegmentedTabsContext } from './SegmentedTabsContext.js';
|
|
4
5
|
/**
|
|
5
6
|
* Renders a WAI-ARIA tab panel linked to the matching tab in the parent group.
|
|
6
7
|
*/
|
|
7
|
-
export function SegmentedTabPanel({ value, children, className }) {
|
|
8
|
+
export function SegmentedTabPanel({ value, children, className, ...props }) {
|
|
8
9
|
const context = useContext(SegmentedTabsContext);
|
|
9
10
|
if (!context) {
|
|
10
11
|
throw new Error('SegmentedTabPanel must be used within SegmentedTabsGroup');
|
|
@@ -12,8 +13,6 @@ export function SegmentedTabPanel({ value, children, className }) {
|
|
|
12
13
|
/**
|
|
13
14
|
* Moves focus back to the owning tab when ArrowUp is pressed inside the panel,
|
|
14
15
|
* except inside CodeMirror editors where Up should edit text.
|
|
15
|
-
*
|
|
16
|
-
* @param event - Keyboard event from the tab panel container.
|
|
17
16
|
*/
|
|
18
17
|
const handleKeyDown = useCallback((event) => {
|
|
19
18
|
if (event.key !== 'ArrowUp' || event.defaultPrevented)
|
|
@@ -32,5 +31,5 @@ export function SegmentedTabPanel({ value, children, className }) {
|
|
|
32
31
|
}, [context, value]);
|
|
33
32
|
if (context.value !== value)
|
|
34
33
|
return null;
|
|
35
|
-
return (_jsx("div", { role: "tabpanel", id: context.getPanelId(value), "aria-labelledby": context.getTabId(value), className:
|
|
34
|
+
return (_jsx("div", { ...props, role: "tabpanel", id: context.getPanelId(value), "aria-labelledby": context.getTabId(value), className: cn('hc-segmented-tab-panel', className), onKeyDown: handleKeyDown, children: children }));
|
|
36
35
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SegmentedTabsGroup.d.ts","sourceRoot":"","sources":["../../../src/components/SegmentedTabs/SegmentedTabsGroup.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAG5C,UAAU,KAAK,CAAC,CAAC,SAAS,MAAM;IAC9B;;OAEG;IACH,KAAK,EAAE,CAAC,CAAC;IAET
|
|
1
|
+
{"version":3,"file":"SegmentedTabsGroup.d.ts","sourceRoot":"","sources":["../../../src/components/SegmentedTabs/SegmentedTabsGroup.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAG5C,UAAU,KAAK,CAAC,CAAC,SAAS,MAAM;IAC9B;;OAEG;IACH,KAAK,EAAE,CAAC,CAAC;IAET;;OAEG;IACH,QAAQ,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,CAAC;IAE7B;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,CAAC,SAAS,MAAM,EAAE,EACnD,KAAK,EACL,QAAQ,EACR,SAAS,EACT,QAAQ,EACT,EAAE,KAAK,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,OAAO,CAmBxB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SegmentedTabsVisibilityMenu.d.ts","sourceRoot":"","sources":["../../../src/components/SegmentedTabs/SegmentedTabsVisibilityMenu.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SegmentedTabsVisibilityMenu.d.ts","sourceRoot":"","sources":["../../../src/components/SegmentedTabs/SegmentedTabsVisibilityMenu.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,GAAG,EAA4B,MAAM,OAAO,CAAC;AAI3D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAE1C,UAAU,KAAK,CAAC,CAAC,SAAS,MAAM;IAC9B;;OAEG;IACH,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC;IAEnB;;OAEG;IACH,gBAAgB,EAAE,CAAC,EAAE,CAAC;IAEtB;;OAEG;IACH,QAAQ,EAAE,CAAC,QAAQ,EAAE,CAAC,KAAK,IAAI,CAAC;CACjC;AAQD;;GAEG;AACH,wBAAgB,2BAA2B,CAAC,CAAC,SAAS,MAAM,EAAE,EAC5D,IAAI,EACJ,gBAAgB,EAChB,QAAQ,EACT,EAAE,KAAK,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,OAAO,CAgLxB"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "@harborclient/sdk/jsx-runtime";
|
|
2
|
-
import { useCallback, useEffect, useId, useRef, useState } from '@harborclient/sdk/react';
|
|
3
2
|
import { faCaretDown, faCheck } from '@fortawesome/free-solid-svg-icons';
|
|
3
|
+
import { useCallback, useEffect, useId, useRef, useState } from '@harborclient/sdk/react';
|
|
4
4
|
import { Button } from '../Button/index.js';
|
|
5
5
|
import { FaIcon } from '../FaIcon/index.js';
|
|
6
|
-
import { resolveTabListKeyAction } from '../utils.js';
|
|
6
|
+
import { cn, resolveTabListKeyAction } from '../utils.js';
|
|
7
7
|
const menuItemClass = 'flex w-full cursor-pointer items-center gap-2 border-none bg-transparent px-3.5 py-1.5 text-left text-[14px] text-text hover:bg-selection app-no-drag';
|
|
8
8
|
const triggerClassName = '!rounded-full hover:!bg-[rgba(0,122,255,0.18)] dark:hover:!bg-[rgba(10,132,255,0.22)]';
|
|
9
9
|
/**
|
|
@@ -30,8 +30,6 @@ export function SegmentedTabsVisibilityMenu({ tabs, visibleTabValues, onToggle }
|
|
|
30
30
|
}, []);
|
|
31
31
|
/**
|
|
32
32
|
* Opens the menu and focuses the first or last item.
|
|
33
|
-
*
|
|
34
|
-
* @param focusLast - When true, focus the last item instead of the first.
|
|
35
33
|
*/
|
|
36
34
|
const openMenu = useCallback((focusLast = false) => {
|
|
37
35
|
if (tabs.length === 0)
|
|
@@ -41,8 +39,6 @@ export function SegmentedTabsVisibilityMenu({ tabs, visibleTabValues, onToggle }
|
|
|
41
39
|
}, [tabs.length]);
|
|
42
40
|
/**
|
|
43
41
|
* Focuses a menu item by index and updates roving tabindex state.
|
|
44
|
-
*
|
|
45
|
-
* @param index - Index of the menu item to focus.
|
|
46
42
|
*/
|
|
47
43
|
const focusItem = useCallback((index) => {
|
|
48
44
|
setFocusedIndex(index);
|
|
@@ -96,8 +92,6 @@ export function SegmentedTabsVisibilityMenu({ tabs, visibleTabValues, onToggle }
|
|
|
96
92
|
}, [closeMenu, isOpen]);
|
|
97
93
|
/**
|
|
98
94
|
* Handles keyboard interaction on the menu trigger when closed.
|
|
99
|
-
*
|
|
100
|
-
* @param event - Keyboard event from the trigger button.
|
|
101
95
|
*/
|
|
102
96
|
const handleTriggerKeyDown = (event) => {
|
|
103
97
|
if (isOpen)
|
|
@@ -114,8 +108,6 @@ export function SegmentedTabsVisibilityMenu({ tabs, visibleTabValues, onToggle }
|
|
|
114
108
|
};
|
|
115
109
|
/**
|
|
116
110
|
* Handles keyboard navigation within the open menu.
|
|
117
|
-
*
|
|
118
|
-
* @param event - Keyboard event from the menu container.
|
|
119
111
|
*/
|
|
120
112
|
const handleMenuKeyDown = (event) => {
|
|
121
113
|
if (tabs.length === 0)
|
|
@@ -130,14 +122,14 @@ export function SegmentedTabsVisibilityMenu({ tabs, visibleTabValues, onToggle }
|
|
|
130
122
|
focusItem(arrowIndex);
|
|
131
123
|
}
|
|
132
124
|
};
|
|
133
|
-
return (_jsxs("div", { ref: rootRef, className: "hc-segmented-tabs-visibility-menu relative shrink-0", children: [_jsx(Button, { innerRef: triggerRef, type: "button", variant: "icon", className:
|
|
125
|
+
return (_jsxs("div", { ref: rootRef, className: "hc-segmented-tabs-visibility-menu relative shrink-0", children: [_jsx(Button, { innerRef: triggerRef, type: "button", variant: "icon", className: cn('hc-segmented-tabs-visibility-menu-trigger', triggerClassName), "aria-label": "Customize visible tabs", "aria-haspopup": "menu", "aria-expanded": isOpen, "aria-controls": isOpen ? menuElementId : undefined, onClick: () => {
|
|
134
126
|
if (isOpen) {
|
|
135
127
|
closeMenu();
|
|
136
128
|
}
|
|
137
129
|
else {
|
|
138
130
|
openMenu(false);
|
|
139
131
|
}
|
|
140
|
-
}, onKeyDown: handleTriggerKeyDown, children: _jsx(FaIcon, { icon: faCaretDown, className: "h-3.5 w-3.5" }) }), isOpen && (_jsx("div", { id: menuElementId, role: "menu", className: "hc-segmented-tabs-visibility-menu-panel absolute right-0
|
|
132
|
+
}, onKeyDown: handleTriggerKeyDown, children: _jsx(FaIcon, { icon: faCaretDown, className: "h-3.5 w-3.5" }) }), isOpen && (_jsx("div", { id: menuElementId, role: "menu", className: "hc-segmented-tabs-visibility-menu-panel app-no-drag absolute top-full right-0 z-10 mt-0.5 min-w-[140px] rounded-md border border-separator bg-surface py-1 shadow-md", onKeyDown: handleMenuKeyDown, children: tabs.map((tab, index) => {
|
|
141
133
|
const checked = visibleSet.has(tab.value);
|
|
142
134
|
return (_jsx(MenuCheckboxItem, { ref: (element) => {
|
|
143
135
|
itemRefs.current[index] = element;
|
|
@@ -148,7 +140,7 @@ export function SegmentedTabsVisibilityMenu({ tabs, visibleTabValues, onToggle }
|
|
|
148
140
|
* Single checkbox-style row in the tab visibility menu.
|
|
149
141
|
*/
|
|
150
142
|
function MenuCheckboxItem({ checked, label, tabIndex, onSelect, ref }) {
|
|
151
|
-
return (_jsxs("button", { ref: ref, type: "button", role: "menuitemcheckbox", "aria-checked": checked, tabIndex: tabIndex, className:
|
|
143
|
+
return (_jsxs("button", { ref: ref, type: "button", role: "menuitemcheckbox", "aria-checked": checked, tabIndex: tabIndex, className: cn('hc-segmented-tabs-visibility-menu-item', menuItemClass), onClick: (e) => {
|
|
152
144
|
e.stopPropagation();
|
|
153
145
|
onSelect();
|
|
154
146
|
}, children: [_jsx("span", { className: "hc-segmented-tabs-visibility-menu-item-check inline-flex w-4 shrink-0 justify-center", "aria-hidden": true, children: checked ? _jsx(FaIcon, { icon: faCheck, className: "h-3 w-3" }) : null }), _jsx("span", { className: "hc-segmented-tabs-visibility-menu-item-label min-w-0", children: label })] }));
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type { JSX } from 'react';
|
|
1
|
+
import type { ComponentPropsWithoutRef, JSX } from 'react';
|
|
2
2
|
import type { TabItem } from './types.js';
|
|
3
3
|
export { SegmentedTabsGroup } from './SegmentedTabsGroup.js';
|
|
4
4
|
export { SegmentedTabPanel } from './SegmentedTabPanel.js';
|
|
5
5
|
export type { TabItem } from './types.js';
|
|
6
|
-
interface Props<T extends string> {
|
|
6
|
+
interface Props<T extends string> extends Omit<ComponentPropsWithoutRef<'div'>, 'children' | 'className' | 'aria-label' | 'onChange'> {
|
|
7
7
|
/**
|
|
8
8
|
* Tab definitions to render.
|
|
9
9
|
*/
|
|
@@ -15,8 +15,6 @@ interface Props<T extends string> {
|
|
|
15
15
|
/**
|
|
16
16
|
* Called when the user selects a different tab. Omit when used inside
|
|
17
17
|
* `SegmentedTabsGroup`.
|
|
18
|
-
*
|
|
19
|
-
* @param value - Newly selected tab value.
|
|
20
18
|
*/
|
|
21
19
|
onChange?: (value: T) => void;
|
|
22
20
|
/**
|
|
@@ -35,8 +33,6 @@ interface Props<T extends string> {
|
|
|
35
33
|
defaultVisibleTabValues?: T[];
|
|
36
34
|
/**
|
|
37
35
|
* Called when the user toggles tab visibility in the edit menu.
|
|
38
|
-
*
|
|
39
|
-
* @param visibleTabValues - Updated visible tab values.
|
|
40
36
|
*/
|
|
41
37
|
onVisibleTabValuesChange?: (visibleTabValues: T[]) => void;
|
|
42
38
|
/**
|
|
@@ -61,5 +57,5 @@ interface Props<T extends string> {
|
|
|
61
57
|
/**
|
|
62
58
|
* macOS-style segmented tab control with WAI-ARIA tabs or radiogroup semantics.
|
|
63
59
|
*/
|
|
64
|
-
export declare function SegmentedTabs<T extends string>({ tabs, value: valueProp, onChange: onChangeProp, editable, visibleTabValues: visibleTabValuesProp, defaultVisibleTabValues, onVisibleTabValuesChange, fullWidth, className, pattern, ariaLabel: ariaLabelProp }: Props<T>): JSX.Element;
|
|
60
|
+
export declare function SegmentedTabs<T extends string>({ tabs, value: valueProp, onChange: onChangeProp, editable, visibleTabValues: visibleTabValuesProp, defaultVisibleTabValues, onVisibleTabValuesChange, fullWidth, className, pattern, ariaLabel: ariaLabelProp, ...props }: Props<T>): JSX.Element;
|
|
65
61
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/SegmentedTabs/index.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,GAAG,EAAiB,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/SegmentedTabs/index.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,wBAAwB,EAAE,GAAG,EAAiB,MAAM,OAAO,CAAC;AAM1E,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAE1C,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,YAAY,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAgD1C,UAAU,KAAK,CAAC,CAAC,SAAS,MAAM,CAAE,SAAQ,IAAI,CAC5C,wBAAwB,CAAC,KAAK,CAAC,EAC/B,UAAU,GAAG,WAAW,GAAG,YAAY,GAAG,UAAU,CACrD;IACC;;OAEG;IACH,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC;IAEnB;;OAEG;IACH,KAAK,CAAC,EAAE,CAAC,CAAC;IAEV;;;OAGG;IACH,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,CAAC;IAE9B;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;;OAGG;IACH,gBAAgB,CAAC,EAAE,CAAC,EAAE,CAAC;IAEvB;;;OAGG;IACH,uBAAuB,CAAC,EAAE,CAAC,EAAE,CAAC;IAE9B;;OAEG;IACH,wBAAwB,CAAC,EAAE,CAAC,gBAAgB,EAAE,CAAC,EAAE,KAAK,IAAI,CAAC;IAE3D;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,GAAG,YAAY,CAAC;IAEhC;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,CAAC,SAAS,MAAM,EAAE,EAC9C,IAAI,EACJ,KAAK,EAAE,SAAS,EAChB,QAAQ,EAAE,YAAY,EACtB,QAAe,EACf,gBAAgB,EAAE,oBAAoB,EACtC,uBAAuB,EACvB,wBAAwB,EACxB,SAAiB,EACjB,SAAS,EACT,OAAgB,EAChB,SAAS,EAAE,aAAa,EACxB,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,OAAO,CA2PxB"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "@harborclient/sdk/jsx-runtime";
|
|
2
2
|
import { useCallback, useContext, useEffect, useId, useMemo, useRef, useState } from '@harborclient/sdk/react';
|
|
3
|
-
import { getFocusableElements } from '../useDialogFocus.js';
|
|
4
|
-
import { resolveTabListKeyAction } from '../utils.js';
|
|
5
3
|
import { segment, segmentGroup } from '../classes.js';
|
|
4
|
+
import { getFocusableElements } from '../useDialogFocus.js';
|
|
5
|
+
import { cn, resolveTabListKeyAction } from '../utils.js';
|
|
6
6
|
import { SegmentedTabsContext } from './SegmentedTabsContext.js';
|
|
7
7
|
import { SegmentedTabsVisibilityMenu } from './SegmentedTabsVisibilityMenu.js';
|
|
8
8
|
export { SegmentedTabsGroup } from './SegmentedTabsGroup.js';
|
|
@@ -10,7 +10,6 @@ export { SegmentedTabPanel } from './SegmentedTabPanel.js';
|
|
|
10
10
|
/**
|
|
11
11
|
* Returns the tab value whose button currently has keyboard focus.
|
|
12
12
|
*
|
|
13
|
-
* @param tabRefs - Map of tab values to their button elements.
|
|
14
13
|
* @returns Focused tab value, or undefined when focus is outside the tab buttons.
|
|
15
14
|
*/
|
|
16
15
|
function getFocusedTabValue(tabRefs) {
|
|
@@ -29,7 +28,6 @@ function getFocusedTabValue(tabRefs) {
|
|
|
29
28
|
* Uses {@link getFocusableElements} first, then falls back to a direct query
|
|
30
29
|
* when layout APIs report no visible descendants (for example in jsdom).
|
|
31
30
|
*
|
|
32
|
-
* @param panel - Tab panel element linked from the active tab.
|
|
33
31
|
* @returns True when focus moved into the panel.
|
|
34
32
|
*/
|
|
35
33
|
function focusFirstFocusableInPanel(panel) {
|
|
@@ -50,7 +48,7 @@ function focusFirstFocusableInPanel(panel) {
|
|
|
50
48
|
/**
|
|
51
49
|
* macOS-style segmented tab control with WAI-ARIA tabs or radiogroup semantics.
|
|
52
50
|
*/
|
|
53
|
-
export function SegmentedTabs({ tabs, value: valueProp, onChange: onChangeProp, editable = true, visibleTabValues: visibleTabValuesProp, defaultVisibleTabValues, onVisibleTabValuesChange, fullWidth = false, className, pattern = 'tabs', ariaLabel: ariaLabelProp }) {
|
|
51
|
+
export function SegmentedTabs({ tabs, value: valueProp, onChange: onChangeProp, editable = true, visibleTabValues: visibleTabValuesProp, defaultVisibleTabValues, onVisibleTabValuesChange, fullWidth = false, className, pattern = 'tabs', ariaLabel: ariaLabelProp, ...props }) {
|
|
54
52
|
const context = useContext(SegmentedTabsContext);
|
|
55
53
|
const standaloneId = useId();
|
|
56
54
|
const tabRefs = useRef(new Map());
|
|
@@ -85,8 +83,6 @@ export function SegmentedTabs({ tabs, value: valueProp, onChange: onChangeProp,
|
|
|
85
83
|
/**
|
|
86
84
|
* Updates visible tab values and notifies the parent when controlled props
|
|
87
85
|
* are used for persistence.
|
|
88
|
-
*
|
|
89
|
-
* @param nextVisibleTabValues - New visible tab values.
|
|
90
86
|
*/
|
|
91
87
|
const updateVisibleTabValues = useCallback((nextVisibleTabValues) => {
|
|
92
88
|
if (visibleTabValuesProp === undefined) {
|
|
@@ -97,8 +93,6 @@ export function SegmentedTabs({ tabs, value: valueProp, onChange: onChangeProp,
|
|
|
97
93
|
/**
|
|
98
94
|
* Toggles a tab's visibility in the edit menu, keeping at least one tab
|
|
99
95
|
* visible and moving selection when the active tab is hidden.
|
|
100
|
-
*
|
|
101
|
-
* @param tabValue - Tab value to show or hide.
|
|
102
96
|
*/
|
|
103
97
|
const handleVisibilityToggle = useCallback((tabValue) => {
|
|
104
98
|
const isVisible = visibleSet.has(tabValue);
|
|
@@ -142,28 +136,13 @@ export function SegmentedTabs({ tabs, value: valueProp, onChange: onChangeProp,
|
|
|
142
136
|
onChange(nextSelectedTab.value);
|
|
143
137
|
}
|
|
144
138
|
}, [editable, onChange, value, visibleSet, visibleTabs]);
|
|
145
|
-
const outerClassName =
|
|
146
|
-
|
|
147
|
-
segmentGroup,
|
|
148
|
-
'items-center gap-1',
|
|
149
|
-
fullWidth ? 'flex-1 min-w-0' : '',
|
|
150
|
-
className
|
|
151
|
-
]
|
|
152
|
-
.filter(Boolean)
|
|
153
|
-
.join(' ');
|
|
154
|
-
const tabListClassName = [
|
|
155
|
-
'hc-segmented-tabs-list inline-flex min-w-0 flex-1 items-center',
|
|
156
|
-
fullWidth ? 'w-full' : ''
|
|
157
|
-
]
|
|
158
|
-
.filter(Boolean)
|
|
159
|
-
.join(' ');
|
|
139
|
+
const outerClassName = cn('hc-segmented-tabs', segmentGroup, 'items-center gap-1', fullWidth ? 'min-w-0 flex-1' : '', className);
|
|
140
|
+
const tabListClassName = cn('hc-segmented-tabs-list inline-flex min-w-0 flex-1 items-center', fullWidth ? 'w-full' : '');
|
|
160
141
|
const isRadiogroup = pattern === 'radiogroup';
|
|
161
142
|
/**
|
|
162
143
|
* Moves selection with arrow, Home, and End keys and focuses the newly
|
|
163
144
|
* selected tab or radio control. ArrowDown on a focused tab moves focus into
|
|
164
145
|
* the linked tab panel when used inside `SegmentedTabsGroup`.
|
|
165
|
-
*
|
|
166
|
-
* @param event - Keyboard event from the tab list or radio group container.
|
|
167
146
|
*/
|
|
168
147
|
const handleKeyDown = useCallback((event) => {
|
|
169
148
|
if (event.key === 'ArrowDown' && !isRadiogroup && context) {
|
|
@@ -209,7 +188,7 @@ export function SegmentedTabs({ tabs, value: valueProp, onChange: onChangeProp,
|
|
|
209
188
|
tabRefs.current.get(nextTab.value)?.focus();
|
|
210
189
|
});
|
|
211
190
|
}, [visibleTabs, value, onChange, isRadiogroup, context, getPanelId]);
|
|
212
|
-
return (_jsxs("div", { className: outerClassName, children: [_jsx("div", { className: tabListClassName, role: isRadiogroup ? 'radiogroup' : 'tablist', "aria-label": ariaLabel, ...(!isRadiogroup ? { 'aria-orientation': 'horizontal' } : {}), onKeyDown: handleKeyDown, children: visibleTabs.map((tab) => {
|
|
191
|
+
return (_jsxs("div", { ...props, className: outerClassName, children: [_jsx("div", { className: tabListClassName, role: isRadiogroup ? 'radiogroup' : 'tablist', "aria-label": ariaLabel, ...(!isRadiogroup ? { 'aria-orientation': 'horizontal' } : {}), onKeyDown: handleKeyDown, children: visibleTabs.map((tab) => {
|
|
213
192
|
const selected = value === tab.value;
|
|
214
193
|
const tabClassName = `hc-segmented-tabs-tab ${segment(selected)}${fullWidth ? ' flex-1' : ''}`;
|
|
215
194
|
return (_jsx("button", { ref: (element) => {
|
|
@@ -224,6 +203,6 @@ export function SegmentedTabs({ tabs, value: valueProp, onChange: onChangeProp,
|
|
|
224
203
|
id: getTabId(tab.value),
|
|
225
204
|
'aria-selected': selected,
|
|
226
205
|
...(context ? { 'aria-controls': getPanelId(tab.value) } : {})
|
|
227
|
-
}), children: _jsxs("span", { className: "hc-segmented-tabs-tab-label inline-flex items-center gap-1.5", children: [_jsx("span", { className: "inline-flex shrink-0 items-center px-1.5", children: _jsx("span", { className:
|
|
206
|
+
}), children: _jsxs("span", { className: "hc-segmented-tabs-tab-label inline-flex items-center gap-1.5", children: [_jsx("span", { className: "inline-flex shrink-0 items-center px-1.5", children: _jsx("span", { className: cn('hc-segmented-tabs-tab-indicator h-1.5 w-1.5 shrink-0 rounded-full', tab.indicator ? 'bg-accent' : 'bg-transparent'), "aria-hidden": true }) }), tab.label, _jsx("span", { className: "hc-segmented-tabs-tab-indicator-spacer inline-flex shrink-0 items-center px-1.5", "aria-hidden": true, children: _jsx("span", { className: "h-1.5 w-1.5 shrink-0" }) })] }) }, tab.value));
|
|
228
207
|
}) }), editable && (_jsx(SegmentedTabsVisibilityMenu, { tabs: editableTabs, visibleTabValues: visibleTabValues, onToggle: handleVisibilityToggle }))] }));
|
|
229
208
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { JSX, ReactNode } from 'react';
|
|
2
|
-
interface Props {
|
|
1
|
+
import type { ComponentPropsWithoutRef, JSX, ReactNode } from 'react';
|
|
2
|
+
interface Props extends Omit<ComponentPropsWithoutRef<'div'>, 'children'> {
|
|
3
3
|
/**
|
|
4
4
|
* Sidebar navigation rendered in the left column.
|
|
5
5
|
*/
|
|
@@ -8,15 +8,11 @@ interface Props {
|
|
|
8
8
|
* Scrollable main content rendered in the right column.
|
|
9
9
|
*/
|
|
10
10
|
children: ReactNode;
|
|
11
|
-
/**
|
|
12
|
-
* Additional Tailwind classes merged onto the outer flex column wrapper.
|
|
13
|
-
*/
|
|
14
|
-
className?: string;
|
|
15
11
|
}
|
|
16
12
|
/**
|
|
17
13
|
* Two-pane layout shell: a fixed sidebar column and a scrollable content area
|
|
18
14
|
* with standard page padding.
|
|
19
15
|
*/
|
|
20
|
-
export declare function SidebarLayout({ sidebar, children, className }: Props): JSX.Element;
|
|
16
|
+
export declare function SidebarLayout({ sidebar, children, className, ...props }: Props): JSX.Element;
|
|
21
17
|
export {};
|
|
22
18
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/SidebarLayout/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/SidebarLayout/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGtE,UAAU,KAAM,SAAQ,IAAI,CAAC,wBAAwB,CAAC,KAAK,CAAC,EAAE,UAAU,CAAC;IACvE;;OAEG;IACH,OAAO,EAAE,SAAS,CAAC;IAEnB;;OAEG;IACH,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,GAAG,GAAG,CAAC,OAAO,CAS5F"}
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "@harborclient/sdk/jsx-runtime";
|
|
2
|
+
import { cn } from '../utils.js';
|
|
2
3
|
/**
|
|
3
4
|
* Two-pane layout shell: a fixed sidebar column and a scrollable content area
|
|
4
5
|
* with standard page padding.
|
|
5
6
|
*/
|
|
6
|
-
export function SidebarLayout({ sidebar, children, className }) {
|
|
7
|
-
|
|
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
|
-
return (_jsx("div", { className: outer, children: _jsxs("div", { className: "hc-sidebar-layout-body flex min-h-0 flex-1", children: [sidebar, _jsx("div", { className: "hc-sidebar-layout-content flex-1 overflow-y-auto p-6 pt-0!", children: children })] }) }));
|
|
7
|
+
export function SidebarLayout({ sidebar, children, className, ...props }) {
|
|
8
|
+
return (_jsx("div", { ...props, className: cn('hc-sidebar-layout flex min-h-0 flex-1 flex-col', className), children: _jsxs("div", { className: "hc-sidebar-layout-body flex min-h-0 flex-1", children: [sidebar, _jsx("div", { className: "hc-sidebar-layout-content flex-1 overflow-y-auto p-6 pt-0!", children: children })] }) }));
|
|
11
9
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { JSX } from 'react';
|
|
1
|
+
import type { ComponentPropsWithoutRef, JSX } from 'react';
|
|
2
2
|
type SpinnerSize = 'sm' | 'md';
|
|
3
|
-
interface Props {
|
|
3
|
+
interface Props extends Omit<ComponentPropsWithoutRef<'span'>, 'children'> {
|
|
4
4
|
/**
|
|
5
5
|
* Visual size preset for the spinner SVG.
|
|
6
6
|
*/
|
|
@@ -9,18 +9,10 @@ interface Props {
|
|
|
9
9
|
* Accessible label announced while the spinner is visible.
|
|
10
10
|
*/
|
|
11
11
|
label?: string;
|
|
12
|
-
/**
|
|
13
|
-
* Additional Tailwind classes merged onto the wrapper element.
|
|
14
|
-
*/
|
|
15
|
-
className?: string;
|
|
16
12
|
}
|
|
17
13
|
/**
|
|
18
14
|
* Accent-colored spinning indicator shared by busy overlays, tabs, and modals.
|
|
19
|
-
*
|
|
20
|
-
* @param size - Visual size (`sm` or `md`).
|
|
21
|
-
* @param label - Accessible status label; when set, exposes `role="status"`.
|
|
22
|
-
* @param className - Extra classes on the wrapper span.
|
|
23
15
|
*/
|
|
24
|
-
export declare function Spinner({ size, label, className }: Props): JSX.Element;
|
|
16
|
+
export declare function Spinner({ size, label, className, ...props }: Props): JSX.Element;
|
|
25
17
|
export {};
|
|
26
18
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Spinner/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Spinner/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAG3D,KAAK,WAAW,GAAG,IAAI,GAAG,IAAI,CAAC;AAE/B,UAAU,KAAM,SAAQ,IAAI,CAAC,wBAAwB,CAAC,MAAM,CAAC,EAAE,UAAU,CAAC;IACxE;;OAEG;IACH,IAAI,CAAC,EAAE,WAAW,CAAC;IAEnB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAWD;;GAEG;AACH,wBAAgB,OAAO,CAAC,EAAE,IAAW,EAAE,KAAK,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,GAAG,GAAG,CAAC,OAAO,CA8BvF"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "@harborclient/sdk/jsx-runtime";
|
|
2
|
+
import { cn } from '../utils.js';
|
|
2
3
|
/**
|
|
3
4
|
* Returns width and height classes for the spinner size preset.
|
|
4
5
|
*
|
|
5
|
-
* @param size - Spinner size preset.
|
|
6
6
|
* @returns Tailwind dimension classes.
|
|
7
7
|
*/
|
|
8
8
|
function sizeClasses(size) {
|
|
@@ -10,13 +10,7 @@ function sizeClasses(size) {
|
|
|
10
10
|
}
|
|
11
11
|
/**
|
|
12
12
|
* Accent-colored spinning indicator shared by busy overlays, tabs, and modals.
|
|
13
|
-
*
|
|
14
|
-
* @param size - Visual size (`sm` or `md`).
|
|
15
|
-
* @param label - Accessible status label; when set, exposes `role="status"`.
|
|
16
|
-
* @param className - Extra classes on the wrapper span.
|
|
17
13
|
*/
|
|
18
|
-
export function Spinner({ size = 'md', label, className }) {
|
|
19
|
-
|
|
20
|
-
const wrapperClasses = className ? `${wrapperBase} ${className}` : wrapperBase;
|
|
21
|
-
return (_jsx("span", { className: wrapperClasses, role: label ? 'status' : undefined, "aria-label": label, children: _jsxs("svg", { className: `${sizeClasses(size)} hc-spinner-icon 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" })] }) }));
|
|
14
|
+
export function Spinner({ size = 'md', label, className, ...props }) {
|
|
15
|
+
return (_jsx("span", { ...props, className: cn('hc-spinner inline-flex items-center justify-center', className), role: label ? 'status' : undefined, "aria-label": label, children: _jsxs("svg", { className: cn('hc-spinner-icon animate-spin text-accent', sizeClasses(size)), 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
16
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { JSX, ReactNode } from 'react';
|
|
2
|
-
interface Props {
|
|
1
|
+
import type { ComponentPropsWithoutRef, JSX, ReactNode } from 'react';
|
|
2
|
+
interface Props extends Omit<ComponentPropsWithoutRef<'p'>, 'children'> {
|
|
3
3
|
/**
|
|
4
4
|
* Status or helper text content.
|
|
5
5
|
*/
|
|
@@ -8,22 +8,10 @@ interface Props {
|
|
|
8
8
|
* When true, exposes the message as a live region for assistive technologies.
|
|
9
9
|
*/
|
|
10
10
|
live?: boolean;
|
|
11
|
-
/**
|
|
12
|
-
* Optional element id for `aria-describedby` linkage.
|
|
13
|
-
*/
|
|
14
|
-
id?: string;
|
|
15
|
-
/**
|
|
16
|
-
* Additional Tailwind classes merged onto the status paragraph.
|
|
17
|
-
*/
|
|
18
|
-
className?: string;
|
|
19
11
|
}
|
|
20
12
|
/**
|
|
21
13
|
* Muted helper or progress text with optional polite live-region semantics.
|
|
22
|
-
*
|
|
23
|
-
* @param children - Status message content.
|
|
24
|
-
* @param live - Whether to set `role="status"` and `aria-live="polite"`.
|
|
25
|
-
* @param className - Extra classes appended after the preset.
|
|
26
14
|
*/
|
|
27
|
-
export declare function StatusMessage({ children, live,
|
|
15
|
+
export declare function StatusMessage({ children, live, className, ...props }: Props): JSX.Element;
|
|
28
16
|
export {};
|
|
29
17
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +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;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/StatusMessage/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGtE,UAAU,KAAM,SAAQ,IAAI,CAAC,wBAAwB,CAAC,GAAG,CAAC,EAAE,UAAU,CAAC;IACrE;;OAEG;IACH,QAAQ,EAAE,SAAS,CAAC;IAEpB;;OAEG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,EAAE,QAAQ,EAAE,IAAW,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,GAAG,GAAG,CAAC,OAAO,CAWhG"}
|
|
@@ -1,13 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx } from "@harborclient/sdk/jsx-runtime";
|
|
2
|
+
import { cn } from '../utils.js';
|
|
2
3
|
/**
|
|
3
4
|
* 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
5
|
*/
|
|
9
|
-
export function StatusMessage({ children, live = true,
|
|
10
|
-
|
|
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 }));
|
|
6
|
+
export function StatusMessage({ children, live = true, className, ...props }) {
|
|
7
|
+
return (_jsx("p", { ...props, className: cn('hc-status-message text-[14px] text-muted', className), role: live ? 'status' : undefined, "aria-live": live ? 'polite' : undefined, children: children }));
|
|
13
8
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { JSX } from 'react';
|
|
2
|
-
interface Props {
|
|
1
|
+
import type { ComponentPropsWithoutRef, JSX, MouseEvent } from 'react';
|
|
2
|
+
interface Props extends Omit<ComponentPropsWithoutRef<'button'>, 'children' | 'aria-label'> {
|
|
3
3
|
/**
|
|
4
4
|
* Accessible name for the close control, typically including the tab title.
|
|
5
5
|
*/
|
|
@@ -7,25 +7,15 @@ interface Props {
|
|
|
7
7
|
/**
|
|
8
8
|
* Called when the user activates the close button.
|
|
9
9
|
*/
|
|
10
|
-
onClick: (event:
|
|
10
|
+
onClick: (event: MouseEvent<HTMLButtonElement>) => void;
|
|
11
11
|
/**
|
|
12
12
|
* Optional tooltip label; defaults to "Close tab".
|
|
13
13
|
*/
|
|
14
14
|
title?: string;
|
|
15
|
-
/**
|
|
16
|
-
* Tab order index for roving-tablist layouts. Pass `0` on the active tab and
|
|
17
|
-
* `-1` on inactive tabs so the tab label receives focus before the close control.
|
|
18
|
-
*/
|
|
19
|
-
tabIndex?: number;
|
|
20
15
|
}
|
|
21
16
|
/**
|
|
22
17
|
* Close control for document-style tabs in the request editor and AI chat.
|
|
23
|
-
*
|
|
24
|
-
* @param ariaLabel - Accessible name describing which tab closes.
|
|
25
|
-
* @param onClick - Click handler; callers should stop propagation when needed.
|
|
26
|
-
* @param title - Optional native tooltip text.
|
|
27
|
-
* @param tabIndex - Tab order index; use with roving tabindex on the tab label.
|
|
28
18
|
*/
|
|
29
|
-
export declare function TabCloseButton({ ariaLabel, onClick, title, tabIndex }: Props): JSX.Element;
|
|
19
|
+
export declare function TabCloseButton({ ariaLabel, onClick, title, tabIndex, className, ...props }: Props): JSX.Element;
|
|
30
20
|
export {};
|
|
31
21
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/TabCloseButton/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/TabCloseButton/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,wBAAwB,EAAE,GAAG,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAIvE,UAAU,KAAM,SAAQ,IAAI,CAAC,wBAAwB,CAAC,QAAQ,CAAC,EAAE,UAAU,GAAG,YAAY,CAAC;IACzF;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,OAAO,EAAE,CAAC,KAAK,EAAE,UAAU,CAAC,iBAAiB,CAAC,KAAK,IAAI,CAAC;IAExD;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,EAC7B,SAAS,EACT,OAAO,EACP,KAAmB,EACnB,QAAQ,EACR,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,GAAG,GAAG,CAAC,OAAO,CAiBrB"}
|