@harborclient/sdk 1.1.12 → 1.1.14

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.
Files changed (66) hide show
  1. package/dist/components/Badge/index.d.ts +1 -1
  2. package/dist/components/Badge/index.d.ts.map +1 -1
  3. package/dist/components/Badge/index.js +2 -0
  4. package/dist/components/CatalogCard/index.d.ts +51 -0
  5. package/dist/components/CatalogCard/index.d.ts.map +1 -0
  6. package/dist/components/CatalogCard/index.js +23 -0
  7. package/dist/components/CatalogReadmeMarkdown/index.d.ts +13 -0
  8. package/dist/components/CatalogReadmeMarkdown/index.d.ts.map +1 -0
  9. package/dist/components/CatalogReadmeMarkdown/index.js +53 -0
  10. package/dist/components/FormGroup/index.d.ts +6 -1
  11. package/dist/components/FormGroup/index.d.ts.map +1 -1
  12. package/dist/components/FormGroup/index.js +21 -10
  13. package/dist/components/FormSection/index.d.ts +37 -0
  14. package/dist/components/FormSection/index.d.ts.map +1 -0
  15. package/dist/components/FormSection/index.js +9 -0
  16. package/dist/components/ProgressBar/index.d.ts +20 -0
  17. package/dist/components/ProgressBar/index.d.ts.map +1 -0
  18. package/dist/components/ProgressBar/index.js +10 -0
  19. package/dist/components/ProgressBar/progressBar.logic.d.ts +9 -0
  20. package/dist/components/ProgressBar/progressBar.logic.d.ts.map +1 -0
  21. package/dist/components/ProgressBar/progressBar.logic.js +13 -0
  22. package/dist/components/PromptModal/index.d.ts +82 -0
  23. package/dist/components/PromptModal/index.d.ts.map +1 -0
  24. package/dist/components/PromptModal/index.js +22 -0
  25. package/dist/components/PromptModal/promptModal.logic.d.ts +8 -0
  26. package/dist/components/PromptModal/promptModal.logic.d.ts.map +1 -0
  27. package/dist/components/PromptModal/promptModal.logic.js +9 -0
  28. package/dist/components/ScreenshotCarousel/ScreenshotLightbox.d.ts +29 -0
  29. package/dist/components/ScreenshotCarousel/ScreenshotLightbox.d.ts.map +1 -0
  30. package/dist/components/ScreenshotCarousel/ScreenshotLightbox.js +66 -0
  31. package/dist/components/ScreenshotCarousel/index.d.ts +35 -0
  32. package/dist/components/ScreenshotCarousel/index.d.ts.map +1 -0
  33. package/dist/components/ScreenshotCarousel/index.js +89 -0
  34. package/dist/components/ScreenshotCarousel/variants.d.ts +17 -0
  35. package/dist/components/ScreenshotCarousel/variants.d.ts.map +1 -0
  36. package/dist/components/ScreenshotCarousel/variants.js +22 -0
  37. package/dist/components/SelectionActionToolbar/index.d.ts +41 -0
  38. package/dist/components/SelectionActionToolbar/index.d.ts.map +1 -0
  39. package/dist/components/SelectionActionToolbar/index.js +13 -0
  40. package/dist/components/SettingIdLabel/index.d.ts +16 -0
  41. package/dist/components/SettingIdLabel/index.d.ts.map +1 -0
  42. package/dist/components/SettingIdLabel/index.js +7 -0
  43. package/dist/components/SettingSectionHeading/index.d.ts +33 -0
  44. package/dist/components/SettingSectionHeading/index.d.ts.map +1 -0
  45. package/dist/components/SettingSectionHeading/index.js +10 -0
  46. package/dist/components/SidebarItem/SidebarBadge.d.ts +49 -0
  47. package/dist/components/SidebarItem/SidebarBadge.d.ts.map +1 -0
  48. package/dist/components/SidebarItem/SidebarBadge.js +52 -0
  49. package/dist/components/SidebarItem/SidebarRunItem.d.ts.map +1 -1
  50. package/dist/components/SidebarItem/SidebarRunItem.js +2 -1
  51. package/dist/components/SidebarItem/index.d.ts +2 -1
  52. package/dist/components/SidebarItem/index.d.ts.map +1 -1
  53. package/dist/components/SidebarItem/index.js +2 -1
  54. package/dist/components/SidebarItem/sidebarItemClasses.d.ts +8 -0
  55. package/dist/components/SidebarItem/sidebarItemClasses.d.ts.map +1 -1
  56. package/dist/components/SidebarItem/sidebarItemClasses.js +18 -8
  57. package/dist/components/StatusDot/index.d.ts +42 -0
  58. package/dist/components/StatusDot/index.d.ts.map +1 -0
  59. package/dist/components/StatusDot/index.js +42 -0
  60. package/dist/components/ThemeVariantPickerModal/index.d.ts +71 -0
  61. package/dist/components/ThemeVariantPickerModal/index.d.ts.map +1 -0
  62. package/dist/components/ThemeVariantPickerModal/index.js +37 -0
  63. package/dist/components/index.d.ts +24 -1
  64. package/dist/components/index.d.ts.map +1 -1
  65. package/dist/components/index.js +15 -1
  66. package/package.json +6 -2
@@ -0,0 +1,35 @@
1
+ import type { JSX } from 'react';
2
+ import { type ScreenshotCarouselVariant } from './variants.js';
3
+ interface Props {
4
+ /**
5
+ * Resolved screenshot URLs or data URLs to display.
6
+ */
7
+ images: string[];
8
+ /**
9
+ * Visual context for card grid, detail modal, or page tab spacing.
10
+ */
11
+ variant: ScreenshotCarouselVariant;
12
+ /**
13
+ * Accessible name for the carousel group.
14
+ */
15
+ ariaLabel?: string;
16
+ /**
17
+ * Accessible name for the full-size lightbox dialog.
18
+ */
19
+ lightboxLabel?: string;
20
+ /**
21
+ * Optional wrapper class names.
22
+ */
23
+ className?: string;
24
+ /**
25
+ * Stops pointer and keyboard events from bubbling to a parent activator.
26
+ * Used by marketplace cards that open a modal on click.
27
+ */
28
+ stopPropagation?: boolean;
29
+ }
30
+ /**
31
+ * Accessible left/right screenshot carousel for marketplace previews.
32
+ */
33
+ export declare function ScreenshotCarousel({ images, variant, ariaLabel, lightboxLabel, className, stopPropagation }: Props): JSX.Element | null;
34
+ export {};
35
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/ScreenshotCarousel/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,GAAG,EAA6B,MAAM,OAAO,CAAC;AAI5D,OAAO,EACL,KAAK,yBAAyB,EAG/B,MAAM,eAAe,CAAC;AAEvB,UAAU,KAAK;IACb;;OAEG;IACH,MAAM,EAAE,MAAM,EAAE,CAAC;IAEjB;;OAEG;IACH,OAAO,EAAE,yBAAyB,CAAC;IAEnC;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;OAGG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,EACjC,MAAM,EACN,OAAO,EACP,SAAyB,EACzB,aAAoC,EACpC,SAAS,EACT,eAAuB,EACxB,EAAE,KAAK,GAAG,GAAG,CAAC,OAAO,GAAG,IAAI,CAmK5B"}
@@ -0,0 +1,89 @@
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "@harborclient/sdk/jsx-runtime";
2
+ import { faAngleLeft, faAngleRight } from '@fortawesome/free-solid-svg-icons';
3
+ import { useState } from 'react';
4
+ import { FaIcon } from '../FaIcon/index.js';
5
+ import { ScreenshotLightbox } from './ScreenshotLightbox.js';
6
+ import { screenshotCarouselImageFrameClassName, screenshotCarouselLightboxEnabled } from './variants.js';
7
+ /**
8
+ * Accessible left/right screenshot carousel for marketplace previews.
9
+ */
10
+ export function ScreenshotCarousel({ images, variant, ariaLabel = 'Screenshots', lightboxLabel = 'Screenshot preview', className, stopPropagation = false }) {
11
+ const [index, setIndex] = useState(0);
12
+ const [lightboxOpen, setLightboxOpen] = useState(false);
13
+ const imageCount = images.length;
14
+ const currentIndex = imageCount === 0 ? 0 : Math.min(index, imageCount - 1);
15
+ if (imageCount === 0) {
16
+ return null;
17
+ }
18
+ const hasMultiple = imageCount > 1;
19
+ const currentImage = images[currentIndex];
20
+ const lightboxEnabled = screenshotCarouselLightboxEnabled(variant);
21
+ /**
22
+ * Moves to the previous screenshot, wrapping to the last slide.
23
+ */
24
+ const showPrevious = () => {
25
+ setIndex(currentIndex === 0 ? imageCount - 1 : currentIndex - 1);
26
+ };
27
+ /**
28
+ * Moves to the next screenshot, wrapping to the first slide.
29
+ */
30
+ const showNext = () => {
31
+ setIndex(currentIndex === imageCount - 1 ? 0 : currentIndex + 1);
32
+ };
33
+ /**
34
+ * Handles keyboard navigation within the carousel group.
35
+ *
36
+ * @param event - Keyboard event on the carousel container.
37
+ */
38
+ const handleKeyDown = (event) => {
39
+ if (!hasMultiple) {
40
+ return;
41
+ }
42
+ if (event.key === 'ArrowLeft') {
43
+ event.preventDefault();
44
+ showPrevious();
45
+ return;
46
+ }
47
+ if (event.key === 'ArrowRight') {
48
+ event.preventDefault();
49
+ showNext();
50
+ }
51
+ };
52
+ /**
53
+ * Prevents carousel controls from activating a parent card click handler.
54
+ *
55
+ * @param event - Pointer event from a carousel control.
56
+ */
57
+ const handleControlPointerEvent = (event) => {
58
+ if (stopPropagation) {
59
+ event.stopPropagation();
60
+ }
61
+ };
62
+ /**
63
+ * Prevents carousel keyboard activation from opening a parent card.
64
+ *
65
+ * @param event - Keyboard event from a carousel control.
66
+ */
67
+ const handleControlKeyDown = (event) => {
68
+ if (stopPropagation) {
69
+ event.stopPropagation();
70
+ }
71
+ };
72
+ /**
73
+ * Opens the full-size screenshot lightbox for modal and tab detail views.
74
+ */
75
+ const handleOpenLightbox = () => {
76
+ setLightboxOpen(true);
77
+ };
78
+ const frameClassName = screenshotCarouselImageFrameClassName(variant);
79
+ const previewLabel = hasMultiple
80
+ ? `View screenshot ${currentIndex + 1} of ${imageCount} in full size`
81
+ : 'View screenshot in full size';
82
+ return (_jsxs("div", { className: className ?? 'relative', role: "group", "aria-roledescription": "carousel", "aria-label": ariaLabel, tabIndex: hasMultiple ? 0 : undefined, onKeyDown: handleKeyDown, children: [lightboxEnabled ? (_jsx("button", { type: "button", className: "mb-4 block w-full cursor-zoom-in border-none bg-transparent p-0 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-accent", "aria-label": previewLabel, onClick: handleOpenLightbox, children: _jsx("img", { src: currentImage, alt: "", "aria-hidden": true, className: frameClassName }) })) : (_jsx("img", { src: currentImage, alt: "", "aria-hidden": true, className: frameClassName })), lightboxEnabled && lightboxOpen ? (_jsx(ScreenshotLightbox, { images: images, index: currentIndex, onIndexChange: setIndex, onClose: () => setLightboxOpen(false), label: lightboxLabel })) : null, hasMultiple ? (_jsxs(_Fragment, { children: [_jsx("button", { type: "button", className: "bg-panel/90 absolute top-1/2 left-2 flex h-8 w-8 -translate-y-1/2 items-center justify-center rounded-md border border-separator text-text shadow-sm hover:bg-selection focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-accent motion-reduce:transition-none", "aria-label": "Previous screenshot", onClick: (event) => {
83
+ handleControlPointerEvent(event);
84
+ showPrevious();
85
+ }, onKeyDown: handleControlKeyDown, children: _jsx(FaIcon, { icon: faAngleLeft, className: "h-3.5 w-3.5" }) }), _jsx("button", { type: "button", className: "bg-panel/90 absolute top-1/2 right-2 flex h-8 w-8 -translate-y-1/2 items-center justify-center rounded-md border border-separator text-text shadow-sm hover:bg-selection focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-accent motion-reduce:transition-none", "aria-label": "Next screenshot", onClick: (event) => {
86
+ handleControlPointerEvent(event);
87
+ showNext();
88
+ }, onKeyDown: handleControlKeyDown, children: _jsx(FaIcon, { icon: faAngleRight, className: "h-3.5 w-3.5" }) }), _jsx("p", { className: "sr-only", role: "status", "aria-live": "polite", children: `Screenshot ${currentIndex + 1} of ${imageCount}` }), _jsx("div", { className: "pointer-events-none absolute bottom-2 left-1/2 flex -translate-x-1/2 gap-1.5", "aria-hidden": true, children: images.map((image, dotIndex) => (_jsx("span", { className: `h-2 w-2 rounded-full ${dotIndex === currentIndex ? 'bg-text' : 'bg-text/40'}` }, `${image}-${dotIndex}`))) })] })) : null] }));
89
+ }
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Screenshot carousel layout variant.
3
+ */
4
+ export type ScreenshotCarouselVariant = 'card' | 'modal' | 'tab';
5
+ /**
6
+ * Returns the image frame classes for card, modal, and tab variants.
7
+ *
8
+ * @param variant - Card grid, detail modal, or page tab layout.
9
+ */
10
+ export declare function screenshotCarouselImageFrameClassName(variant: ScreenshotCarouselVariant): string;
11
+ /**
12
+ * Returns whether the carousel should open a full-size lightbox on click.
13
+ *
14
+ * @param variant - Card grid, detail modal, or page tab layout.
15
+ */
16
+ export declare function screenshotCarouselLightboxEnabled(variant: ScreenshotCarouselVariant): boolean;
17
+ //# sourceMappingURL=variants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"variants.d.ts","sourceRoot":"","sources":["../../../src/components/ScreenshotCarousel/variants.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,MAAM,yBAAyB,GAAG,MAAM,GAAG,OAAO,GAAG,KAAK,CAAC;AAEjE;;;;GAIG;AACH,wBAAgB,qCAAqC,CAAC,OAAO,EAAE,yBAAyB,GAAG,MAAM,CAQhG;AAED;;;;GAIG;AACH,wBAAgB,iCAAiC,CAAC,OAAO,EAAE,yBAAyB,GAAG,OAAO,CAE7F"}
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Returns the image frame classes for card, modal, and tab variants.
3
+ *
4
+ * @param variant - Card grid, detail modal, or page tab layout.
5
+ */
6
+ export function screenshotCarouselImageFrameClassName(variant) {
7
+ if (variant === 'card') {
8
+ return 'aspect-video w-full object-cover object-top border-b border-separator';
9
+ }
10
+ if (variant === 'tab') {
11
+ return 'max-h-[min(18rem,35vh)] w-full rounded-md border border-separator object-contain object-top';
12
+ }
13
+ return 'aspect-video w-full object-cover object-top rounded-md border border-separator';
14
+ }
15
+ /**
16
+ * Returns whether the carousel should open a full-size lightbox on click.
17
+ *
18
+ * @param variant - Card grid, detail modal, or page tab layout.
19
+ */
20
+ export function screenshotCarouselLightboxEnabled(variant) {
21
+ return variant === 'modal' || variant === 'tab';
22
+ }
@@ -0,0 +1,41 @@
1
+ import type { IconDefinition } from '@fortawesome/fontawesome-svg-core';
2
+ import type { JSX } from 'react';
3
+ export interface Props {
4
+ /**
5
+ * Fixed viewport coordinates for the floating toolbar button.
6
+ */
7
+ coords: {
8
+ top: number;
9
+ left: number;
10
+ };
11
+ /**
12
+ * Accessible name announced for the action button.
13
+ */
14
+ label: string;
15
+ /**
16
+ * Visible button label, for example "Copy to chat".
17
+ */
18
+ text: string;
19
+ /**
20
+ * Invoked when the user activates the selection action.
21
+ */
22
+ onSelect: () => void;
23
+ /**
24
+ * Optional leading icon rendered before the visible label.
25
+ */
26
+ icon?: IconDefinition;
27
+ /**
28
+ * Optional muted shortcut hint shown after the label.
29
+ */
30
+ shortcutHint?: string;
31
+ /**
32
+ * Additional classes merged onto the toolbar button.
33
+ */
34
+ className?: string;
35
+ }
36
+ /**
37
+ * Floating selection action button portaled to document.body so fixed positioning
38
+ * is not clipped by overflow-hidden editor or terminal containers.
39
+ */
40
+ export declare function SelectionActionToolbar({ coords, label, text, onSelect, icon, shortcutHint, className }: Props): JSX.Element;
41
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/SelectionActionToolbar/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AACxE,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAKjC,MAAM,WAAW,KAAK;IACpB;;OAEG;IACH,MAAM,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;IAEtC;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,QAAQ,EAAE,MAAM,IAAI,CAAC;IAErB;;OAEG;IACH,IAAI,CAAC,EAAE,cAAc,CAAC;IAEtB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,EACrC,MAAM,EACN,KAAK,EACL,IAAI,EACJ,QAAQ,EACR,IAAI,EACJ,YAAY,EACZ,SAAS,EACV,EAAE,KAAK,GAAG,GAAG,CAAC,OAAO,CAoBrB"}
@@ -0,0 +1,13 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "@harborclient/sdk/jsx-runtime";
2
+ import { FaIcon } from '../FaIcon/index.js';
3
+ import { portalToBody } from '../portalToBody.js';
4
+ import { cn } from '../utils.js';
5
+ /**
6
+ * Floating selection action button portaled to document.body so fixed positioning
7
+ * is not clipped by overflow-hidden editor or terminal containers.
8
+ */
9
+ export function SelectionActionToolbar({ coords, label, text, onSelect, icon, shortcutHint, className }) {
10
+ return portalToBody(_jsxs("button", { type: "button", className: cn('hc-code-editor-selection-action app-no-drag pointer-events-auto fixed z-[70] inline-flex cursor-pointer items-center gap-1.5 rounded-md border border-separator bg-control px-2 py-1 text-[14px] text-text shadow-sm hover:bg-surface focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-accent', className), style: { top: coords.top, left: coords.left }, "aria-label": label, onMouseDown: (event) => {
11
+ event.preventDefault();
12
+ }, onClick: onSelect, children: [icon ? _jsx(FaIcon, { icon: icon, className: "h-3.5 w-3.5" }) : null, _jsx("span", { children: text }), shortcutHint ? _jsx("span", { className: "text-[14px] text-muted", children: shortcutHint }) : null] }));
13
+ }
@@ -0,0 +1,16 @@
1
+ import type { JSX, ReactNode } from 'react';
2
+ export interface Props {
3
+ /**
4
+ * Visible setting label text.
5
+ */
6
+ children: ReactNode;
7
+ /**
8
+ * Stable setting id shown on hover and keyboard focus.
9
+ */
10
+ settingId: string;
11
+ }
12
+ /**
13
+ * Setting label with a VS Code-style id affordance revealed on hover and focus.
14
+ */
15
+ export declare function SettingIdLabel({ children, settingId }: Props): JSX.Element;
16
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/SettingIdLabel/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAE5C,MAAM,WAAW,KAAK;IACpB;;OAEG;IACH,QAAQ,EAAE,SAAS,CAAC;IAEpB;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,EAAE,KAAK,GAAG,GAAG,CAAC,OAAO,CAa1E"}
@@ -0,0 +1,7 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "@harborclient/sdk/jsx-runtime";
2
+ /**
3
+ * Setting label with a VS Code-style id affordance revealed on hover and focus.
4
+ */
5
+ export function SettingIdLabel({ children, settingId }) {
6
+ return (_jsxs("span", { className: "group/setting-label inline-flex items-baseline gap-2", children: [_jsx("span", { children: children }), _jsx("span", { className: "pointer-events-none font-mono text-[14px] text-muted opacity-0 transition-opacity select-none group-focus-within/setting-label:opacity-100 group-hover/setting-label:opacity-100", title: settingId, "aria-label": `Setting id: ${settingId}`, children: settingId })] }));
7
+ }
@@ -0,0 +1,33 @@
1
+ import type { JSX, ReactNode } from 'react';
2
+ export interface Props {
3
+ /**
4
+ * Stable setting id shown on hover and keyboard focus beside the title.
5
+ */
6
+ settingId: string;
7
+ /**
8
+ * Visible section title text.
9
+ */
10
+ title: ReactNode;
11
+ /**
12
+ * Optional muted helper copy rendered below the title.
13
+ */
14
+ description?: ReactNode;
15
+ /**
16
+ * Extra classes on the outer wrapper.
17
+ */
18
+ className?: string;
19
+ /**
20
+ * Overrides the default title span classes.
21
+ */
22
+ titleClassName?: string;
23
+ /**
24
+ * Overrides the default description paragraph classes.
25
+ */
26
+ descriptionClassName?: string;
27
+ }
28
+ /**
29
+ * Settings section heading that pairs a titled label with an optional description
30
+ * and a hover-revealed setting id badge.
31
+ */
32
+ export declare function SettingSectionHeading({ settingId, title, description, className, titleClassName, descriptionClassName }: Props): JSX.Element;
33
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/SettingSectionHeading/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAI5C,MAAM,WAAW,KAAK;IACpB;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,KAAK,EAAE,SAAS,CAAC;IAEjB;;OAEG;IACH,WAAW,CAAC,EAAE,SAAS,CAAC;IAExB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB;;OAEG;IACH,oBAAoB,CAAC,EAAE,MAAM,CAAC;CAC/B;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,EACpC,SAAS,EACT,KAAK,EACL,WAAW,EACX,SAAS,EACT,cAAc,EACd,oBAAoB,EACrB,EAAE,KAAK,GAAG,GAAG,CAAC,OAAO,CAWrB"}
@@ -0,0 +1,10 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "@harborclient/sdk/jsx-runtime";
2
+ import { SettingIdLabel } from '../SettingIdLabel/index.js';
3
+ import { cn } from '../utils.js';
4
+ /**
5
+ * Settings section heading that pairs a titled label with an optional description
6
+ * and a hover-revealed setting id badge.
7
+ */
8
+ export function SettingSectionHeading({ settingId, title, description, className, titleClassName, descriptionClassName }) {
9
+ return (_jsxs("div", { className: className, children: [_jsx("span", { className: cn('text-[18px] font-medium text-text', titleClassName), children: _jsx(SettingIdLabel, { settingId: settingId, children: title }) }), description != null && description !== '' ? (_jsx("p", { className: cn('m-0 mb-4 text-muted', descriptionClassName), children: description })) : null] }));
10
+ }
@@ -0,0 +1,49 @@
1
+ import type { ComponentPropsWithoutRef, JSX, ReactNode } from 'react';
2
+ /**
3
+ * Visual tone for compact sidebar badges.
4
+ */
5
+ export type SidebarBadgeVariant = 'info' | 'recessed';
6
+ type BaseProps = {
7
+ /**
8
+ * Badge label content.
9
+ */
10
+ children: ReactNode;
11
+ /**
12
+ * Color and background preset.
13
+ */
14
+ variant?: SidebarBadgeVariant;
15
+ /**
16
+ * Additional Tailwind classes merged onto the badge.
17
+ */
18
+ className?: string;
19
+ /**
20
+ * Tooltip text for the badge.
21
+ */
22
+ title?: string;
23
+ };
24
+ type SpanProps = BaseProps & Omit<ComponentPropsWithoutRef<'span'>, 'children' | 'className' | 'title'> & {
25
+ /**
26
+ * Renders a non-interactive badge. Default for storage location labels.
27
+ */
28
+ as?: 'span';
29
+ };
30
+ type ButtonProps = BaseProps & Omit<ComponentPropsWithoutRef<'button'>, 'children' | 'className' | 'type' | 'title'> & {
31
+ /**
32
+ * Renders an interactive badge for branch switches and count actions.
33
+ */
34
+ as: 'button';
35
+ /**
36
+ * Button type attribute. Defaults to `button` so badges do not submit forms.
37
+ */
38
+ type?: 'button';
39
+ };
40
+ type Props = SpanProps | ButtonProps;
41
+ /**
42
+ * Compact sidebar badge for storage locations, git branches, and count indicators.
43
+ *
44
+ * Use `variant="info"` for connection or branch labels and `variant="recessed"` for
45
+ * numeric count badges. Pass `as="button"` when the badge triggers an action.
46
+ */
47
+ export declare function SidebarBadge(props: Props): JSX.Element;
48
+ export {};
49
+ //# sourceMappingURL=SidebarBadge.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SidebarBadge.d.ts","sourceRoot":"","sources":["../../../src/components/SidebarItem/SidebarBadge.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGtE;;GAEG;AACH,MAAM,MAAM,mBAAmB,GAAG,MAAM,GAAG,UAAU,CAAC;AAEtD,KAAK,SAAS,GAAG;IACf;;OAEG;IACH,QAAQ,EAAE,SAAS,CAAC;IAEpB;;OAEG;IACH,OAAO,CAAC,EAAE,mBAAmB,CAAC;IAE9B;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,KAAK,SAAS,GAAG,SAAS,GACxB,IAAI,CAAC,wBAAwB,CAAC,MAAM,CAAC,EAAE,UAAU,GAAG,WAAW,GAAG,OAAO,CAAC,GAAG;IAC3E;;OAEG;IACH,EAAE,CAAC,EAAE,MAAM,CAAC;CACb,CAAC;AAEJ,KAAK,WAAW,GAAG,SAAS,GAC1B,IAAI,CAAC,wBAAwB,CAAC,QAAQ,CAAC,EAAE,UAAU,GAAG,WAAW,GAAG,MAAM,GAAG,OAAO,CAAC,GAAG;IACtF;;OAEG;IACH,EAAE,EAAE,QAAQ,CAAC;IAEb;;OAEG;IACH,IAAI,CAAC,EAAE,QAAQ,CAAC;CACjB,CAAC;AAEJ,KAAK,KAAK,GAAG,SAAS,GAAG,WAAW,CAAC;AAmDrC;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,KAAK,GAAG,GAAG,CAAC,OAAO,CAoBtD"}
@@ -0,0 +1,52 @@
1
+ import { jsx as _jsx } from "@harborclient/sdk/jsx-runtime";
2
+ import { cn } from '../utils.js';
3
+ const SIDEBAR_BADGE_OWN_PROPS = new Set([
4
+ 'children',
5
+ 'variant',
6
+ 'className',
7
+ 'as',
8
+ 'title',
9
+ 'type'
10
+ ]);
11
+ /**
12
+ * Returns props safe to spread onto the rendered DOM element.
13
+ *
14
+ * @param props - Full SidebarBadge props including component-only fields.
15
+ * @returns DOM props without SidebarBadge-specific keys.
16
+ */
17
+ function sidebarBadgeDomProps(props) {
18
+ return Object.fromEntries(Object.entries(props).filter(([key]) => !SIDEBAR_BADGE_OWN_PROPS.has(key)));
19
+ }
20
+ /**
21
+ * Returns variant and interaction classes for a sidebar badge.
22
+ *
23
+ * @param variant - Color and background preset.
24
+ * @param interactive - Whether the badge is rendered as a button.
25
+ * @returns Tailwind classes for the badge element.
26
+ */
27
+ function variantClasses(variant, interactive) {
28
+ const base = 'hc-sidebar-badge inline-flex h-[18px] shrink-0 items-center text-[14px] leading-none';
29
+ if (variant === 'recessed') {
30
+ return cn(base, 'min-w-[22px] justify-center rounded-full bg-selection px-2 font-normal text-muted shadow-[inset_0_0.5px_1px_rgba(0,0,0,0.06)]', interactive &&
31
+ 'app-no-drag cursor-pointer hover:text-text focus-visible:ring-2 focus-visible:ring-accent focus-visible:outline-none');
32
+ }
33
+ return cn(base, 'rounded bg-info/15 px-1.5 font-medium text-info', interactive &&
34
+ 'app-no-drag cursor-pointer hover:bg-info/25 focus-visible:ring-2 focus-visible:ring-accent focus-visible:outline-none');
35
+ }
36
+ /**
37
+ * Compact sidebar badge for storage locations, git branches, and count indicators.
38
+ *
39
+ * Use `variant="info"` for connection or branch labels and `variant="recessed"` for
40
+ * numeric count badges. Pass `as="button"` when the badge triggers an action.
41
+ */
42
+ export function SidebarBadge(props) {
43
+ const { children, variant = 'info', className, as = 'span', title } = props;
44
+ const interactive = as === 'button';
45
+ const classes = cn(variantClasses(variant, interactive), className);
46
+ const domProps = sidebarBadgeDomProps(props);
47
+ if (as === 'button') {
48
+ const type = props.type ?? 'button';
49
+ return (_jsx("button", { type: type, className: classes, title: title, ...domProps, children: children }));
50
+ }
51
+ return (_jsx("span", { className: classes, title: title, ...domProps, children: children }));
52
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"SidebarRunItem.d.ts","sourceRoot":"","sources":["../../../src/components/SidebarItem/SidebarRunItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAMxD,UAAU,KAAK;IACb;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IAEzB;;OAEG;IACH,kBAAkB,EAAE,MAAM,CAAC;IAE3B;;OAEG;IACH,aAAa,EAAE,MAAM,CAAC;IAEtB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;;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,sBAAsB,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAEzC;;OAEG;IACH,EAAE,CAAC,EAAE,KAAK,GAAG,IAAI,CAAC;CACnB;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,EAC7B,MAAM,EACN,KAAK,EACL,eAAe,EACf,kBAAkB,EAClB,aAAa,EACb,QAAgB,EAChB,KAAK,EACL,SAAS,EACT,YAAY,EACZ,WAAW,EACX,aAAa,EACb,OAAO,EACP,OAAO,EACP,sBAAsB,EACtB,EAAS,EACV,EAAE,KAAK,GAAG,GAAG,CAAC,OAAO,CA2CrB"}
1
+ {"version":3,"file":"SidebarRunItem.d.ts","sourceRoot":"","sources":["../../../src/components/SidebarItem/SidebarRunItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAOxD,UAAU,KAAK;IACb;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IAEzB;;OAEG;IACH,kBAAkB,EAAE,MAAM,CAAC;IAE3B;;OAEG;IACH,aAAa,EAAE,MAAM,CAAC;IAEtB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;;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,sBAAsB,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAEzC;;OAEG;IACH,EAAE,CAAC,EAAE,KAAK,GAAG,IAAI,CAAC;CACnB;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,EAC7B,MAAM,EACN,KAAK,EACL,eAAe,EACf,kBAAkB,EAClB,aAAa,EACb,QAAgB,EAChB,KAAK,EACL,SAAS,EACT,YAAY,EACZ,WAAW,EACX,aAAa,EACb,OAAO,EACP,OAAO,EACP,sBAAsB,EACtB,EAAS,EACV,EAAE,KAAK,GAAG,GAAG,CAAC,OAAO,CAwCrB"}
@@ -1,4 +1,5 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "@harborclient/sdk/jsx-runtime";
2
+ import { SidebarBadge } from './SidebarBadge.js';
2
3
  import { SidebarItem } from './SidebarItem.js';
3
4
  import { SidebarMethodBadge } from './SidebarMethodBadge.js';
4
5
  import { SidebarStatusDot } from './SidebarStatusDot.js';
@@ -20,5 +21,5 @@ export function SidebarRunItem({ method, label, connectionBadge, statusDotClassN
20
21
  }
21
22
  : undefined, children: _jsxs("span", { className: `${SIDEBAR_ITEM_BUTTON_CLASS} py-0.5`, title: title, ...(dataSidebarRunResultId != null
22
23
  ? { 'data-sidebar-run-result-id': String(dataSidebarRunResultId) }
23
- : {}), children: [method != null && method !== '' ? _jsx(SidebarMethodBadge, { method: method, uppercase: true }) : null, _jsxs("span", { className: "flex min-w-0 flex-1 items-center gap-1.5", children: [_jsx("span", { className: "min-w-0 truncate text-text", children: label }), connectionBadge != null ? (_jsx("span", { className: "shrink-0 rounded bg-info/15 px-1.5 py-0.5 text-[14px] font-medium text-info", title: `Stored in ${connectionBadge}`, children: connectionBadge })) : null] }), _jsx(SidebarStatusDot, { className: statusDotClassName, srOnlyLabel: statusSummary })] }) }));
24
+ : {}), children: [method != null && method !== '' ? _jsx(SidebarMethodBadge, { method: method, uppercase: true }) : null, _jsxs("span", { className: "flex min-w-0 flex-1 items-center gap-1.5", children: [_jsx("span", { className: "min-w-0 truncate text-text", children: label }), connectionBadge != null ? (_jsx(SidebarBadge, { variant: "info", title: `Stored in ${connectionBadge}`, children: connectionBadge })) : null] }), _jsx(SidebarStatusDot, { className: statusDotClassName, srOnlyLabel: statusSummary })] }) }));
24
25
  }
@@ -6,7 +6,8 @@ export { handleSidebarOptionKeyDown } from './sidebarListOption.js';
6
6
  export { SortableSidebarItem } from './SortableSidebarItem.js';
7
7
  export { stopSortableDragPointerDown } from './stopSortableDragPointerDown.js';
8
8
  export { SidebarColorDot } from './SidebarColorDot.js';
9
- export { sourceRow, METHOD_CLASSES, statusDotClass, SIDEBAR_ITEM_BUTTON_CLASS } from './sidebarItemClasses.js';
9
+ export { SidebarBadge, type SidebarBadgeVariant } from './SidebarBadge.js';
10
+ export { sourceRow, METHOD_CLASSES, statusDotVariant, statusDotClass, SIDEBAR_ITEM_BUTTON_CLASS } from './sidebarItemClasses.js';
10
11
  export { SidebarMethodBadge } from './SidebarMethodBadge.js';
11
12
  export { SidebarStatusDot } from './SidebarStatusDot.js';
12
13
  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,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACjE,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,EACL,SAAS,EACT,cAAc,EACd,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,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAClF,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
+ {"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,kBAAkB,CAAC;AACjE,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,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAClF,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"}
@@ -6,7 +6,8 @@ export { handleSidebarOptionKeyDown } from './sidebarListOption.js';
6
6
  export { SortableSidebarItem } from './SortableSidebarItem.js';
7
7
  export { stopSortableDragPointerDown } from './stopSortableDragPointerDown.js';
8
8
  export { SidebarColorDot } from './SidebarColorDot.js';
9
- export { sourceRow, METHOD_CLASSES, statusDotClass, SIDEBAR_ITEM_BUTTON_CLASS } from './sidebarItemClasses.js';
9
+ export { SidebarBadge } from './SidebarBadge.js';
10
+ export { sourceRow, METHOD_CLASSES, statusDotVariant, statusDotClass, SIDEBAR_ITEM_BUTTON_CLASS } from './sidebarItemClasses.js';
10
11
  export { SidebarMethodBadge } from './SidebarMethodBadge.js';
11
12
  export { SidebarStatusDot } from './SidebarStatusDot.js';
12
13
  export { SidebarStatusMarker } from './SidebarStatusMarker.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,CAMrD;AAED;;GAEG;AACH,eAAO,MAAM,yBAAyB,+HACwF,CAAC;AAE/H;;GAEG;AACH,eAAO,MAAM,yBAAyB,oVAC6S,CAAC"}
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 color class for an HTTP response code.
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 Tailwind background color class for the status dot.
34
+ * @returns Color preset for {@link StatusDot}.
34
35
  */
35
- export function statusDotClass(status) {
36
+ export function statusDotVariant(status) {
36
37
  if (status === 0)
37
- return 'bg-danger';
38
+ return 'danger';
38
39
  if (status >= 200 && status < 300)
39
- return 'bg-success';
40
+ return 'success';
40
41
  if (status >= 300 && status < 400)
41
- return 'bg-warning';
42
+ return 'warning';
42
43
  if (status >= 400)
43
- return 'bg-danger';
44
- return 'bg-info';
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,42 @@
1
+ import type { ComponentPropsWithoutRef, JSX } from 'react';
2
+ /**
3
+ * Visual tone for compact circular status indicators.
4
+ */
5
+ export type StatusDotVariant = 'success' | 'danger' | 'muted' | 'accent' | 'warning' | 'info';
6
+ /**
7
+ * Size preset for the status dot.
8
+ */
9
+ export type StatusDotSize = 'sm' | 'md';
10
+ interface Props extends Omit<ComponentPropsWithoutRef<'span'>, 'children'> {
11
+ /**
12
+ * Color preset for the dot background.
13
+ */
14
+ variant?: StatusDotVariant;
15
+ /**
16
+ * Screen-reader text describing the status when a visible label is not shown.
17
+ */
18
+ label?: string;
19
+ /**
20
+ * Dot diameter preset. `md` is the default list-row size; `sm` fits compact
21
+ * footer indicators.
22
+ */
23
+ size?: StatusDotSize;
24
+ /**
25
+ * Native tooltip text for hover affordance.
26
+ */
27
+ title?: string;
28
+ }
29
+ /**
30
+ * Returns the Tailwind background class for the chosen status dot variant.
31
+ *
32
+ * @param variant - Color preset for the dot.
33
+ * @returns Tailwind background color class.
34
+ */
35
+ export declare function statusDotVariantClass(variant: StatusDotVariant): string;
36
+ /**
37
+ * Renders a small circular status indicator with optional screen-reader text.
38
+ * Use `label` when status is not conveyed by adjacent visible text.
39
+ */
40
+ export declare function StatusDot({ variant, label, size, title, className, ...props }: Props): JSX.Element;
41
+ export {};
42
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/StatusDot/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAG3D;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,SAAS,GAAG,QAAQ,GAAG,OAAO,GAAG,QAAQ,GAAG,SAAS,GAAG,MAAM,CAAC;AAE9F;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG,IAAI,GAAG,IAAI,CAAC;AAExC,UAAU,KAAM,SAAQ,IAAI,CAAC,wBAAwB,CAAC,MAAM,CAAC,EAAE,UAAU,CAAC;IACxE;;OAEG;IACH,OAAO,CAAC,EAAE,gBAAgB,CAAC;IAE3B;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;;OAGG;IACH,IAAI,CAAC,EAAE,aAAa,CAAC;IAErB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,gBAAgB,GAAG,MAAM,CAgBvE;AAYD;;;GAGG;AACH,wBAAgB,SAAS,CAAC,EACxB,OAAiB,EACjB,KAAK,EACL,IAAW,EACX,KAAK,EACL,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,GAAG,GAAG,CAAC,OAAO,CAgBrB"}