@harborclient/sdk 1.1.13 → 1.1.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Badge/index.d.ts +1 -1
- package/dist/components/Badge/index.d.ts.map +1 -1
- package/dist/components/Badge/index.js +2 -0
- package/dist/components/Breadcrumb/CrumbSegment.d.ts +19 -0
- package/dist/components/Breadcrumb/CrumbSegment.d.ts.map +1 -0
- package/dist/components/Breadcrumb/CrumbSegment.js +19 -0
- package/dist/components/Breadcrumb/EditableSegment.d.ts +46 -0
- package/dist/components/Breadcrumb/EditableSegment.d.ts.map +1 -0
- package/dist/components/Breadcrumb/EditableSegment.js +14 -0
- package/dist/components/Breadcrumb/SegmentShell.d.ts +32 -0
- package/dist/components/Breadcrumb/SegmentShell.d.ts.map +1 -0
- package/dist/components/Breadcrumb/SegmentShell.js +35 -0
- package/dist/components/Breadcrumb/index.d.ts +2 -18
- package/dist/components/Breadcrumb/index.d.ts.map +1 -1
- package/dist/components/Breadcrumb/index.js +2 -61
- package/dist/components/Breadcrumb/types.d.ts +18 -0
- package/dist/components/Breadcrumb/types.d.ts.map +1 -0
- package/dist/components/Breadcrumb/types.js +1 -0
- package/dist/components/CatalogCard/index.d.ts +51 -0
- package/dist/components/CatalogCard/index.d.ts.map +1 -0
- package/dist/components/CatalogCard/index.js +23 -0
- package/dist/components/CatalogReadmeMarkdown/index.d.ts +13 -0
- package/dist/components/CatalogReadmeMarkdown/index.d.ts.map +1 -0
- package/dist/components/CatalogReadmeMarkdown/index.js +53 -0
- package/dist/components/FormGroup/index.d.ts +6 -1
- package/dist/components/FormGroup/index.d.ts.map +1 -1
- package/dist/components/FormGroup/index.js +21 -10
- package/dist/components/FormSection/index.d.ts +37 -0
- package/dist/components/FormSection/index.d.ts.map +1 -0
- package/dist/components/FormSection/index.js +9 -0
- package/dist/components/ProgressBar/index.d.ts +20 -0
- package/dist/components/ProgressBar/index.d.ts.map +1 -0
- package/dist/components/ProgressBar/index.js +10 -0
- package/dist/components/ProgressBar/progressBar.logic.d.ts +9 -0
- package/dist/components/ProgressBar/progressBar.logic.d.ts.map +1 -0
- package/dist/components/ProgressBar/progressBar.logic.js +13 -0
- package/dist/components/PromptModal/index.d.ts +82 -0
- package/dist/components/PromptModal/index.d.ts.map +1 -0
- package/dist/components/PromptModal/index.js +22 -0
- package/dist/components/PromptModal/promptModal.logic.d.ts +8 -0
- package/dist/components/PromptModal/promptModal.logic.d.ts.map +1 -0
- package/dist/components/PromptModal/promptModal.logic.js +9 -0
- package/dist/components/ScreenshotCarousel/ScreenshotLightbox.d.ts +29 -0
- package/dist/components/ScreenshotCarousel/ScreenshotLightbox.d.ts.map +1 -0
- package/dist/components/ScreenshotCarousel/ScreenshotLightbox.js +66 -0
- package/dist/components/ScreenshotCarousel/index.d.ts +35 -0
- package/dist/components/ScreenshotCarousel/index.d.ts.map +1 -0
- package/dist/components/ScreenshotCarousel/index.js +89 -0
- package/dist/components/ScreenshotCarousel/variants.d.ts +17 -0
- package/dist/components/ScreenshotCarousel/variants.d.ts.map +1 -0
- package/dist/components/ScreenshotCarousel/variants.js +22 -0
- package/dist/components/SelectionActionToolbar/index.d.ts +41 -0
- package/dist/components/SelectionActionToolbar/index.d.ts.map +1 -0
- package/dist/components/SelectionActionToolbar/index.js +13 -0
- package/dist/components/SettingIdLabel/index.d.ts +16 -0
- package/dist/components/SettingIdLabel/index.d.ts.map +1 -0
- package/dist/components/SettingIdLabel/index.js +7 -0
- package/dist/components/SettingSectionHeading/index.d.ts +33 -0
- package/dist/components/SettingSectionHeading/index.d.ts.map +1 -0
- package/dist/components/SettingSectionHeading/index.js +10 -0
- package/dist/components/SidebarItem/SidebarDocumentItem.d.ts +79 -0
- package/dist/components/SidebarItem/SidebarDocumentItem.d.ts.map +1 -0
- package/dist/components/SidebarItem/SidebarDocumentItem.js +26 -0
- package/dist/components/SidebarItem/SidebarRequestItem.d.ts +0 -76
- package/dist/components/SidebarItem/SidebarRequestItem.d.ts.map +1 -1
- package/dist/components/SidebarItem/SidebarRequestItem.js +0 -21
- package/dist/components/SidebarItem/SidebarTree.d.ts +0 -21
- package/dist/components/SidebarItem/SidebarTree.d.ts.map +1 -1
- package/dist/components/SidebarItem/SidebarTree.js +0 -9
- package/dist/components/SidebarItem/SidebarTreeGroup.d.ts +24 -0
- package/dist/components/SidebarItem/SidebarTreeGroup.d.ts.map +1 -0
- package/dist/components/SidebarItem/SidebarTreeGroup.js +11 -0
- package/dist/components/SidebarItem/index.d.ts +5 -3
- package/dist/components/SidebarItem/index.d.ts.map +1 -1
- package/dist/components/SidebarItem/index.js +5 -3
- package/dist/components/SidebarItem/sidebarItemClasses.d.ts +8 -0
- package/dist/components/SidebarItem/sidebarItemClasses.d.ts.map +1 -1
- package/dist/components/SidebarItem/sidebarItemClasses.js +18 -8
- package/dist/components/SidebarSection/SectionItem.d.ts +40 -0
- package/dist/components/SidebarSection/SectionItem.d.ts.map +1 -0
- package/dist/components/SidebarSection/SectionItem.js +19 -0
- package/dist/components/SidebarSection/SidebarSection.d.ts +2 -38
- package/dist/components/SidebarSection/SidebarSection.d.ts.map +1 -1
- package/dist/components/SidebarSection/SidebarSection.js +2 -19
- package/dist/components/StatusDot/index.d.ts +42 -0
- package/dist/components/StatusDot/index.d.ts.map +1 -0
- package/dist/components/StatusDot/index.js +42 -0
- package/dist/components/ThemeVariantPickerModal/index.d.ts +71 -0
- package/dist/components/ThemeVariantPickerModal/index.d.ts.map +1 -0
- package/dist/components/ThemeVariantPickerModal/index.js +37 -0
- package/dist/components/VisibilityMenu/MenuCheckboxItem.d.ts +14 -0
- package/dist/components/VisibilityMenu/MenuCheckboxItem.d.ts.map +1 -0
- package/dist/components/VisibilityMenu/MenuCheckboxItem.js +14 -0
- package/dist/components/VisibilityMenu/index.d.ts.map +1 -1
- package/dist/components/VisibilityMenu/index.js +2 -11
- package/dist/components/index.d.ts +24 -1
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +15 -1
- package/package.json +6 -2
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import type { IconDefinition } from '@fortawesome/fontawesome-svg-core';
|
|
2
|
+
import type { JSX, MouseEvent, ReactNode } from 'react';
|
|
3
|
+
interface Props {
|
|
4
|
+
/**
|
|
5
|
+
* Icon shown before the document name. Defaults to a file-lines icon when omitted.
|
|
6
|
+
*/
|
|
7
|
+
icon?: IconDefinition;
|
|
8
|
+
/**
|
|
9
|
+
* Primary label text for the row.
|
|
10
|
+
*/
|
|
11
|
+
name: string;
|
|
12
|
+
/**
|
|
13
|
+
* Optional Tailwind classes applied to the name text (e.g. git status colors).
|
|
14
|
+
*/
|
|
15
|
+
nameClassName?: string;
|
|
16
|
+
/**
|
|
17
|
+
* Optional color dot configuration for collection sidebar rows.
|
|
18
|
+
*/
|
|
19
|
+
colorDot?: {
|
|
20
|
+
color: string | null | undefined;
|
|
21
|
+
visible?: boolean;
|
|
22
|
+
label?: string;
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* Optional git change status marker shown after the name in git sidebar rows.
|
|
26
|
+
*/
|
|
27
|
+
statusMarker?: {
|
|
28
|
+
marker: string;
|
|
29
|
+
className?: string;
|
|
30
|
+
label: string;
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* Whether this row should use selected/highlighted row styling.
|
|
34
|
+
*/
|
|
35
|
+
selected?: boolean;
|
|
36
|
+
/**
|
|
37
|
+
* Accessible label for the listbox option. When omitted, the name is derived
|
|
38
|
+
* from visible row content (name, markers).
|
|
39
|
+
*/
|
|
40
|
+
ariaLabel?: string;
|
|
41
|
+
/**
|
|
42
|
+
* Overrides the `aria-selected` state. When omitted, falls back to `selected`.
|
|
43
|
+
*/
|
|
44
|
+
ariaSelected?: boolean;
|
|
45
|
+
/**
|
|
46
|
+
* When true, marks the row as the current item with `aria-current="true"`.
|
|
47
|
+
*/
|
|
48
|
+
ariaCurrent?: boolean;
|
|
49
|
+
/**
|
|
50
|
+
* Called when the user right-clicks the row container.
|
|
51
|
+
*/
|
|
52
|
+
onContextMenu?: (event: MouseEvent<HTMLElement>) => void;
|
|
53
|
+
/**
|
|
54
|
+
* Called when the primary label area is activated.
|
|
55
|
+
*/
|
|
56
|
+
onClick?: (event: MouseEvent<HTMLElement>) => void;
|
|
57
|
+
/**
|
|
58
|
+
* Called when the primary label area is double-clicked.
|
|
59
|
+
*/
|
|
60
|
+
onDoubleClick?: (event: MouseEvent<HTMLElement>) => void;
|
|
61
|
+
/**
|
|
62
|
+
* Trailing actions slot, typically a row actions menu.
|
|
63
|
+
*/
|
|
64
|
+
actions?: ReactNode;
|
|
65
|
+
/**
|
|
66
|
+
* HTML element for the row container. Use `li` inside {@link SidebarListbox}.
|
|
67
|
+
*/
|
|
68
|
+
as?: 'div' | 'li';
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Renders a markdown document sidebar row with file icon, optional color dot or git
|
|
72
|
+
* status marker, and shared row chrome. Used in both Collections and Git sidebars.
|
|
73
|
+
*
|
|
74
|
+
* The accessible name defaults to visible row content (name, markers) but can be
|
|
75
|
+
* overridden with `ariaLabel` (e.g. to include git status context).
|
|
76
|
+
*/
|
|
77
|
+
export declare function SidebarDocumentItem({ icon, name, nameClassName, colorDot, statusMarker, selected, ariaLabel, ariaSelected, ariaCurrent, onContextMenu, onClick, onDoubleClick, actions, as }: Props): JSX.Element;
|
|
78
|
+
export {};
|
|
79
|
+
//# sourceMappingURL=SidebarDocumentItem.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SidebarDocumentItem.d.ts","sourceRoot":"","sources":["../../../src/components/SidebarItem/SidebarDocumentItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AAExE,OAAO,KAAK,EAAE,GAAG,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAOxD,UAAU,KAAK;IACb;;OAEG;IACH,IAAI,CAAC,EAAE,cAAc,CAAC;IAEtB;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB;;OAEG;IACH,QAAQ,CAAC,EAAE;QACT,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;QACjC,OAAO,CAAC,EAAE,OAAO,CAAC;QAClB,KAAK,CAAC,EAAE,MAAM,CAAC;KAChB,CAAC;IAEF;;OAEG;IACH,YAAY,CAAC,EAAE;QACb,MAAM,EAAE,MAAM,CAAC;QACf,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,KAAK,EAAE,MAAM,CAAC;KACf,CAAC;IAEF;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IAEvB;;OAEG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IAEtB;;OAEG;IACH,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,CAAC,WAAW,CAAC,KAAK,IAAI,CAAC;IAEzD;;OAEG;IACH,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,CAAC,WAAW,CAAC,KAAK,IAAI,CAAC;IAEnD;;OAEG;IACH,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,CAAC,WAAW,CAAC,KAAK,IAAI,CAAC;IAEzD;;OAEG;IACH,OAAO,CAAC,EAAE,SAAS,CAAC;IAEpB;;OAEG;IACH,EAAE,CAAC,EAAE,KAAK,GAAG,IAAI,CAAC;CACnB;AAED;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,EAClC,IAAkB,EAClB,IAAI,EACJ,aAAa,EACb,QAAQ,EACR,YAAY,EACZ,QAAgB,EAChB,SAAS,EACT,YAAY,EACZ,WAAW,EACX,aAAa,EACb,OAAO,EACP,aAAa,EACb,OAAO,EACP,EAAS,EACV,EAAE,KAAK,GAAG,GAAG,CAAC,OAAO,CA6CrB"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "@harborclient/sdk/jsx-runtime";
|
|
2
|
+
import { faFileLines } from '@fortawesome/free-solid-svg-icons';
|
|
3
|
+
import { FaIcon } from '../FaIcon/index.js';
|
|
4
|
+
import { SidebarColorDot } from './SidebarColorDot.js';
|
|
5
|
+
import { SidebarItem } from './SidebarItem.js';
|
|
6
|
+
import { SidebarStatusMarker } from './SidebarStatusMarker.js';
|
|
7
|
+
import { SIDEBAR_ITEM_BUTTON_CLASS } from './sidebarItemClasses.js';
|
|
8
|
+
/**
|
|
9
|
+
* Renders a markdown document sidebar row with file icon, optional color dot or git
|
|
10
|
+
* status marker, and shared row chrome. Used in both Collections and Git sidebars.
|
|
11
|
+
*
|
|
12
|
+
* The accessible name defaults to visible row content (name, markers) but can be
|
|
13
|
+
* overridden with `ariaLabel` (e.g. to include git status context).
|
|
14
|
+
*/
|
|
15
|
+
export function SidebarDocumentItem({ icon = faFileLines, name, nameClassName, colorDot, statusMarker, selected = false, ariaLabel, ariaSelected, ariaCurrent, onContextMenu, onClick, onDoubleClick, actions, as = 'li' }) {
|
|
16
|
+
const useListboxOption = as === 'li';
|
|
17
|
+
return (_jsx(SidebarItem, { selected: selected, onContextMenu: onContextMenu, actions: actions, as: as, listboxOption: useListboxOption
|
|
18
|
+
? {
|
|
19
|
+
ariaLabel,
|
|
20
|
+
ariaSelected,
|
|
21
|
+
ariaCurrent,
|
|
22
|
+
onClick,
|
|
23
|
+
onDoubleClick
|
|
24
|
+
}
|
|
25
|
+
: undefined, children: _jsxs("span", { className: SIDEBAR_ITEM_BUTTON_CLASS, children: [_jsx(FaIcon, { icon: icon, className: "h-3.5 w-3.5 shrink-0 text-muted", "aria-hidden": true }), colorDot != null ? (_jsxs("span", { className: "inline-flex min-w-0 items-center gap-1.5", children: [_jsx("span", { className: `min-w-0 truncate ${nameClassName ?? ''}`, children: name }), _jsx(SidebarColorDot, { color: colorDot.color, visible: colorDot.visible, label: colorDot.label })] })) : (_jsx("span", { className: `min-w-0 truncate ${nameClassName ?? ''}`, children: name })), statusMarker != null ? (_jsx(SidebarStatusMarker, { marker: statusMarker.marker, className: statusMarker.className, label: statusMarker.label })) : null] }) }));
|
|
26
|
+
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { IconDefinition } from '@fortawesome/fontawesome-svg-core';
|
|
2
1
|
import type { JSX, MouseEvent, ReactNode } from 'react';
|
|
3
2
|
import { type SidebarItemSortableConfig } from './SidebarItem.js';
|
|
4
3
|
interface Props {
|
|
@@ -79,80 +78,5 @@ interface Props {
|
|
|
79
78
|
* Wrap lists in {@link SidebarListbox} and pass `as="li"` for valid listbox semantics.
|
|
80
79
|
*/
|
|
81
80
|
export declare function SidebarRequestItem({ method, name, nameClassName, colorDot, statusMarker, selected, sortable, ariaLabel, ariaSelected, ariaCurrent, onContextMenu, onClick, actions, as }: Props): JSX.Element;
|
|
82
|
-
interface DocumentProps {
|
|
83
|
-
/**
|
|
84
|
-
* Icon shown before the document name. Defaults to a file-lines icon when omitted.
|
|
85
|
-
*/
|
|
86
|
-
icon?: IconDefinition;
|
|
87
|
-
/**
|
|
88
|
-
* Primary label text for the row.
|
|
89
|
-
*/
|
|
90
|
-
name: string;
|
|
91
|
-
/**
|
|
92
|
-
* Optional Tailwind classes applied to the name text (e.g. git status colors).
|
|
93
|
-
*/
|
|
94
|
-
nameClassName?: string;
|
|
95
|
-
/**
|
|
96
|
-
* Optional color dot configuration for collection sidebar rows.
|
|
97
|
-
*/
|
|
98
|
-
colorDot?: {
|
|
99
|
-
color: string | null | undefined;
|
|
100
|
-
visible?: boolean;
|
|
101
|
-
label?: string;
|
|
102
|
-
};
|
|
103
|
-
/**
|
|
104
|
-
* Optional git change status marker shown after the name in git sidebar rows.
|
|
105
|
-
*/
|
|
106
|
-
statusMarker?: {
|
|
107
|
-
marker: string;
|
|
108
|
-
className?: string;
|
|
109
|
-
label: string;
|
|
110
|
-
};
|
|
111
|
-
/**
|
|
112
|
-
* Whether this row should use selected/highlighted row styling.
|
|
113
|
-
*/
|
|
114
|
-
selected?: boolean;
|
|
115
|
-
/**
|
|
116
|
-
* Accessible label for the listbox option. When omitted, the name is derived
|
|
117
|
-
* from visible row content (name, markers).
|
|
118
|
-
*/
|
|
119
|
-
ariaLabel?: string;
|
|
120
|
-
/**
|
|
121
|
-
* Overrides the `aria-selected` state. When omitted, falls back to `selected`.
|
|
122
|
-
*/
|
|
123
|
-
ariaSelected?: boolean;
|
|
124
|
-
/**
|
|
125
|
-
* When true, marks the row as the current item with `aria-current="true"`.
|
|
126
|
-
*/
|
|
127
|
-
ariaCurrent?: boolean;
|
|
128
|
-
/**
|
|
129
|
-
* Called when the user right-clicks the row container.
|
|
130
|
-
*/
|
|
131
|
-
onContextMenu?: (event: MouseEvent<HTMLElement>) => void;
|
|
132
|
-
/**
|
|
133
|
-
* Called when the primary label area is activated.
|
|
134
|
-
*/
|
|
135
|
-
onClick?: (event: MouseEvent<HTMLElement>) => void;
|
|
136
|
-
/**
|
|
137
|
-
* Called when the primary label area is double-clicked.
|
|
138
|
-
*/
|
|
139
|
-
onDoubleClick?: (event: MouseEvent<HTMLElement>) => void;
|
|
140
|
-
/**
|
|
141
|
-
* Trailing actions slot, typically a row actions menu.
|
|
142
|
-
*/
|
|
143
|
-
actions?: ReactNode;
|
|
144
|
-
/**
|
|
145
|
-
* HTML element for the row container. Use `li` inside {@link SidebarListbox}.
|
|
146
|
-
*/
|
|
147
|
-
as?: 'div' | 'li';
|
|
148
|
-
}
|
|
149
|
-
/**
|
|
150
|
-
* Renders a markdown document sidebar row with file icon, optional color dot or git
|
|
151
|
-
* status marker, and shared row chrome. Used in both Collections and Git sidebars.
|
|
152
|
-
*
|
|
153
|
-
* The accessible name defaults to visible row content (name, markers) but can be
|
|
154
|
-
* overridden with `ariaLabel` (e.g. to include git status context).
|
|
155
|
-
*/
|
|
156
|
-
export declare function SidebarDocumentItem({ icon, name, nameClassName, colorDot, statusMarker, selected, ariaLabel, ariaSelected, ariaCurrent, onContextMenu, onClick, onDoubleClick, actions, as }: DocumentProps): JSX.Element;
|
|
157
81
|
export {};
|
|
158
82
|
//# sourceMappingURL=SidebarRequestItem.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SidebarRequestItem.d.ts","sourceRoot":"","sources":["../../../src/components/SidebarItem/SidebarRequestItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"SidebarRequestItem.d.ts","sourceRoot":"","sources":["../../../src/components/SidebarItem/SidebarRequestItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAExD,OAAO,EAAe,KAAK,yBAAyB,EAAE,MAAM,kBAAkB,CAAC;AAK/E,UAAU,KAAK;IACb;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB;;OAEG;IACH,QAAQ,CAAC,EAAE;QACT,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;QACjC,OAAO,CAAC,EAAE,OAAO,CAAC;QAClB,KAAK,CAAC,EAAE,MAAM,CAAC;KAChB,CAAC;IAEF;;OAEG;IACH,YAAY,CAAC,EAAE;QACb,MAAM,EAAE,MAAM,CAAC;QACf,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,KAAK,EAAE,MAAM,CAAC;KACf,CAAC;IAEF;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;OAEG;IACH,QAAQ,CAAC,EAAE,yBAAyB,CAAC;IAErC;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;OAGG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IAEvB;;OAEG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IAEtB;;OAEG;IACH,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,CAAC,WAAW,CAAC,KAAK,IAAI,CAAC;IAEzD;;OAEG;IACH,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,CAAC,WAAW,CAAC,KAAK,IAAI,CAAC;IAEnD;;OAEG;IACH,OAAO,CAAC,EAAE,SAAS,CAAC;IAEpB;;OAEG;IACH,EAAE,CAAC,EAAE,KAAK,GAAG,IAAI,CAAC;CACnB;AAED;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAAC,EACjC,MAAM,EACN,IAAI,EACJ,aAAa,EACb,QAAQ,EACR,YAAY,EACZ,QAAgB,EAChB,QAAQ,EACR,SAAS,EACT,YAAY,EACZ,WAAW,EACX,aAAa,EACb,OAAO,EACP,OAAO,EACP,EAAS,EACV,EAAE,KAAK,GAAG,GAAG,CAAC,OAAO,CA6CrB"}
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "@harborclient/sdk/jsx-runtime";
|
|
2
|
-
import { faFileLines } from '@fortawesome/free-solid-svg-icons';
|
|
3
|
-
import { FaIcon } from '../FaIcon/index.js';
|
|
4
2
|
import { SidebarColorDot } from './SidebarColorDot.js';
|
|
5
3
|
import { SidebarItem } from './SidebarItem.js';
|
|
6
4
|
import { SidebarMethodBadge } from './SidebarMethodBadge.js';
|
|
@@ -26,22 +24,3 @@ export function SidebarRequestItem({ method, name, nameClassName, colorDot, stat
|
|
|
26
24
|
}
|
|
27
25
|
: undefined, children: _jsxs("span", { className: SIDEBAR_ITEM_BUTTON_CLASS, children: [_jsx(SidebarMethodBadge, { method: method }), colorDot != null ? (_jsxs("span", { className: "inline-flex min-w-0 items-center gap-1.5", children: [_jsx("span", { className: `min-w-0 truncate ${nameClassName ?? ''}`, children: name }), _jsx(SidebarColorDot, { color: colorDot.color, visible: colorDot.visible, label: colorDot.label })] })) : (_jsx("span", { className: `min-w-0 truncate ${nameClassName ?? ''}`, children: name })), statusMarker != null ? (_jsx(SidebarStatusMarker, { marker: statusMarker.marker, className: statusMarker.className, label: statusMarker.label })) : null] }) }));
|
|
28
26
|
}
|
|
29
|
-
/**
|
|
30
|
-
* Renders a markdown document sidebar row with file icon, optional color dot or git
|
|
31
|
-
* status marker, and shared row chrome. Used in both Collections and Git sidebars.
|
|
32
|
-
*
|
|
33
|
-
* The accessible name defaults to visible row content (name, markers) but can be
|
|
34
|
-
* overridden with `ariaLabel` (e.g. to include git status context).
|
|
35
|
-
*/
|
|
36
|
-
export function SidebarDocumentItem({ icon = faFileLines, name, nameClassName, colorDot, statusMarker, selected = false, ariaLabel, ariaSelected, ariaCurrent, onContextMenu, onClick, onDoubleClick, actions, as = 'li' }) {
|
|
37
|
-
const useListboxOption = as === 'li';
|
|
38
|
-
return (_jsx(SidebarItem, { selected: selected, onContextMenu: onContextMenu, actions: actions, as: as, listboxOption: useListboxOption
|
|
39
|
-
? {
|
|
40
|
-
ariaLabel,
|
|
41
|
-
ariaSelected,
|
|
42
|
-
ariaCurrent,
|
|
43
|
-
onClick,
|
|
44
|
-
onDoubleClick
|
|
45
|
-
}
|
|
46
|
-
: undefined, children: _jsxs("span", { className: SIDEBAR_ITEM_BUTTON_CLASS, children: [_jsx(FaIcon, { icon: icon, className: "h-3.5 w-3.5 shrink-0 text-muted", "aria-hidden": true }), colorDot != null ? (_jsxs("span", { className: "inline-flex min-w-0 items-center gap-1.5", children: [_jsx("span", { className: `min-w-0 truncate ${nameClassName ?? ''}`, children: name }), _jsx(SidebarColorDot, { color: colorDot.color, visible: colorDot.visible, label: colorDot.label })] })) : (_jsx("span", { className: `min-w-0 truncate ${nameClassName ?? ''}`, children: name })), statusMarker != null ? (_jsx(SidebarStatusMarker, { marker: statusMarker.marker, className: statusMarker.className, label: statusMarker.label })) : null] }) }));
|
|
47
|
-
}
|
|
@@ -30,26 +30,5 @@ interface TreeProps {
|
|
|
30
30
|
* ```
|
|
31
31
|
*/
|
|
32
32
|
export declare function SidebarTree({ children, 'aria-label': ariaLabel, className }: TreeProps): JSX.Element;
|
|
33
|
-
interface TreeGroupProps {
|
|
34
|
-
/**
|
|
35
|
-
* Child tree rows or nested groups.
|
|
36
|
-
*/
|
|
37
|
-
children: ReactNode;
|
|
38
|
-
/**
|
|
39
|
-
* Stable id referenced by the parent treeitem's `aria-controls`.
|
|
40
|
-
*/
|
|
41
|
-
id: string;
|
|
42
|
-
/**
|
|
43
|
-
* Additional classes merged onto the group element.
|
|
44
|
-
*/
|
|
45
|
-
className?: string;
|
|
46
|
-
}
|
|
47
|
-
/**
|
|
48
|
-
* Child region for an expanded folder treeitem.
|
|
49
|
-
*
|
|
50
|
-
* Renders `role="group"` and must use the same `id` passed to the parent
|
|
51
|
-
* folder's `childrenId` / `aria-controls`.
|
|
52
|
-
*/
|
|
53
|
-
export declare function SidebarTreeGroup({ children, id, className }: TreeGroupProps): JSX.Element;
|
|
54
33
|
export {};
|
|
55
34
|
//# sourceMappingURL=SidebarTree.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SidebarTree.d.ts","sourceRoot":"","sources":["../../../src/components/SidebarItem/SidebarTree.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAG5C,UAAU,SAAS;IACjB;;OAEG;IACH,QAAQ,EAAE,SAAS,CAAC;IAEpB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,WAAW,CAAC,EAC1B,QAAQ,EACR,YAAY,EAAE,SAAS,EACvB,SAAS,EACV,EAAE,SAAS,GAAG,GAAG,CAAC,OAAO,CAMzB
|
|
1
|
+
{"version":3,"file":"SidebarTree.d.ts","sourceRoot":"","sources":["../../../src/components/SidebarItem/SidebarTree.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAG5C,UAAU,SAAS;IACjB;;OAEG;IACH,QAAQ,EAAE,SAAS,CAAC;IAEpB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,WAAW,CAAC,EAC1B,QAAQ,EACR,YAAY,EAAE,SAAS,EACvB,SAAS,EACV,EAAE,SAAS,GAAG,GAAG,CAAC,OAAO,CAMzB"}
|
|
@@ -19,12 +19,3 @@ import { cn } from '../utils.js';
|
|
|
19
19
|
export function SidebarTree({ children, 'aria-label': ariaLabel, className }) {
|
|
20
20
|
return (_jsx("ul", { role: "tree", "aria-label": ariaLabel, className: cn('m-0 list-none p-0', className), children: children }));
|
|
21
21
|
}
|
|
22
|
-
/**
|
|
23
|
-
* Child region for an expanded folder treeitem.
|
|
24
|
-
*
|
|
25
|
-
* Renders `role="group"` and must use the same `id` passed to the parent
|
|
26
|
-
* folder's `childrenId` / `aria-controls`.
|
|
27
|
-
*/
|
|
28
|
-
export function SidebarTreeGroup({ children, id, className }) {
|
|
29
|
-
return (_jsx("ul", { role: "group", id: id, className: cn('m-0 list-none p-0', className), children: children }));
|
|
30
|
-
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { JSX, ReactNode } from 'react';
|
|
2
|
+
interface Props {
|
|
3
|
+
/**
|
|
4
|
+
* Child tree rows or nested groups.
|
|
5
|
+
*/
|
|
6
|
+
children: ReactNode;
|
|
7
|
+
/**
|
|
8
|
+
* Stable id referenced by the parent treeitem's `aria-controls`.
|
|
9
|
+
*/
|
|
10
|
+
id: string;
|
|
11
|
+
/**
|
|
12
|
+
* Additional classes merged onto the group element.
|
|
13
|
+
*/
|
|
14
|
+
className?: string;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Child region for an expanded folder treeitem.
|
|
18
|
+
*
|
|
19
|
+
* Renders `role="group"` and must use the same `id` passed to the parent
|
|
20
|
+
* folder's `childrenId` / `aria-controls`.
|
|
21
|
+
*/
|
|
22
|
+
export declare function SidebarTreeGroup({ children, id, className }: Props): JSX.Element;
|
|
23
|
+
export {};
|
|
24
|
+
//# sourceMappingURL=SidebarTreeGroup.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SidebarTreeGroup.d.ts","sourceRoot":"","sources":["../../../src/components/SidebarItem/SidebarTreeGroup.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAG5C,UAAU,KAAK;IACb;;OAEG;IACH,QAAQ,EAAE,SAAS,CAAC;IAEpB;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE,SAAS,EAAE,EAAE,KAAK,GAAG,GAAG,CAAC,OAAO,CAMhF"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { jsx as _jsx } from "@harborclient/sdk/jsx-runtime";
|
|
2
|
+
import { cn } from '../utils.js';
|
|
3
|
+
/**
|
|
4
|
+
* Child region for an expanded folder treeitem.
|
|
5
|
+
*
|
|
6
|
+
* Renders `role="group"` and must use the same `id` passed to the parent
|
|
7
|
+
* folder's `childrenId` / `aria-controls`.
|
|
8
|
+
*/
|
|
9
|
+
export function SidebarTreeGroup({ children, id, className }) {
|
|
10
|
+
return (_jsx("ul", { role: "group", id: id, className: cn('m-0 list-none p-0', className), children: children }));
|
|
11
|
+
}
|
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
export { SidebarItem, type SidebarItemListboxOption, type SidebarItemSortableConfig, type SidebarItemTreeItem } from './SidebarItem.js';
|
|
2
2
|
export { SidebarListbox } from './SidebarListbox.js';
|
|
3
3
|
export { SidebarList } from './SidebarList.js';
|
|
4
|
-
export { SidebarTree
|
|
4
|
+
export { SidebarTree } from './SidebarTree.js';
|
|
5
|
+
export { SidebarTreeGroup } from './SidebarTreeGroup.js';
|
|
5
6
|
export { handleSidebarOptionKeyDown } from './sidebarListOption.js';
|
|
6
7
|
export { SortableSidebarItem } from './SortableSidebarItem.js';
|
|
7
8
|
export { stopSortableDragPointerDown } from './stopSortableDragPointerDown.js';
|
|
8
9
|
export { SidebarColorDot } from './SidebarColorDot.js';
|
|
9
10
|
export { SidebarBadge, type SidebarBadgeVariant } from './SidebarBadge.js';
|
|
10
|
-
export { sourceRow, METHOD_CLASSES, statusDotClass, SIDEBAR_ITEM_BUTTON_CLASS } from './sidebarItemClasses.js';
|
|
11
|
+
export { sourceRow, METHOD_CLASSES, statusDotVariant, statusDotClass, SIDEBAR_ITEM_BUTTON_CLASS } from './sidebarItemClasses.js';
|
|
11
12
|
export { SidebarMethodBadge } from './SidebarMethodBadge.js';
|
|
12
13
|
export { SidebarStatusDot } from './SidebarStatusDot.js';
|
|
13
14
|
export { SidebarStatusMarker } from './SidebarStatusMarker.js';
|
|
14
|
-
export { SidebarRequestItem
|
|
15
|
+
export { SidebarRequestItem } from './SidebarRequestItem.js';
|
|
16
|
+
export { SidebarDocumentItem } from './SidebarDocumentItem.js';
|
|
15
17
|
export { SidebarFolderItem } from './SidebarFolderItem.js';
|
|
16
18
|
export { SidebarRunItem } from './SidebarRunItem.js';
|
|
17
19
|
export { SidebarHistoryItem } from './SidebarHistoryItem.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,gBAAgB,EAAE,MAAM,
|
|
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,EAC1B,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC"}
|
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
export { SidebarItem } from './SidebarItem.js';
|
|
2
2
|
export { SidebarListbox } from './SidebarListbox.js';
|
|
3
3
|
export { SidebarList } from './SidebarList.js';
|
|
4
|
-
export { SidebarTree
|
|
4
|
+
export { SidebarTree } from './SidebarTree.js';
|
|
5
|
+
export { SidebarTreeGroup } from './SidebarTreeGroup.js';
|
|
5
6
|
export { handleSidebarOptionKeyDown } from './sidebarListOption.js';
|
|
6
7
|
export { SortableSidebarItem } from './SortableSidebarItem.js';
|
|
7
8
|
export { stopSortableDragPointerDown } from './stopSortableDragPointerDown.js';
|
|
8
9
|
export { SidebarColorDot } from './SidebarColorDot.js';
|
|
9
10
|
export { SidebarBadge } from './SidebarBadge.js';
|
|
10
|
-
export { sourceRow, METHOD_CLASSES, statusDotClass, SIDEBAR_ITEM_BUTTON_CLASS } from './sidebarItemClasses.js';
|
|
11
|
+
export { sourceRow, METHOD_CLASSES, statusDotVariant, statusDotClass, SIDEBAR_ITEM_BUTTON_CLASS } from './sidebarItemClasses.js';
|
|
11
12
|
export { SidebarMethodBadge } from './SidebarMethodBadge.js';
|
|
12
13
|
export { SidebarStatusDot } from './SidebarStatusDot.js';
|
|
13
14
|
export { SidebarStatusMarker } from './SidebarStatusMarker.js';
|
|
14
|
-
export { SidebarRequestItem
|
|
15
|
+
export { SidebarRequestItem } from './SidebarRequestItem.js';
|
|
16
|
+
export { SidebarDocumentItem } from './SidebarDocumentItem.js';
|
|
15
17
|
export { SidebarFolderItem } from './SidebarFolderItem.js';
|
|
16
18
|
export { SidebarRunItem } from './SidebarRunItem.js';
|
|
17
19
|
export { SidebarHistoryItem } from './SidebarHistoryItem.js';
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { StatusDotVariant } from '../StatusDot/index.js';
|
|
1
2
|
/**
|
|
2
3
|
* Tailwind classes for sidebar source rows and HTTP method badges.
|
|
3
4
|
*/
|
|
@@ -13,6 +14,13 @@ export declare function sourceRow(selected: boolean, compact?: boolean): string;
|
|
|
13
14
|
* HTTP method color classes keyed by lowercase method name.
|
|
14
15
|
*/
|
|
15
16
|
export declare const METHOD_CLASSES: Record<string, string>;
|
|
17
|
+
/**
|
|
18
|
+
* Status dot variant for an HTTP response code.
|
|
19
|
+
*
|
|
20
|
+
* @param status - HTTP status code, or 0 for network errors.
|
|
21
|
+
* @returns Color preset for {@link StatusDot}.
|
|
22
|
+
*/
|
|
23
|
+
export declare function statusDotVariant(status: number): StatusDotVariant;
|
|
16
24
|
/**
|
|
17
25
|
* Status dot color class for an HTTP response code.
|
|
18
26
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sidebarItemClasses.d.ts","sourceRoot":"","sources":["../../../src/components/SidebarItem/sidebarItemClasses.ts"],"names":[],"mappings":"AAAA;;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,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,
|
|
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"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { statusDotVariantClass } from '../StatusDot/index.js';
|
|
1
2
|
/**
|
|
2
3
|
* Tailwind classes for sidebar source rows and HTTP method badges.
|
|
3
4
|
*/
|
|
@@ -27,21 +28,30 @@ export const METHOD_CLASSES = {
|
|
|
27
28
|
options: 'text-method-options'
|
|
28
29
|
};
|
|
29
30
|
/**
|
|
30
|
-
* Status dot
|
|
31
|
+
* Status dot variant for an HTTP response code.
|
|
31
32
|
*
|
|
32
33
|
* @param status - HTTP status code, or 0 for network errors.
|
|
33
|
-
* @returns
|
|
34
|
+
* @returns Color preset for {@link StatusDot}.
|
|
34
35
|
*/
|
|
35
|
-
export function
|
|
36
|
+
export function statusDotVariant(status) {
|
|
36
37
|
if (status === 0)
|
|
37
|
-
return '
|
|
38
|
+
return 'danger';
|
|
38
39
|
if (status >= 200 && status < 300)
|
|
39
|
-
return '
|
|
40
|
+
return 'success';
|
|
40
41
|
if (status >= 300 && status < 400)
|
|
41
|
-
return '
|
|
42
|
+
return 'warning';
|
|
42
43
|
if (status >= 400)
|
|
43
|
-
return '
|
|
44
|
-
return '
|
|
44
|
+
return 'danger';
|
|
45
|
+
return 'info';
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Status dot color class for an HTTP response code.
|
|
49
|
+
*
|
|
50
|
+
* @param status - HTTP status code, or 0 for network errors.
|
|
51
|
+
* @returns Tailwind background color class for the status dot.
|
|
52
|
+
*/
|
|
53
|
+
export function statusDotClass(status) {
|
|
54
|
+
return statusDotVariantClass(statusDotVariant(status));
|
|
45
55
|
}
|
|
46
56
|
/**
|
|
47
57
|
* Standard primary button classes for sidebar item label areas.
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { type JSX, type ReactNode } from 'react';
|
|
2
|
+
interface SectionContentProps {
|
|
3
|
+
/**
|
|
4
|
+
* Section title shown in the header.
|
|
5
|
+
*/
|
|
6
|
+
title: string;
|
|
7
|
+
/**
|
|
8
|
+
* Section body content.
|
|
9
|
+
*/
|
|
10
|
+
children: ReactNode;
|
|
11
|
+
/**
|
|
12
|
+
* Called when the add button is clicked.
|
|
13
|
+
*/
|
|
14
|
+
onAdd?: () => void;
|
|
15
|
+
/**
|
|
16
|
+
* Accessible label for the add button.
|
|
17
|
+
*/
|
|
18
|
+
addLabel?: string;
|
|
19
|
+
/**
|
|
20
|
+
* Optional action controls rendered in the header row (for example plugin header actions).
|
|
21
|
+
*/
|
|
22
|
+
headerActions?: ReactNode;
|
|
23
|
+
/**
|
|
24
|
+
* When true, removes the margin below the header so body content sits flush against it.
|
|
25
|
+
*/
|
|
26
|
+
flushBody?: boolean;
|
|
27
|
+
}
|
|
28
|
+
export interface Props extends SectionContentProps {
|
|
29
|
+
/**
|
|
30
|
+
* Stable accordion item key shared with the sidebar sections provider.
|
|
31
|
+
*/
|
|
32
|
+
itemKey: string;
|
|
33
|
+
/**
|
|
34
|
+
* Whether the section body starts expanded on first mount.
|
|
35
|
+
*/
|
|
36
|
+
initialEntered: boolean;
|
|
37
|
+
}
|
|
38
|
+
export declare const AccordionSection: (props: Props) => JSX.Element;
|
|
39
|
+
export {};
|
|
40
|
+
//# sourceMappingURL=SectionItem.d.ts.map
|
|
@@ -0,0 +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;AAG3F,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;AA8ED,eAAO,MAAM,gBAAgB,EAIb,CAAC,KAAK,EAAE,KAAK,KAAK,GAAG,CAAC,OAAO,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "@harborclient/sdk/jsx-runtime";
|
|
2
|
+
import { faChevronDown, faChevronRight, faPlus } from '@fortawesome/free-solid-svg-icons';
|
|
3
|
+
import { useAccordionItem, useHeightTransition, useMergeRef, withAccordionItem } from '@szhsin/react-accordion';
|
|
4
|
+
import { memo } from 'react';
|
|
5
|
+
import { FaIcon } from '../FaIcon/index.js';
|
|
6
|
+
/**
|
|
7
|
+
* Renders the sidebar section header row and animated body panel.
|
|
8
|
+
*/
|
|
9
|
+
const SectionItem = memo(function SectionItem({ forwardedRef, itemRef, state, toggle, title, children, onAdd, addLabel, headerActions, flushBody = false }) {
|
|
10
|
+
const { buttonProps, panelProps } = useAccordionItem({ state, toggle });
|
|
11
|
+
const [transitionStyle, panelRef] = useHeightTransition(state);
|
|
12
|
+
const itemElementRef = useMergeRef(forwardedRef, itemRef);
|
|
13
|
+
const { status, isMounted, isEnter } = state;
|
|
14
|
+
return (_jsxs("div", { ref: itemElementRef, className: "-mr-2 mb-1", children: [_jsxs("div", { className: `hc-sidebar-section-header bg-sidebar-section flex min-h-8 items-center justify-between gap-2 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-1.5 border-none bg-transparent p-0 text-left", children: [_jsx("span", { className: "ms-2 inline-flex h-4 w-4 shrink-0 items-center justify-center", children: _jsx(FaIcon, { icon: isEnter ? faChevronDown : faChevronRight, className: "h-2 w-2 text-muted" }) }), _jsx("h2", { className: "m-0 text-[15px] leading-none font-medium tracking-wide text-muted 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
|
+
display: status === 'exited' ? 'none' : undefined,
|
|
16
|
+
...transitionStyle
|
|
17
|
+
}, className: "transition-[height] duration-200 ease-out motion-reduce:transition-none", children: _jsx("div", { ...panelProps, ref: panelRef, children: children }) })) : null] }));
|
|
18
|
+
});
|
|
19
|
+
export const AccordionSection = withAccordionItem(SectionItem);
|
|
@@ -1,43 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Section title shown in the header.
|
|
5
|
-
*/
|
|
6
|
-
title: string;
|
|
7
|
-
/**
|
|
8
|
-
* Section body content.
|
|
9
|
-
*/
|
|
10
|
-
children: ReactNode;
|
|
11
|
-
/**
|
|
12
|
-
* Called when the add button is clicked.
|
|
13
|
-
*/
|
|
14
|
-
onAdd?: () => void;
|
|
15
|
-
/**
|
|
16
|
-
* Accessible label for the add button.
|
|
17
|
-
*/
|
|
18
|
-
addLabel?: string;
|
|
19
|
-
/**
|
|
20
|
-
* Optional action controls rendered in the header row (for example plugin header actions).
|
|
21
|
-
*/
|
|
22
|
-
headerActions?: ReactNode;
|
|
23
|
-
/**
|
|
24
|
-
* When true, removes the margin below the header so body content sits flush against it.
|
|
25
|
-
*/
|
|
26
|
-
flushBody?: boolean;
|
|
27
|
-
}
|
|
28
|
-
interface Props extends SectionContentProps {
|
|
29
|
-
/**
|
|
30
|
-
* Stable accordion item key shared with the sidebar sections provider.
|
|
31
|
-
*/
|
|
32
|
-
itemKey: string;
|
|
33
|
-
/**
|
|
34
|
-
* Whether the section body starts expanded on first mount.
|
|
35
|
-
*/
|
|
36
|
-
initialEntered: boolean;
|
|
37
|
-
}
|
|
1
|
+
import type { JSX } from 'react';
|
|
2
|
+
import { type Props } from './SectionItem.js';
|
|
38
3
|
/**
|
|
39
4
|
* Collapsible sidebar section backed by `@szhsin/react-accordion` with optional add action.
|
|
40
5
|
*/
|
|
41
6
|
export declare function SidebarSection({ itemKey, title, initialEntered, children, onAdd, addLabel, headerActions, flushBody }: Props): JSX.Element;
|
|
42
|
-
export {};
|
|
43
7
|
//# sourceMappingURL=SidebarSection.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SidebarSection.d.ts","sourceRoot":"","sources":["../../../src/components/SidebarSection/SidebarSection.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SidebarSection.d.ts","sourceRoot":"","sources":["../../../src/components/SidebarSection/SidebarSection.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,EAAoB,KAAK,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAEhE;;GAEG;AACH,wBAAgB,cAAc,CAAC,EAC7B,OAAO,EACP,KAAK,EACL,cAAc,EACd,QAAQ,EACR,KAAK,EACL,QAAQ,EACR,aAAa,EACb,SAAS,EACV,EAAE,KAAK,GAAG,GAAG,CAAC,OAAO,CAcrB"}
|
|
@@ -1,22 +1,5 @@
|
|
|
1
|
-
import { jsx as _jsx
|
|
2
|
-
import {
|
|
3
|
-
import { useAccordionItem, useHeightTransition, useMergeRef, withAccordionItem } from '@szhsin/react-accordion';
|
|
4
|
-
import { memo } from 'react';
|
|
5
|
-
import { FaIcon } from '../FaIcon/index.js';
|
|
6
|
-
/**
|
|
7
|
-
* Renders the sidebar section header row and animated body panel.
|
|
8
|
-
*/
|
|
9
|
-
const SectionItem = memo(function SectionItem({ forwardedRef, itemRef, state, toggle, title, children, onAdd, addLabel, headerActions, flushBody = false }) {
|
|
10
|
-
const { buttonProps, panelProps } = useAccordionItem({ state, toggle });
|
|
11
|
-
const [transitionStyle, panelRef] = useHeightTransition(state);
|
|
12
|
-
const itemElementRef = useMergeRef(forwardedRef, itemRef);
|
|
13
|
-
const { status, isMounted, isEnter } = state;
|
|
14
|
-
return (_jsxs("div", { ref: itemElementRef, className: "-mr-2 mb-1", children: [_jsxs("div", { className: `hc-sidebar-section-header bg-sidebar-section flex min-h-8 items-center justify-between gap-2 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-1.5 border-none bg-transparent p-0 text-left", children: [_jsx("span", { className: "ms-2 inline-flex h-4 w-4 shrink-0 items-center justify-center", children: _jsx(FaIcon, { icon: isEnter ? faChevronDown : faChevronRight, className: "h-2 w-2 text-muted" }) }), _jsx("h2", { className: "m-0 text-[15px] leading-none font-medium tracking-wide text-muted 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
|
-
display: status === 'exited' ? 'none' : undefined,
|
|
16
|
-
...transitionStyle
|
|
17
|
-
}, className: "transition-[height] duration-200 ease-out motion-reduce:transition-none", children: _jsx("div", { ...panelProps, ref: panelRef, children: children }) })) : null] }));
|
|
18
|
-
});
|
|
19
|
-
const AccordionSection = withAccordionItem(SectionItem);
|
|
1
|
+
import { jsx as _jsx } from "@harborclient/sdk/jsx-runtime";
|
|
2
|
+
import { AccordionSection } from './SectionItem.js';
|
|
20
3
|
/**
|
|
21
4
|
* Collapsible sidebar section backed by `@szhsin/react-accordion` with optional add action.
|
|
22
5
|
*/
|