@harborclient/sdk 1.2.6 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +11 -0
- package/dist/components/Breadcrumb/CrumbSegment.d.ts.map +1 -1
- package/dist/components/Breadcrumb/CrumbSegment.js +5 -3
- package/dist/components/Breadcrumb/EditableSegment.d.ts.map +1 -1
- package/dist/components/Breadcrumb/EditableSegment.js +5 -3
- package/dist/components/Breadcrumb/SegmentShell.d.ts +16 -1
- package/dist/components/Breadcrumb/SegmentShell.d.ts.map +1 -1
- package/dist/components/Breadcrumb/SegmentShell.js +21 -6
- package/dist/components/Breadcrumb/index.d.ts +2 -0
- package/dist/components/Breadcrumb/index.d.ts.map +1 -1
- package/dist/components/Breadcrumb/index.js +5 -1
- package/dist/components/Breadcrumb/types.d.ts +5 -0
- package/dist/components/Breadcrumb/types.d.ts.map +1 -1
- package/dist/components/CodeEditor/index.d.ts.map +1 -1
- package/dist/components/CodeEditor/index.js +21 -5
- package/dist/components/CodeEditor/renderHighlightedPlaceholder.d.ts.map +1 -1
- package/dist/components/CodeEditor/renderHighlightedPlaceholder.js +4 -10
- package/dist/components/CodeEditor/themes.d.ts +14 -0
- package/dist/components/CodeEditor/themes.d.ts.map +1 -1
- package/dist/components/CodeEditor/themes.js +27 -0
- package/dist/components/FormGroup/index.d.ts +2 -2
- package/dist/components/FormGroup/index.d.ts.map +1 -1
- package/dist/components/FormGroup/index.js +4 -8
- package/dist/components/SegmentedTabs/index.d.ts.map +1 -1
- package/dist/components/SegmentedTabs/index.js +2 -2
- package/dist/components/SidebarItem/SidebarDocumentItem.d.ts +1 -2
- package/dist/components/SidebarItem/SidebarDocumentItem.d.ts.map +1 -1
- package/dist/components/SidebarItem/SidebarFolderItem.d.ts +2 -1
- package/dist/components/SidebarItem/SidebarFolderItem.d.ts.map +1 -1
- package/dist/components/SidebarItem/SidebarFolderItem.js +5 -3
- package/dist/components/SidebarItem/SidebarItem.d.ts +2 -2
- package/dist/components/SidebarItem/SidebarItem.d.ts.map +1 -1
- package/dist/components/SidebarItem/SidebarItem.js +6 -6
- package/dist/components/SidebarItem/SortableSidebarItem.d.ts +10 -4
- package/dist/components/SidebarItem/SortableSidebarItem.d.ts.map +1 -1
- package/dist/components/SidebarItem/SortableSidebarItem.js +8 -6
- package/dist/components/SidebarItem/index.d.ts +1 -1
- package/dist/components/SidebarItem/index.d.ts.map +1 -1
- package/dist/components/SidebarItem/index.js +1 -1
- package/dist/components/SidebarItem/sidebarItemClasses.d.ts +18 -5
- package/dist/components/SidebarItem/sidebarItemClasses.d.ts.map +1 -1
- package/dist/components/SidebarItem/sidebarItemClasses.js +18 -5
- package/dist/components/SidebarSection/SectionItem.d.ts.map +1 -1
- package/dist/components/SidebarSection/SectionItem.js +3 -1
- package/dist/components/TabBar/TabBarShell.js +1 -1
- package/dist/components/TabBar/TabNewButton.d.ts +1 -1
- package/dist/components/TabBar/TabNewButton.d.ts.map +1 -1
- package/dist/components/TabBar/TabNewButton.js +2 -2
- package/dist/components/TabBar/index.d.ts.map +1 -1
- package/dist/components/TabBar/index.js +6 -4
- package/dist/components/Toolbar/index.d.ts +1 -0
- package/dist/components/Toolbar/index.d.ts.map +1 -1
- package/dist/components/Toolbar/index.js +2 -1
- package/dist/components/classes.d.ts +6 -3
- package/dist/components/classes.d.ts.map +1 -1
- package/dist/components/classes.js +8 -5
- package/dist/components/forms/Switch.d.ts +21 -0
- package/dist/components/forms/Switch.d.ts.map +1 -0
- package/dist/components/forms/Switch.js +13 -0
- package/dist/components/forms/classes.d.ts +8 -2
- package/dist/components/forms/classes.d.ts.map +1 -1
- package/dist/components/forms/classes.js +8 -2
- package/dist/components/forms/index.d.ts +2 -1
- package/dist/components/forms/index.d.ts.map +1 -1
- package/dist/components/forms/index.js +2 -1
- package/dist/components/index.d.ts +2 -2
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +2 -2
- package/dist/styles.css +20 -3
- package/dist/types.d.ts +3 -2
- package/dist/types.d.ts.map +1 -1
- package/dist/ui/appearanceTheme.d.ts +11 -0
- package/dist/ui/appearanceTheme.d.ts.map +1 -0
- package/dist/ui/appearanceTheme.js +37 -0
- package/dist/ui/codeEditorSettings.d.ts +1 -1
- package/dist/ui/codeEditorSettings.js +2 -2
- package/dist/ui/index.d.ts +1 -0
- package/dist/ui/index.d.ts.map +1 -1
- package/dist/ui/index.js +1 -0
- package/package.json +2 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx as _jsx,
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "@harborclient/sdk/jsx-runtime";
|
|
2
2
|
import { cn } from '../utils.js';
|
|
3
3
|
import { SortableSidebarItem } from './SortableSidebarItem.js';
|
|
4
4
|
import { sourceRow } from './sidebarItemClasses.js';
|
|
@@ -6,12 +6,12 @@ import { handleSidebarOptionKeyDown } from './sidebarListOption.js';
|
|
|
6
6
|
import { stopSortableDragPointerDown } from './stopSortableDragPointerDown.js';
|
|
7
7
|
/**
|
|
8
8
|
* Base shell for sidebar list rows. Applies shared row chrome, optional sortable
|
|
9
|
-
* drag behavior via a
|
|
10
|
-
* for
|
|
9
|
+
* drag behavior via a trailing grip handle (before actions), and a trailing
|
|
10
|
+
* actions slot suitable for Sidebar layout reuse.
|
|
11
11
|
*/
|
|
12
12
|
export function SidebarItem({ selected = false, compact = true, sortable, listboxOption, treeItem, onContextMenu, actions, actionsStopDrag = true, as: Container = 'div', className, children }) {
|
|
13
13
|
const rowClassName = cn('hc-sidebar-item', sourceRow(selected, compact), className);
|
|
14
|
-
const
|
|
14
|
+
const actionsNode = actions != null ? (_jsx("div", { className: "shrink-0", ...(actionsStopDrag ? { onPointerDown: stopSortableDragPointerDown } : {}), children: actions })) : null;
|
|
15
15
|
const listboxOptionProps = listboxOption != null
|
|
16
16
|
? {
|
|
17
17
|
role: 'option',
|
|
@@ -62,7 +62,7 @@ export function SidebarItem({ selected = false, compact = true, sortable, listbo
|
|
|
62
62
|
: {};
|
|
63
63
|
const interactiveProps = listboxOption != null ? listboxOptionProps : treeItemProps;
|
|
64
64
|
if (sortable != null) {
|
|
65
|
-
return (_jsx(SortableSidebarItem, { id: sortable.id, as: Container, className: rowClassName, dragHandleLabel: sortable.dragHandleLabel, disabled: sortable.disabled, onRowContextMenu: onContextMenu, ...interactiveProps, children:
|
|
65
|
+
return (_jsx(SortableSidebarItem, { id: sortable.id, as: Container, className: rowClassName, dragHandleLabel: sortable.dragHandleLabel, disabled: sortable.disabled, onRowContextMenu: onContextMenu, trailing: actionsNode, ...interactiveProps, children: children }));
|
|
66
66
|
}
|
|
67
|
-
return (
|
|
67
|
+
return (_jsxs(Container, { className: rowClassName, onContextMenu: onContextMenu, ...interactiveProps, children: [children, actionsNode] }));
|
|
68
68
|
}
|
|
@@ -17,9 +17,13 @@ interface Props {
|
|
|
17
17
|
*/
|
|
18
18
|
dragHandleLabel: string;
|
|
19
19
|
/**
|
|
20
|
-
* Row contents,
|
|
20
|
+
* Row contents (label, chevron, badges, etc.). Rendered before the trailing drag handle.
|
|
21
21
|
*/
|
|
22
22
|
children: ReactNode;
|
|
23
|
+
/**
|
|
24
|
+
* Optional trailing slot after the drag handle (typically row actions).
|
|
25
|
+
*/
|
|
26
|
+
trailing?: ReactNode;
|
|
23
27
|
/**
|
|
24
28
|
* When true, renders a static row without drag-and-drop behavior.
|
|
25
29
|
*/
|
|
@@ -46,9 +50,11 @@ interface Props {
|
|
|
46
50
|
}
|
|
47
51
|
/**
|
|
48
52
|
* Wraps a sidebar row with dnd-kit sortable drag behavior. Reordering is activated
|
|
49
|
-
* from a dedicated grip handle so keyboard users can focus it and use the
|
|
50
|
-
* sensor; listbox option interaction and nested row controls stay on the
|
|
53
|
+
* from a dedicated trailing grip handle so keyboard users can focus it and use the
|
|
54
|
+
* keyboard sensor; listbox option interaction and nested row controls stay on the
|
|
55
|
+
* row container. Keeping the handle after the label keeps leading content flush with
|
|
56
|
+
* non-sortable sections such as Runs and History.
|
|
51
57
|
*/
|
|
52
|
-
export declare function SortableSidebarItem({ id, as: Container, className, dragHandleLabel, children, disabled, onRowContextMenu, role, 'aria-selected': ariaSelected, 'aria-label': ariaLabel, 'aria-expanded': ariaExpanded, 'aria-controls': ariaControls, 'aria-level': ariaLevel, 'aria-setsize': ariaSetSize, 'aria-posinset': ariaPosInSet, tabIndex, onClick, onDoubleClick, onKeyDown }: Props): JSX.Element;
|
|
58
|
+
export declare function SortableSidebarItem({ id, as: Container, className, dragHandleLabel, children, trailing, disabled, onRowContextMenu, role, 'aria-selected': ariaSelected, 'aria-label': ariaLabel, 'aria-expanded': ariaExpanded, 'aria-controls': ariaControls, 'aria-level': ariaLevel, 'aria-setsize': ariaSetSize, 'aria-posinset': ariaPosInSet, tabIndex, onClick, onDoubleClick, onKeyDown }: Props): JSX.Element;
|
|
53
59
|
export {};
|
|
54
60
|
//# sourceMappingURL=SortableSidebarItem.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SortableSidebarItem.d.ts","sourceRoot":"","sources":["../../../src/components/SidebarItem/SortableSidebarItem.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAiB,GAAG,EAAE,aAAa,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAItF,UAAU,KAAK;IACb;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;OAEG;IACH,EAAE,CAAC,EAAE,KAAK,GAAG,IAAI,CAAC;IAElB;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,eAAe,EAAE,MAAM,CAAC;IAExB;;OAEG;IACH,QAAQ,EAAE,SAAS,CAAC;IAEpB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;OAEG;IACH,gBAAgB,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,CAAC,WAAW,CAAC,KAAK,IAAI,CAAC;IAE5D;;OAEG;IACH,IAAI,CAAC,EAAE,QAAQ,GAAG,UAAU,CAAC;IAC7B,eAAe,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IACnC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,eAAe,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IACnC,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,CAAC,WAAW,CAAC,KAAK,IAAI,CAAC;IACnD,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,CAAC,WAAW,CAAC,KAAK,IAAI,CAAC;IACzD,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,aAAa,CAAC,WAAW,CAAC,KAAK,IAAI,CAAC;CACzD;AAED
|
|
1
|
+
{"version":3,"file":"SortableSidebarItem.d.ts","sourceRoot":"","sources":["../../../src/components/SidebarItem/SortableSidebarItem.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAiB,GAAG,EAAE,aAAa,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAItF,UAAU,KAAK;IACb;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;OAEG;IACH,EAAE,CAAC,EAAE,KAAK,GAAG,IAAI,CAAC;IAElB;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,eAAe,EAAE,MAAM,CAAC;IAExB;;OAEG;IACH,QAAQ,EAAE,SAAS,CAAC;IAEpB;;OAEG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;IAErB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;OAEG;IACH,gBAAgB,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,CAAC,WAAW,CAA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sortable';
|
|
3
3
|
import { CSS } from '@dnd-kit/utilities';
|
|
4
4
|
import { faGripVertical } from '@fortawesome/free-solid-svg-icons';
|
|
@@ -6,10 +6,12 @@ import { FaIcon } from '../FaIcon/index.js';
|
|
|
6
6
|
import { SIDEBAR_DRAG_HANDLE_CLASS } from './sidebarItemClasses.js';
|
|
7
7
|
/**
|
|
8
8
|
* Wraps a sidebar row with dnd-kit sortable drag behavior. Reordering is activated
|
|
9
|
-
* from a dedicated grip handle so keyboard users can focus it and use the
|
|
10
|
-
* sensor; listbox option interaction and nested row controls stay on the
|
|
9
|
+
* from a dedicated trailing grip handle so keyboard users can focus it and use the
|
|
10
|
+
* keyboard sensor; listbox option interaction and nested row controls stay on the
|
|
11
|
+
* row container. Keeping the handle after the label keeps leading content flush with
|
|
12
|
+
* non-sortable sections such as Runs and History.
|
|
11
13
|
*/
|
|
12
|
-
export function SortableSidebarItem({ id, as: Container = 'div', className, dragHandleLabel, children, disabled = false, onRowContextMenu, role, 'aria-selected': ariaSelected, 'aria-label': ariaLabel, 'aria-expanded': ariaExpanded, 'aria-controls': ariaControls, 'aria-level': ariaLevel, 'aria-setsize': ariaSetSize, 'aria-posinset': ariaPosInSet, tabIndex, onClick, onDoubleClick, onKeyDown }) {
|
|
14
|
+
export function SortableSidebarItem({ id, as: Container = 'div', className, dragHandleLabel, children, trailing, disabled = false, onRowContextMenu, role, 'aria-selected': ariaSelected, 'aria-label': ariaLabel, 'aria-expanded': ariaExpanded, 'aria-controls': ariaControls, 'aria-level': ariaLevel, 'aria-setsize': ariaSetSize, 'aria-posinset': ariaPosInSet, tabIndex, onClick, onDoubleClick, onKeyDown }) {
|
|
13
15
|
const { attributes, listeners, setNodeRef, setActivatorNodeRef, transform, transition, isDragging } = useSortable({ id, disabled });
|
|
14
16
|
const isInteractiveRow = role === 'option' || role === 'treeitem';
|
|
15
17
|
const interactiveProps = isInteractiveRow
|
|
@@ -29,12 +31,12 @@ export function SortableSidebarItem({ id, as: Container = 'div', className, drag
|
|
|
29
31
|
}
|
|
30
32
|
: {};
|
|
31
33
|
if (disabled) {
|
|
32
|
-
return (
|
|
34
|
+
return (_jsxs(Container, { className: className, onContextMenu: onRowContextMenu, ...interactiveProps, children: [children, trailing] }));
|
|
33
35
|
}
|
|
34
36
|
const style = {
|
|
35
37
|
transform: CSS.Transform.toString(transform),
|
|
36
38
|
transition: isDragging ? transition : undefined,
|
|
37
39
|
opacity: isDragging ? 0.45 : undefined
|
|
38
40
|
};
|
|
39
|
-
return (_jsxs(Container, { ref: setNodeRef, style: style, className: className, onContextMenu: onRowContextMenu, ...interactiveProps, children: [_jsx("button", { type: "button", ref: setActivatorNodeRef, className: SIDEBAR_DRAG_HANDLE_CLASS, "aria-label": dragHandleLabel, ...attributes, ...listeners, children: _jsx(FaIcon, { icon: faGripVertical, className: "h-2.5 w-2.5", "aria-hidden": true }) }),
|
|
41
|
+
return (_jsxs(Container, { ref: setNodeRef, style: style, className: className, onContextMenu: onRowContextMenu, ...interactiveProps, children: [children, _jsx("button", { type: "button", ref: setActivatorNodeRef, className: SIDEBAR_DRAG_HANDLE_CLASS, "aria-label": dragHandleLabel, ...attributes, ...listeners, children: _jsx(FaIcon, { icon: faGripVertical, className: "h-2.5 w-2.5", "aria-hidden": true }) }), trailing] }));
|
|
40
42
|
}
|
|
@@ -8,7 +8,7 @@ export { SortableSidebarItem } from './SortableSidebarItem.js';
|
|
|
8
8
|
export { stopSortableDragPointerDown } from './stopSortableDragPointerDown.js';
|
|
9
9
|
export { SidebarColorDot } from './SidebarColorDot.js';
|
|
10
10
|
export { SidebarBadge, type SidebarBadgeVariant } from './SidebarBadge.js';
|
|
11
|
-
export { sourceRow, METHOD_CLASSES, statusDotVariant, statusDotClass, SIDEBAR_ITEM_BUTTON_CLASS,
|
|
11
|
+
export { sourceRow, METHOD_CLASSES, statusDotVariant, statusDotClass, SIDEBAR_ITEM_BUTTON_CLASS, SIDEBAR_CHEVRON_BUTTON_CLASS, SIDEBAR_CHEVRON_ICON_CLASS, SIDEBAR_CHEVRON_SLOT_CLASS, SIDEBAR_CHEVRON_LABEL_OFFSET_CLASS } from './sidebarItemClasses.js';
|
|
12
12
|
export { SidebarMethodBadge } from './SidebarMethodBadge.js';
|
|
13
13
|
export { SidebarStatusDot } from './SidebarStatusDot.js';
|
|
14
14
|
export { SidebarStatusMarker } from './SidebarStatusMarker.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/SidebarItem/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EACX,KAAK,wBAAwB,EAC7B,KAAK,yBAAyB,EAC9B,KAAK,mBAAmB,EACzB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,0BAA0B,EAAE,MAAM,wBAAwB,CAAC;AACpE,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,2BAA2B,EAAE,MAAM,kCAAkC,CAAC;AAC/E,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,KAAK,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAC3E,OAAO,EACL,SAAS,EACT,cAAc,EACd,gBAAgB,EAChB,cAAc,EACd,yBAAyB,EACzB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/SidebarItem/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EACX,KAAK,wBAAwB,EAC7B,KAAK,yBAAyB,EAC9B,KAAK,mBAAmB,EACzB,MAAM,kBAAkB,CAAC;AAC1B,O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MAAM,wBAAwB,CAAC"}
|
|
@@ -8,7 +8,7 @@ export { SortableSidebarItem } from './SortableSidebarItem.js';
|
|
|
8
8
|
export { stopSortableDragPointerDown } from './stopSortableDragPointerDown.js';
|
|
9
9
|
export { SidebarColorDot } from './SidebarColorDot.js';
|
|
10
10
|
export { SidebarBadge } from './SidebarBadge.js';
|
|
11
|
-
export { sourceRow, METHOD_CLASSES, statusDotVariant, statusDotClass, SIDEBAR_ITEM_BUTTON_CLASS,
|
|
11
|
+
export { sourceRow, METHOD_CLASSES, statusDotVariant, statusDotClass, SIDEBAR_ITEM_BUTTON_CLASS, SIDEBAR_CHEVRON_BUTTON_CLASS, SIDEBAR_CHEVRON_ICON_CLASS, SIDEBAR_CHEVRON_SLOT_CLASS, SIDEBAR_CHEVRON_LABEL_OFFSET_CLASS } from './sidebarItemClasses.js';
|
|
12
12
|
export { SidebarMethodBadge } from './SidebarMethodBadge.js';
|
|
13
13
|
export { SidebarStatusDot } from './SidebarStatusDot.js';
|
|
14
14
|
export { SidebarStatusMarker } from './SidebarStatusMarker.js';
|
|
@@ -37,10 +37,23 @@ export declare const SIDEBAR_ITEM_BUTTON_CLASS = "flex min-w-0 flex-1 cursor-poi
|
|
|
37
37
|
*/
|
|
38
38
|
export declare const SIDEBAR_DRAG_HANDLE_CLASS = "app-no-drag inline-flex h-4 w-4 shrink-0 cursor-grab items-center justify-center rounded border-none bg-transparent p-0 text-muted opacity-0 hover:text-text focus-visible:opacity-100 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-accent active:cursor-grabbing group-hover:opacity-100";
|
|
39
39
|
/**
|
|
40
|
-
*
|
|
41
|
-
*
|
|
42
|
-
* with method text (drag handle `w-4` + row `gap-1` + method badge `px-1` =
|
|
43
|
-
* 24px total; `ml-5` provides the remaining 20px).
|
|
40
|
+
* Expand/collapse chevron button (collection and folder rows). 16×16 hit target
|
|
41
|
+
* sized to match Cursor’s file explorer twistie.
|
|
44
42
|
*/
|
|
45
|
-
export declare const
|
|
43
|
+
export declare const SIDEBAR_CHEVRON_BUTTON_CLASS = "app-no-drag inline-flex h-4 w-4 shrink-0 cursor-pointer items-center justify-center rounded border-none bg-transparent p-0 text-muted hover:text-text";
|
|
44
|
+
/**
|
|
45
|
+
* Expand/collapse chevron glyph size (12×12), forced past Font Awesome's
|
|
46
|
+
* text-relative dimensions to match Cursor’s explorer carets.
|
|
47
|
+
*/
|
|
48
|
+
export declare const SIDEBAR_CHEVRON_ICON_CLASS = "!h-3 !w-3";
|
|
49
|
+
/**
|
|
50
|
+
* Section-header chevron slot: tight left inset and 16×16 alignment box for the
|
|
51
|
+
* glyph when the whole header toggles expand/collapse.
|
|
52
|
+
*/
|
|
53
|
+
export declare const SIDEBAR_CHEVRON_SLOT_CLASS = "ms-1 inline-flex h-4 w-4 shrink-0 items-center justify-center";
|
|
54
|
+
/**
|
|
55
|
+
* Gap between a row chevron button and its label, matching Cursor’s explorer
|
|
56
|
+
* spacing (~10px).
|
|
57
|
+
*/
|
|
58
|
+
export declare const SIDEBAR_CHEVRON_LABEL_OFFSET_CLASS = "ml-2.5";
|
|
46
59
|
//# sourceMappingURL=sidebarItemClasses.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sidebarItemClasses.d.ts","sourceRoot":"","sources":["../../../src/components/SidebarItem/sidebarItemClasses.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAG9D;;GAEG;AAEH;;;;;;GAMG;AACH,wBAAgB,SAAS,CAAC,QAAQ,EAAE,OAAO,EAAE,OAAO,UAAQ,GAAG,MAAM,CAKpE;AAED;;GAEG;AACH,eAAO,MAAM,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAQjD,CAAC;AAEF;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,GAAG,gBAAgB,CAMjE;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAErD;AAED;;GAEG;AACH,eAAO,MAAM,yBAAyB,+HACwF,CAAC;AAE/H;;GAEG;AACH,eAAO,MAAM,yBAAyB,oVAC6S,CAAC;AAEpV
|
|
1
|
+
{"version":3,"file":"sidebarItemClasses.d.ts","sourceRoot":"","sources":["../../../src/components/SidebarItem/sidebarItemClasses.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAG9D;;GAEG;AAEH;;;;;;GAMG;AACH,wBAAgB,SAAS,CAAC,QAAQ,EAAE,OAAO,EAAE,OAAO,UAAQ,GAAG,MAAM,CAKpE;AAED;;GAEG;AACH,eAAO,MAAM,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAQjD,CAAC;AAEF;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,GAAG,gBAAgB,CAMjE;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAErD;AAED;;GAEG;AACH,eAAO,MAAM,yBAAyB,+HACwF,CAAC;AAE/H;;GAEG;AACH,eAAO,MAAM,yBAAyB,oVAC6S,CAAC;AAEpV;;;GAGG;AACH,eAAO,MAAM,4BAA4B,0JACgH,CAAC;AAE1J;;;GAGG;AACH,eAAO,MAAM,0BAA0B,cAAc,CAAC;AAEtD;;;GAGG;AACH,eAAO,MAAM,0BAA0B,kEAC0B,CAAC;AAElE;;;GAGG;AACH,eAAO,MAAM,kCAAkC,WAAW,CAAC"}
|
|
@@ -62,9 +62,22 @@ export const SIDEBAR_ITEM_BUTTON_CLASS = 'flex min-w-0 flex-1 cursor-pointer ite
|
|
|
62
62
|
*/
|
|
63
63
|
export const SIDEBAR_DRAG_HANDLE_CLASS = 'app-no-drag inline-flex h-4 w-4 shrink-0 cursor-grab items-center justify-center rounded border-none bg-transparent p-0 text-muted opacity-0 hover:text-text focus-visible:opacity-100 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-accent active:cursor-grabbing group-hover:opacity-100';
|
|
64
64
|
/**
|
|
65
|
-
*
|
|
66
|
-
*
|
|
67
|
-
* with method text (drag handle `w-4` + row `gap-1` + method badge `px-1` =
|
|
68
|
-
* 24px total; `ml-5` provides the remaining 20px).
|
|
65
|
+
* Expand/collapse chevron button (collection and folder rows). 16×16 hit target
|
|
66
|
+
* sized to match Cursor’s file explorer twistie.
|
|
69
67
|
*/
|
|
70
|
-
export const
|
|
68
|
+
export const SIDEBAR_CHEVRON_BUTTON_CLASS = 'app-no-drag inline-flex h-4 w-4 shrink-0 cursor-pointer items-center justify-center rounded border-none bg-transparent p-0 text-muted hover:text-text';
|
|
69
|
+
/**
|
|
70
|
+
* Expand/collapse chevron glyph size (12×12), forced past Font Awesome's
|
|
71
|
+
* text-relative dimensions to match Cursor’s explorer carets.
|
|
72
|
+
*/
|
|
73
|
+
export const SIDEBAR_CHEVRON_ICON_CLASS = '!h-3 !w-3';
|
|
74
|
+
/**
|
|
75
|
+
* Section-header chevron slot: tight left inset and 16×16 alignment box for the
|
|
76
|
+
* glyph when the whole header toggles expand/collapse.
|
|
77
|
+
*/
|
|
78
|
+
export const SIDEBAR_CHEVRON_SLOT_CLASS = 'ms-1 inline-flex h-4 w-4 shrink-0 items-center justify-center';
|
|
79
|
+
/**
|
|
80
|
+
* Gap between a row chevron button and its label, matching Cursor’s explorer
|
|
81
|
+
* spacing (~10px).
|
|
82
|
+
*/
|
|
83
|
+
export const SIDEBAR_CHEVRON_LABEL_OFFSET_CLASS = 'ml-2.5';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SectionItem.d.ts","sourceRoot":"","sources":["../../../src/components/SidebarSection/SectionItem.tsx"],"names":[],"mappings":"AAQA,OAAO,EAAE,KAAK,GAAG,EAA4B,KAAK,SAAS,EAAkB,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"SectionItem.d.ts","sourceRoot":"","sources":["../../../src/components/SidebarSection/SectionItem.tsx"],"names":[],"mappings":"AAQA,OAAO,EAAE,KAAK,GAAG,EAA4B,KAAK,SAAS,EAAkB,MAAM,OAAO,CAAC;AAO3F,UAAU,mBAAmB;IAC3B;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,QAAQ,EAAE,SAAS,CAAC;IAEpB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,IAAI,CAAC;IAEnB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,aAAa,CAAC,EAAE,SAAS,CAAC;IAE1B;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,MAAM,WAAW,KAAM,SAAQ,mBAAmB;IAChD;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,cAAc,EAAE,OAAO,CAAC;CACzB;AA+ED,eAAO,MAAM,gBAAgB,EAIb,CAAC,KAAK,EAAE,KAAK,KAAK,GAAG,CAAC,OAAO,CAAC"}
|
|
@@ -3,15 +3,17 @@ import { faChevronDown, faChevronRight, faPlus } from '@fortawesome/free-solid-s
|
|
|
3
3
|
import { useAccordionItem, useHeightTransition, useMergeRef, withAccordionItem } from '@szhsin/react-accordion';
|
|
4
4
|
import { memo } from 'react';
|
|
5
5
|
import { FaIcon } from '../FaIcon/index.js';
|
|
6
|
+
import { SIDEBAR_CHEVRON_ICON_CLASS, SIDEBAR_CHEVRON_SLOT_CLASS } from '../SidebarItem/sidebarItemClasses.js';
|
|
6
7
|
/**
|
|
7
8
|
* Renders the sidebar section header row and animated body panel.
|
|
9
|
+
* Header chevron inset and title gap follow shared `SIDEBAR_CHEVRON_*` spacing.
|
|
8
10
|
*/
|
|
9
11
|
const SectionItem = memo(function SectionItem({ forwardedRef, itemRef, state, toggle, title, children, onAdd, addLabel, headerActions, flushBody = false }) {
|
|
10
12
|
const { buttonProps, panelProps } = useAccordionItem({ state, toggle });
|
|
11
13
|
const [transitionStyle, panelRef] = useHeightTransition(state);
|
|
12
14
|
const itemElementRef = useMergeRef(forwardedRef, itemRef);
|
|
13
15
|
const { status, isMounted, isEnter } = state;
|
|
14
|
-
return (_jsxs("div", { ref: itemElementRef, className: "-mr-2 mb-1", children: [_jsxs("div", { className: `hc-sidebar-section-header flex min-h-8 items-center justify-between gap-2 bg-sidebar-section py-0.5 pr-2 ${flushBody ? 'mb-0' : 'mb-1'}`, children: [_jsxs("button", { ...buttonProps, type: "button", className: "app-no-drag inline-flex min-w-0 flex-1 cursor-pointer items-center gap-
|
|
16
|
+
return (_jsxs("div", { ref: itemElementRef, className: "-mr-2 mb-1", children: [_jsxs("div", { className: `hc-sidebar-section-header flex min-h-8 items-center justify-between gap-2 bg-sidebar-section py-0.5 pr-2 ${flushBody ? 'mb-0' : 'mb-1'}`, children: [_jsxs("button", { ...buttonProps, type: "button", className: "app-no-drag inline-flex min-w-0 flex-1 cursor-pointer items-center gap-2.5 border-none bg-transparent p-0 text-left", children: [_jsx("span", { className: SIDEBAR_CHEVRON_SLOT_CLASS, children: _jsx(FaIcon, { icon: isEnter ? faChevronDown : faChevronRight, className: `${SIDEBAR_CHEVRON_ICON_CLASS} text-sidebar-section-text` }) }), _jsx("h2", { className: "m-0 text-[15px] leading-none font-medium tracking-wide text-sidebar-section-text uppercase", children: title })] }), (headerActions || onAdd) && (_jsxs("div", { className: "flex shrink-0 items-center gap-1", children: [headerActions, onAdd ? (_jsx("button", { type: "button", className: "hc-sidebar-add-button app-no-drag inline-flex shrink-0 cursor-pointer items-center justify-center border-none bg-transparent text-muted hover:bg-selection hover:text-text focus-visible:bg-selection focus-visible:text-text", title: addLabel ?? 'Add', "aria-label": addLabel ?? 'Add', onClick: onAdd, children: _jsx(FaIcon, { icon: faPlus, className: "h-4 w-4" }) })) : null] }))] }), isMounted ? (_jsx("div", { style: {
|
|
15
17
|
display: status === 'exited' ? 'none' : undefined,
|
|
16
18
|
...transitionStyle
|
|
17
19
|
}, className: "transition-[height] duration-200 ease-out motion-reduce:transition-none", children: _jsx("div", { ...panelProps, ref: panelRef, children: children }) })) : null] }));
|
|
@@ -25,7 +25,7 @@ export function TabBarShell({ item, tabIndex, sortableId, sortableDisabled = fal
|
|
|
25
25
|
: sortableCursor === 'grab'
|
|
26
26
|
? 'cursor-grab active:cursor-grabbing'
|
|
27
27
|
: 'cursor-pointer';
|
|
28
|
-
return (_jsxs("div", { ref: exiting ? undefined : setNodeRef, style: exiting ? undefined : style, role: "tab", id: exiting ? undefined : `${tabIdPrefix}${String(item.id)}`, "aria-controls": exiting ? undefined : `${panelIdPrefix}${String(item.id)}`, "aria-selected": item.active, "aria-label": item.accessibleName, title: item.title, tabIndex: exiting ? -1 : tabIndex, className: cn('group
|
|
28
|
+
return (_jsxs("div", { ref: exiting ? undefined : setNodeRef, style: exiting ? undefined : style, role: "tab", id: exiting ? undefined : `${tabIdPrefix}${String(item.id)}`, "aria-controls": exiting ? undefined : `${panelIdPrefix}${String(item.id)}`, "aria-selected": item.active, "aria-label": item.accessibleName, title: item.title, tabIndex: exiting ? -1 : tabIndex, className: cn('group flex min-h-12 shrink-0 items-stretch gap-2.5 self-stretch rounded-t-lg border border-b-2 px-4', maxTabWidthClass, exiting ? 'pointer-events-none' : cursorClass, tabItem(showActive)), onClick: exiting ? undefined : () => onSelect(item.id), onContextMenu: exiting
|
|
29
29
|
? undefined
|
|
30
30
|
: (event) => {
|
|
31
31
|
event.preventDefault();
|
|
@@ -10,7 +10,7 @@ interface Props {
|
|
|
10
10
|
title: string;
|
|
11
11
|
/**
|
|
12
12
|
* When true, renders a tab-height slot for wrapped tab lists; otherwise uses
|
|
13
|
-
* the compact
|
|
13
|
+
* the compact padded control for horizontal scroll mode.
|
|
14
14
|
*/
|
|
15
15
|
wrapped: boolean;
|
|
16
16
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TabNewButton.d.ts","sourceRoot":"","sources":["../../../src/components/TabBar/TabNewButton.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAKjC,UAAU,KAAK;IACb;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;;OAGG;IACH,OAAO,EAAE,OAAO,CAAC;IAEjB;;OAEG;IACH,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE,KAAK,GAAG,GAAG,CAAC,OAAO,
|
|
1
|
+
{"version":3,"file":"TabNewButton.d.ts","sourceRoot":"","sources":["../../../src/components/TabBar/TabNewButton.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAKjC,UAAU,KAAK;IACb;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;;OAGG;IACH,OAAO,EAAE,OAAO,CAAC;IAEjB;;OAEG;IACH,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE,KAAK,GAAG,GAAG,CAAC,OAAO,CAmCvF"}
|
|
@@ -8,7 +8,7 @@ import { cn } from '../utils.js';
|
|
|
8
8
|
*/
|
|
9
9
|
export function TabNewButton({ ariaLabel, title, wrapped, onClick }) {
|
|
10
10
|
if (wrapped) {
|
|
11
|
-
return (_jsx("div", { className: "flex shrink-0", children: _jsx("button", { type: "button", className: cn('app-no-drag
|
|
11
|
+
return (_jsx("div", { className: "flex shrink-0", children: _jsx("button", { type: "button", className: cn('app-no-drag inline-flex min-h-12 shrink-0 cursor-pointer items-center justify-center self-end rounded-t-lg border border-b-2 px-3 text-[14px]', tabItem(false)), title: title, "aria-label": ariaLabel, onClick: onClick, style: { width: 50 }, children: _jsx(FaIcon, { icon: faPlus, className: "h-3.5 w-3.5" }) }) }));
|
|
12
12
|
}
|
|
13
|
-
return (_jsx("div", { className: "
|
|
13
|
+
return (_jsx("div", { className: "flex shrink-0 items-end px-1", children: _jsx("button", { type: "button", className: "hc-tab-new-button app-no-drag mb-2.5 inline-flex shrink-0 cursor-pointer items-center justify-center border-none bg-transparent px-3 text-[14px] text-muted hover:bg-selection hover:text-text focus-visible:bg-selection focus-visible:text-text", title: title, "aria-label": ariaLabel, onClick: onClick, style: { width: 50 }, children: _jsx(FaIcon, { icon: faPlus, className: "h-3.5 w-3.5" }) }) }));
|
|
14
14
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/TabBar/index.tsx"],"names":[],"mappings":"AAmBA,OAAO,KAAK,EAAkB,GAAG,EAA6B,SAAS,EAAE,MAAM,OAAO,CAAC;AACvF,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAM3D,OAAO,KAAK,EAAE,UAAU,EAAE,YAAY,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAgCjF,UAAU,KAAK,CAAC,GAAG,SAAS,MAAM,GAAG,MAAM;IACzC;;OAEG;IACH,IAAI,EAAE,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;IAExB;;OAEG;IACH,QAAQ,EAAE,GAAG,CAAC;IAEd;;OAEG;IACH,IAAI,EAAE,OAAO,CAAC;IAEd;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACH,aAAa,EAAE,MAAM,CAAC;IAEtB;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB;;OAEG;IACH,MAAM,EAAE,YAAY,CAAC;IA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AAM,CAAC;IAE1B;;OAEG;IACH,cAAc,CAAC,EAAE,oBAAoB,CAAC;IAEtC;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAqDD;;;GAGG;AACH,wBAAgB,MAAM,CAAC,GAAG,SAAS,MAAM,GAAG,MAAM,EAAE,EAClD,IAAI,EACJ,QAAQ,EACR,IAAI,EACJ,SAAS,EACT,WAAW,EACX,aAAa,EACb,cAAc,EACd,MAAM,EACN,QAAQ,EACR,OAAO,EACP,SAAS,EACT,sBAAsB,EACtB,oBAAoB,EACpB,UAAU,EACV,qBAAqB,EACrB,gBAAgB,EAChB,cAAc,EACd,SAAS,EACV,EAAE,KAAK,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC,OAAO,CAoT1B;AAED,YAAY,EAAE,UAAU,EAAE,YAAY,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AACjF,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EACL,kBAAkB,EAClB,qBAAqB,EACrB,qBAAqB,EACrB,KAAK,cAAc,EACpB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,uBAAuB,EACvB,mBAAmB,EACnB,uBAAuB,EACxB,MAAM,0BAA0B,CAAC"}
|
|
@@ -179,10 +179,12 @@ export function TabBar({ tabs, activeId, wrap, ariaLabel, tabIdPrefix, panelIdPr
|
|
|
179
179
|
});
|
|
180
180
|
}
|
|
181
181
|
};
|
|
182
|
-
const tabRowClassName = wrap
|
|
182
|
+
const tabRowClassName = wrap
|
|
183
|
+
? 'w-full min-w-0 pt-1 pb-0'
|
|
184
|
+
: 'flex w-max flex-nowrap items-end pt-1 pb-0';
|
|
183
185
|
const tabListClassName = wrap
|
|
184
|
-
? 'flex min-w-0 w-full flex-wrap items-end gap-y-2'
|
|
185
|
-
: 'flex items-end';
|
|
186
|
+
? 'flex min-w-0 w-full flex-wrap items-end gap-x-1.5 gap-y-2'
|
|
187
|
+
: 'flex items-end gap-x-1.5';
|
|
186
188
|
const sortStrategy = wrap ? rectSortingStrategy : horizontalListSortingStrategy;
|
|
187
189
|
const newTabButton = (_jsx(TabNewButton, { wrapped: wrap, ariaLabel: newTab.ariaLabel, title: newTab.title, onClick: newTab.onClick }));
|
|
188
190
|
/**
|
|
@@ -212,7 +214,7 @@ export function TabBar({ tabs, activeId, wrap, ariaLabel, tabIdPrefix, panelIdPr
|
|
|
212
214
|
}) }, exitingTab.exitKey)))] }), wrap ? newTabButton : null] }), _jsx(DragOverlay, { children: activeDragTab ? (_jsx("div", { className: "rounded-t-lg border border-separator bg-surface px-3 py-2 text-[14px] font-medium shadow-md", children: activeDragTab.dragLabel })) : null })] }), wrap ? null : newTabButton] }));
|
|
213
215
|
const defaultScrollContainer = (row) => (_jsx("div", { className: "min-w-0 flex-1 overflow-x-auto", children: row }));
|
|
214
216
|
const scrollContainer = renderScrollContainer ?? defaultScrollContainer;
|
|
215
|
-
const containerClassName = cn('app-no-drag flex shrink-0 items-end
|
|
217
|
+
const containerClassName = cn('app-no-drag flex shrink-0 items-end bg-sidebar px-2', className);
|
|
216
218
|
return (_jsxs("div", { className: containerClassName, children: [wrap ? _jsx("div", { className: "min-w-0 flex-1", children: tabRow }) : scrollContainer(tabRow), contextMenu != null && buildContextMenuGroups != null && (_jsx(TabContextMenu, { groups: contextMenuGroups, position: { x: contextMenu.x, y: contextMenu.y }, onClose: () => setContextMenu(null) }))] }));
|
|
217
219
|
}
|
|
218
220
|
export { TabNewButton } from './TabNewButton.js';
|
|
@@ -65,6 +65,7 @@ interface Props extends Omit<ComponentPropsWithoutRef<'div'>, 'children' | 'aria
|
|
|
65
65
|
}
|
|
66
66
|
/**
|
|
67
67
|
* Top-of-sidebar toolbar with left-aligned actions and optional right-aligned toggles.
|
|
68
|
+
* Action icons wrap to additional rows when the sidebar is narrower than one row.
|
|
68
69
|
*/
|
|
69
70
|
export declare function Toolbar({ actions, toggles, ariaLabel, className, ...props }: Props): JSX.Element;
|
|
70
71
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Toolbar/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AACxE,OAAO,KAAK,EAAE,cAAc,EAAE,wBAAwB,EAAE,GAAG,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAIjG;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;OAEG;IACH,IAAI,EAAE,cAAc,CAAC;IAErB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,OAAO,EAAE,MAAM,IAAI,CAAC;IAEpB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;OAEG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IAEvB;;OAEG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IAEtB;;OAEG;IACH,YAAY,CAAC,EAAE,cAAc,CAAC,eAAe,CAAC,CAAC;IAE/C;;OAEG;IACH,OAAO,CAAC,EAAE,SAAS,CAAC;IAEpB;;OAEG;IACH,SAAS,CAAC,EAAE,SAAS,CAAC,iBAAiB,GAAG,IAAI,CAAC,CAAC;CACjD;AAED,UAAU,KAAM,SAAQ,IAAI,CAAC,wBAAwB,CAAC,KAAK,CAAC,EAAE,UAAU,GAAG,YAAY,CAAC;IACtF;;OAEG;IACH,OAAO,EAAE,aAAa,EAAE,CA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;AAqED;;;GAGG;AACH,wBAAgB,OAAO,CAAC,EACtB,OAAO,EACP,OAAO,EACP,SAAqB,EACrB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,GAAG,GAAG,CAAC,OAAO,CAqBrB"}
|
|
@@ -41,7 +41,8 @@ function renderAction(action) {
|
|
|
41
41
|
}
|
|
42
42
|
/**
|
|
43
43
|
* Top-of-sidebar toolbar with left-aligned actions and optional right-aligned toggles.
|
|
44
|
+
* Action icons wrap to additional rows when the sidebar is narrower than one row.
|
|
44
45
|
*/
|
|
45
46
|
export function Toolbar({ actions, toggles, ariaLabel = 'Toolbar', className, ...props }) {
|
|
46
|
-
return (_jsxs("div", { ...props, role: "toolbar", "aria-label": ariaLabel, className: cn('hc-toolbar app-no-drag flex shrink-0 items-center border-b border-separator bg-sidebar-toolbar px-2 py-2', className), children: [_jsx("div", { className: "hc-toolbar-actions flex items-center gap-1 leading-none", children: actions.map(renderAction) }), toggles && toggles.length > 0 ? (_jsx("div", { className: "hc-toolbar-toggles ml-auto flex items-center gap-1", children: toggles.map(renderAction) })) : null] }));
|
|
47
|
+
return (_jsxs("div", { ...props, role: "toolbar", "aria-label": ariaLabel, className: cn('hc-toolbar app-no-drag flex min-w-0 shrink-0 flex-wrap items-center gap-y-1 border-b border-separator bg-sidebar-toolbar px-2 py-2', className), children: [_jsx("div", { className: "hc-toolbar-actions flex min-w-0 flex-1 flex-wrap items-center gap-1 leading-none", children: actions.map(renderAction) }), toggles && toggles.length > 0 ? (_jsx("div", { className: "hc-toolbar-toggles ml-auto flex shrink-0 items-center gap-1", children: toggles.map(renderAction) })) : null] }));
|
|
47
48
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Shared macOS-style Tailwind class strings for SDK UI components.
|
|
3
3
|
*/
|
|
4
|
-
export declare const segmentGroup = "
|
|
4
|
+
export declare const segmentGroup = "flex min-w-0 max-w-full w-full p-3 border-b border-separator shadow-[inset_0_0.5px_1px_rgba(0,0,0,0.06)] app-no-drag";
|
|
5
5
|
/**
|
|
6
6
|
* Tailwind classes for a segmented control button.
|
|
7
7
|
*
|
|
@@ -13,8 +13,11 @@ export declare function segment(active: boolean): string;
|
|
|
13
13
|
*
|
|
14
14
|
* @param active - Whether this tab is the selected editor.
|
|
15
15
|
* @returns Border, background, and text color classes for the tab shell.
|
|
16
|
-
*
|
|
17
|
-
*
|
|
16
|
+
* The active tab uses opaque `bg-surface` and a matching bottom
|
|
17
|
+
* border so it merges with the panel below. Inactive tabs draw
|
|
18
|
+
* their own bottom separator (the bar container has none) so the
|
|
19
|
+
* rule remains visible under them. Both states reserve the same
|
|
20
|
+
* bottom border width for height alignment.
|
|
18
21
|
*/
|
|
19
22
|
export declare function tabItem(active: boolean): string;
|
|
20
23
|
//# sourceMappingURL=classes.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"classes.d.ts","sourceRoot":"","sources":["../../src/components/classes.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,eAAO,MAAM,YAAY,
|
|
1
|
+
{"version":3,"file":"classes.d.ts","sourceRoot":"","sources":["../../src/components/classes.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,eAAO,MAAM,YAAY,yHAC+F,CAAC;AAKzH;;;;GAIG;AACH,wBAAgB,OAAO,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,CAI/C;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,OAAO,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,CAI/C"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Shared macOS-style Tailwind class strings for SDK UI components.
|
|
3
3
|
*/
|
|
4
|
-
export const segmentGroup = '
|
|
4
|
+
export const segmentGroup = 'flex min-w-0 max-w-full w-full p-3 border-b border-separator shadow-[inset_0_0.5px_1px_rgba(0,0,0,0.06)] app-no-drag';
|
|
5
5
|
const segmentFocusVisible = 'focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-accent';
|
|
6
6
|
/**
|
|
7
7
|
* Tailwind classes for a segmented control button.
|
|
@@ -18,11 +18,14 @@ export function segment(active) {
|
|
|
18
18
|
*
|
|
19
19
|
* @param active - Whether this tab is the selected editor.
|
|
20
20
|
* @returns Border, background, and text color classes for the tab shell.
|
|
21
|
-
*
|
|
22
|
-
*
|
|
21
|
+
* The active tab uses opaque `bg-surface` and a matching bottom
|
|
22
|
+
* border so it merges with the panel below. Inactive tabs draw
|
|
23
|
+
* their own bottom separator (the bar container has none) so the
|
|
24
|
+
* rule remains visible under them. Both states reserve the same
|
|
25
|
+
* bottom border width for height alignment.
|
|
23
26
|
*/
|
|
24
27
|
export function tabItem(active) {
|
|
25
28
|
return active
|
|
26
|
-
? 'border-separator/70 border-b-
|
|
27
|
-
: 'border-separator/50 border-b-
|
|
29
|
+
? 'relative z-[1] border-separator/70 border-b-surface bg-surface text-text [border-bottom-width:var(--mac-tab-border-width)] focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-[-2px] focus-visible:outline-accent'
|
|
30
|
+
: 'border-separator/50 border-b-separator/50 bg-control/20 text-muted [border-bottom-width:var(--mac-tab-border-width)] hover:bg-selection/60 hover:text-text focus-visible:bg-selection/60 focus-visible:text-text focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-[-2px] focus-visible:outline-accent';
|
|
28
31
|
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { ComponentPropsWithoutRef, JSX, Ref } from 'react';
|
|
2
|
+
interface Props extends Omit<ComponentPropsWithoutRef<'input'>, 'type' | 'ref' | 'className'> {
|
|
3
|
+
/**
|
|
4
|
+
* Additional Tailwind classes applied to the outer wrapper.
|
|
5
|
+
*/
|
|
6
|
+
className?: string;
|
|
7
|
+
/**
|
|
8
|
+
* Ref forwarded to the underlying native checkbox input.
|
|
9
|
+
*/
|
|
10
|
+
ref?: Ref<HTMLInputElement>;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* On/off toggle for binary settings where the change applies immediately.
|
|
14
|
+
*
|
|
15
|
+
* Built on a native checkbox with `role="switch"` so keyboard activation, form
|
|
16
|
+
* participation, and screen-reader state come for free; the visible pill and
|
|
17
|
+
* knob are decorative siblings driven by `peer-checked`.
|
|
18
|
+
*/
|
|
19
|
+
export declare function Switch({ ref, className, ...props }: Props): JSX.Element;
|
|
20
|
+
export {};
|
|
21
|
+
//# sourceMappingURL=Switch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Switch.d.ts","sourceRoot":"","sources":["../../../src/components/forms/Switch.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAIhE,UAAU,KAAM,SAAQ,IAAI,CAAC,wBAAwB,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,KAAK,GAAG,WAAW,CAAC;IAC3F;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,GAAG,CAAC,EAAE,GAAG,CAAC,gBAAgB,CAAC,CAAC;CAC7B;AAED;;;;;;GAMG;AACH,wBAAgB,MAAM,CAAC,EAAE,GAAG,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,GAAG,GAAG,CAAC,OAAO,CAoBvE"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "@harborclient/sdk/jsx-runtime";
|
|
2
|
+
import { cn } from '../utils.js';
|
|
3
|
+
import { switchInput, switchThumb, switchTrack } from './classes.js';
|
|
4
|
+
/**
|
|
5
|
+
* On/off toggle for binary settings where the change applies immediately.
|
|
6
|
+
*
|
|
7
|
+
* Built on a native checkbox with `role="switch"` so keyboard activation, form
|
|
8
|
+
* participation, and screen-reader state come for free; the visible pill and
|
|
9
|
+
* knob are decorative siblings driven by `peer-checked`.
|
|
10
|
+
*/
|
|
11
|
+
export function Switch({ ref, className, ...props }) {
|
|
12
|
+
return (_jsxs("span", { className: cn('hc-switch relative inline-flex h-[26px] w-[44px] shrink-0 leading-none', className), children: [_jsx("input", { ...props, ref: ref, type: "checkbox", role: "switch", className: cn('hc-switch-input', switchInput) }), _jsx("span", { className: cn('hc-switch-track', switchTrack), "aria-hidden": true, children: _jsx("span", { className: cn('hc-switch-thumb', switchThumb) }) })] }));
|
|
13
|
+
}
|
|
@@ -13,13 +13,19 @@ export declare const surfaceField = "w-full rounded-lg border border-separator b
|
|
|
13
13
|
/** Transparent overlay checkbox input sized to {@link checkboxBox}. */
|
|
14
14
|
export declare const checkboxInput = "peer absolute inset-0 m-0 h-full w-full cursor-pointer opacity-0 disabled:cursor-not-allowed";
|
|
15
15
|
/** Custom checkbox box styled via `peer-checked` / `peer-focus-visible` on {@link checkboxInput}. */
|
|
16
|
-
export declare const checkboxBox = "pointer-events-none flex h-[18px] w-[18px] shrink-0 items-center justify-center rounded-sm border border-separator bg-field text-
|
|
16
|
+
export declare const checkboxBox = "pointer-events-none flex h-[18px] w-[18px] shrink-0 items-center justify-center rounded-sm border border-separator bg-field text-accent peer-checked:border-transparent peer-checked:bg-selection peer-focus-visible:outline peer-focus-visible:outline-2 peer-focus-visible:outline-offset-2 peer-focus-visible:outline-accent peer-disabled:cursor-not-allowed peer-disabled:opacity-50 [&>svg]:opacity-0 peer-checked:[&>svg]:opacity-100";
|
|
17
17
|
/** Transparent overlay radio input sized to {@link radioCircle}. */
|
|
18
18
|
export declare const radioInput = "peer absolute inset-0 m-0 h-full w-full cursor-pointer opacity-0 disabled:cursor-not-allowed";
|
|
19
19
|
/** Custom radio circle styled via `peer-checked` / `peer-focus-visible` on {@link radioInput}. */
|
|
20
|
-
export declare const radioCircle = "pointer-events-none relative h-[18px] w-[18px] shrink-0 leading-none rounded-full border border-separator bg-field peer-checked:border-
|
|
20
|
+
export declare const radioCircle = "pointer-events-none relative h-[18px] w-[18px] shrink-0 leading-none rounded-full border border-separator bg-field peer-checked:border-transparent peer-checked:bg-selection peer-focus-visible:outline peer-focus-visible:outline-2 peer-focus-visible:outline-offset-2 peer-focus-visible:outline-accent peer-disabled:cursor-not-allowed peer-disabled:opacity-50 [&>span]:opacity-0 peer-checked:[&>span]:opacity-100";
|
|
21
21
|
/** Checked-state dot centered inside {@link radioCircle}. */
|
|
22
22
|
export declare const radioDot = "absolute left-1/2 top-1/2 block h-2 w-2 -translate-x-1/2 -translate-y-1/2 shrink-0 rounded-full bg-accent";
|
|
23
|
+
/** Transparent overlay checkbox input sized to {@link switchTrack}. */
|
|
24
|
+
export declare const switchInput = "peer absolute inset-0 m-0 h-full w-full cursor-pointer opacity-0 disabled:cursor-not-allowed";
|
|
25
|
+
/** Pill track styled via `peer-checked` / `peer-focus-visible` on {@link switchInput}. */
|
|
26
|
+
export declare const switchTrack = "pointer-events-none relative block h-[26px] w-[44px] shrink-0 rounded-full border border-separator bg-field transition-colors duration-150 motion-reduce:transition-none peer-checked:border-transparent peer-checked:bg-selection peer-focus-visible:outline peer-focus-visible:outline-2 peer-focus-visible:outline-offset-2 peer-focus-visible:outline-accent peer-disabled:cursor-not-allowed peer-disabled:opacity-50 peer-checked:[&>span]:translate-x-[18px]";
|
|
27
|
+
/** Knob that slides across {@link switchTrack} when {@link switchInput} is checked. */
|
|
28
|
+
export declare const switchThumb = "absolute left-[2px] top-[2px] block h-[20px] w-[20px] rounded-full bg-white shadow-sm transition-transform duration-150 motion-reduce:transition-none";
|
|
23
29
|
/**
|
|
24
30
|
* Merges a field variant preset with optional caller classes.
|
|
25
31
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"classes.d.ts","sourceRoot":"","sources":["../../../src/components/forms/classes.ts"],"names":[],"mappings":"AAKA;;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,oFACiE,CAAC;AAEpF,wDAAwD;AACxD,eAAO,MAAM,YAAY,yFAC+D,CAAC;AAEzF,uEAAuE;AACvE,eAAO,MAAM,aAAa,iGACsE,CAAC;AAEjG,qGAAqG;AACrG,eAAO,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"classes.d.ts","sourceRoot":"","sources":["../../../src/components/forms/classes.ts"],"names":[],"mappings":"AAKA;;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,oFACiE,CAAC;AAEpF,wDAAwD;AACxD,eAAO,MAAM,YAAY,yFAC+D,CAAC;AAEzF,uEAAuE;AACvE,eAAO,MAAM,aAAa,iGACsE,CAAC;AAEjG,qGAAqG;AACrG,eAAO,MAAM,WAAW,ibACwZ,CAAC;AAEjb,oEAAoE;AACpE,eAAO,MAAM,UAAU,iGACyE,CAAC;AAEjG,kGAAkG;AAClG,eAAO,MAAM,WAAW,8ZACqY,CAAC;AAE9Z,6DAA6D;AAC7D,eAAO,MAAM,QAAQ,8GACwF,CAAC;AAE9G,uEAAuE;AACvE,eAAO,MAAM,WAAW,iGACwE,CAAC;AAEjG,0FAA0F;AAC1F,eAAO,MAAM,WAAW,wcAC+a,CAAC;AAExc,uFAAuF;AACvF,eAAO,MAAM,WAAW,0JACiI,CAAC;AAE1J;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,YAAY,EACrB,SAAS,CAAC,EAAE,MAAM,EAClB,SAAS,CAAC,EAAE,MAAM,GACjB,MAAM,GAAG,SAAS,CAOpB"}
|
|
@@ -13,13 +13,19 @@ export const surfaceField = 'w-full rounded-lg border border-separator bg-field
|
|
|
13
13
|
/** Transparent overlay checkbox input sized to {@link checkboxBox}. */
|
|
14
14
|
export const checkboxInput = 'peer absolute inset-0 m-0 h-full w-full cursor-pointer opacity-0 disabled:cursor-not-allowed';
|
|
15
15
|
/** Custom checkbox box styled via `peer-checked` / `peer-focus-visible` on {@link checkboxInput}. */
|
|
16
|
-
export const checkboxBox = 'pointer-events-none flex h-[18px] w-[18px] shrink-0 items-center justify-center rounded-sm border border-separator bg-field text-
|
|
16
|
+
export const checkboxBox = 'pointer-events-none flex h-[18px] w-[18px] shrink-0 items-center justify-center rounded-sm border border-separator bg-field text-accent peer-checked:border-transparent peer-checked:bg-selection peer-focus-visible:outline peer-focus-visible:outline-2 peer-focus-visible:outline-offset-2 peer-focus-visible:outline-accent peer-disabled:cursor-not-allowed peer-disabled:opacity-50 [&>svg]:opacity-0 peer-checked:[&>svg]:opacity-100';
|
|
17
17
|
/** Transparent overlay radio input sized to {@link radioCircle}. */
|
|
18
18
|
export const radioInput = 'peer absolute inset-0 m-0 h-full w-full cursor-pointer opacity-0 disabled:cursor-not-allowed';
|
|
19
19
|
/** Custom radio circle styled via `peer-checked` / `peer-focus-visible` on {@link radioInput}. */
|
|
20
|
-
export const radioCircle = 'pointer-events-none relative h-[18px] w-[18px] shrink-0 leading-none rounded-full border border-separator bg-field peer-checked:border-
|
|
20
|
+
export const radioCircle = 'pointer-events-none relative h-[18px] w-[18px] shrink-0 leading-none rounded-full border border-separator bg-field peer-checked:border-transparent peer-checked:bg-selection peer-focus-visible:outline peer-focus-visible:outline-2 peer-focus-visible:outline-offset-2 peer-focus-visible:outline-accent peer-disabled:cursor-not-allowed peer-disabled:opacity-50 [&>span]:opacity-0 peer-checked:[&>span]:opacity-100';
|
|
21
21
|
/** Checked-state dot centered inside {@link radioCircle}. */
|
|
22
22
|
export const radioDot = 'absolute left-1/2 top-1/2 block h-2 w-2 -translate-x-1/2 -translate-y-1/2 shrink-0 rounded-full bg-accent';
|
|
23
|
+
/** Transparent overlay checkbox input sized to {@link switchTrack}. */
|
|
24
|
+
export const switchInput = 'peer absolute inset-0 m-0 h-full w-full cursor-pointer opacity-0 disabled:cursor-not-allowed';
|
|
25
|
+
/** Pill track styled via `peer-checked` / `peer-focus-visible` on {@link switchInput}. */
|
|
26
|
+
export const switchTrack = 'pointer-events-none relative block h-[26px] w-[44px] shrink-0 rounded-full border border-separator bg-field transition-colors duration-150 motion-reduce:transition-none peer-checked:border-transparent peer-checked:bg-selection peer-focus-visible:outline peer-focus-visible:outline-2 peer-focus-visible:outline-offset-2 peer-focus-visible:outline-accent peer-disabled:cursor-not-allowed peer-disabled:opacity-50 peer-checked:[&>span]:translate-x-[18px]';
|
|
27
|
+
/** Knob that slides across {@link switchTrack} when {@link switchInput} is checked. */
|
|
28
|
+
export const switchThumb = 'absolute left-[2px] top-[2px] block h-[20px] w-[20px] rounded-full bg-white shadow-sm transition-transform duration-150 motion-reduce:transition-none';
|
|
23
29
|
/**
|
|
24
30
|
* Merges a field variant preset with optional caller classes.
|
|
25
31
|
*
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
export { field, fieldFrame, surfaceField, checkboxInput, checkboxBox, radioInput, radioCircle, radioDot, mergeFieldClasses, type FieldVariant } from './classes.js';
|
|
1
|
+
export { field, fieldFrame, surfaceField, checkboxInput, checkboxBox, radioInput, radioCircle, radioDot, switchInput, switchTrack, switchThumb, mergeFieldClasses, type FieldVariant } from './classes.js';
|
|
2
2
|
export { Checkbox } from './Checkbox.js';
|
|
3
3
|
export { Radio } from './Radio.js';
|
|
4
|
+
export { Switch } from './Switch.js';
|
|
4
5
|
export { Input } from './Input.js';
|
|
5
6
|
export { Textarea } from './Textarea.js';
|
|
6
7
|
export { Select } from './Select.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/forms/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,EACL,UAAU,EACV,YAAY,EACZ,aAAa,EACb,WAAW,EACX,UAAU,EACV,WAAW,EACX,QAAQ,EACR,iBAAiB,EACjB,KAAK,YAAY,EAClB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/forms/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,EACL,UAAU,EACV,YAAY,EACZ,aAAa,EACb,WAAW,EACX,UAAU,EACV,WAAW,EACX,QAAQ,EACR,WAAW,EACX,WAAW,EACX,WAAW,EACX,iBAAiB,EACjB,KAAK,YAAY,EAClB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
export { field, fieldFrame, surfaceField, checkboxInput, checkboxBox, radioInput, radioCircle, radioDot, mergeFieldClasses } from './classes.js';
|
|
1
|
+
export { field, fieldFrame, surfaceField, checkboxInput, checkboxBox, radioInput, radioCircle, radioDot, switchInput, switchTrack, switchThumb, mergeFieldClasses } from './classes.js';
|
|
2
2
|
export { Checkbox } from './Checkbox.js';
|
|
3
3
|
export { Radio } from './Radio.js';
|
|
4
|
+
export { Switch } from './Switch.js';
|
|
4
5
|
export { Input } from './Input.js';
|
|
5
6
|
export { Textarea } from './Textarea.js';
|
|
6
7
|
export { Select } from './Select.js';
|
|
@@ -36,7 +36,7 @@ export { FooterPanel } from './FooterPanel/index.js';
|
|
|
36
36
|
export { FormGroup } from './FormGroup/index.js';
|
|
37
37
|
export { FormSection } from './FormSection/index.js';
|
|
38
38
|
export type { Props as FormSectionProps } from './FormSection/index.js';
|
|
39
|
-
export { Input, Checkbox, Radio, Select, Textarea, field, fieldFrame, surfaceField, mergeFieldClasses } from './forms/index.js';
|
|
39
|
+
export { Input, Checkbox, Radio, Select, Switch, Textarea, field, fieldFrame, surfaceField, mergeFieldClasses } from './forms/index.js';
|
|
40
40
|
export type { FieldVariant } from './forms/classes.js';
|
|
41
41
|
export { KeyValueEditor } from './KeyValueEditor/index.js';
|
|
42
42
|
export type { Props as KeyValueEditorProps } from './KeyValueEditor/index.js';
|
|
@@ -99,6 +99,6 @@ export { cleanVariables, resolveTabListKeyAction } from './utils.js';
|
|
|
99
99
|
export type { TabListKeyOptions } from './utils.js';
|
|
100
100
|
export { useDialogFocus, getFocusableElements } from './useDialogFocus.js';
|
|
101
101
|
export { segment, segmentGroup, tabItem } from './classes.js';
|
|
102
|
-
export { SidebarItem, SidebarListbox, SidebarList, SidebarTree, SidebarTreeGroup, handleSidebarOptionKeyDown, type SidebarItemListboxOption, type SidebarItemTreeItem, SortableSidebarItem, stopSortableDragPointerDown, SidebarColorDot, SidebarBadge, sourceRow, METHOD_CLASSES, statusDotVariant, statusDotClass, SIDEBAR_ITEM_BUTTON_CLASS,
|
|
102
|
+
export { SidebarItem, SidebarListbox, SidebarList, SidebarTree, SidebarTreeGroup, handleSidebarOptionKeyDown, type SidebarItemListboxOption, type SidebarItemTreeItem, SortableSidebarItem, stopSortableDragPointerDown, SidebarColorDot, SidebarBadge, sourceRow, METHOD_CLASSES, statusDotVariant, statusDotClass, SIDEBAR_ITEM_BUTTON_CLASS, SIDEBAR_CHEVRON_BUTTON_CLASS, SIDEBAR_CHEVRON_ICON_CLASS, SIDEBAR_CHEVRON_SLOT_CLASS, SIDEBAR_CHEVRON_LABEL_OFFSET_CLASS, SidebarMethodBadge, SidebarStatusDot, SidebarStatusMarker, SidebarRequestItem, SidebarDocumentItem, SidebarFolderItem, SidebarRunItem, SidebarHistoryItem, SidebarEnvironmentItem, SidebarTabGroupItem, SidebarCommitItem, type SidebarItemSortableConfig, type SidebarBadgeVariant, type SidebarCommitPushStatus } from './SidebarItem/index.js';
|
|
103
103
|
export type { FormDataPart, FormDataPartType, HttpMethod, KeyValue, Variable } from '../types.js';
|
|
104
104
|
//# sourceMappingURL=index.d.ts.map
|