@harborclient/sdk 1.0.61 → 1.0.63
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.
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import type { IconDefinition } from '@fortawesome/fontawesome-svg-core';
|
|
2
2
|
import type { ComponentPropsWithoutRef, JSX } from 'react';
|
|
3
|
+
/**
|
|
4
|
+
* Active-state background treatment for footer icon toggles.
|
|
5
|
+
*/
|
|
6
|
+
type ActiveStyle = 'surface' | 'selection';
|
|
3
7
|
interface Props extends Omit<ComponentPropsWithoutRef<'button'>, 'aria-label' | 'aria-pressed'> {
|
|
4
8
|
/**
|
|
5
9
|
* Font Awesome icon shown inside the footer toggle button.
|
|
@@ -18,11 +22,16 @@ interface Props extends Omit<ComponentPropsWithoutRef<'button'>, 'aria-label' |
|
|
|
18
22
|
* Optional tooltip text. Defaults to the computed show/hide label.
|
|
19
23
|
*/
|
|
20
24
|
title?: string;
|
|
25
|
+
/**
|
|
26
|
+
* Active-state background treatment. Use `"selection"` to match sidebar
|
|
27
|
+
* toolbar icon toggles; defaults to `"surface"` for the action menu icon.
|
|
28
|
+
*/
|
|
29
|
+
activeStyle?: ActiveStyle;
|
|
21
30
|
}
|
|
22
31
|
/**
|
|
23
32
|
* Icon-only toggle button for the window footer bar, used to show or hide
|
|
24
33
|
* sidebars and similar panels.
|
|
25
34
|
*/
|
|
26
|
-
export declare function FooterIcon({ icon, active, onClick, label, title, className, ...props }: Props): JSX.Element;
|
|
35
|
+
export declare function FooterIcon({ icon, active, onClick, label, title, activeStyle, className, ...props }: Props): JSX.Element;
|
|
27
36
|
export {};
|
|
28
37
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/FooterIcon/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AACxE,OAAO,KAAK,EAAE,wBAAwB,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAI3D,UAAU,KAAM,SAAQ,IAAI,CAAC,wBAAwB,CAAC,QAAQ,CAAC,EAAE,YAAY,GAAG,cAAc,CAAC;IAC7F;;OAEG;IACH,IAAI,EAAE,cAAc,CAAC;IAErB;;OAEG;IACH,MAAM,EAAE,OAAO,CAAC;IAEhB;;;OAGG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/FooterIcon/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AACxE,OAAO,KAAK,EAAE,wBAAwB,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAI3D;;GAEG;AACH,KAAK,WAAW,GAAG,SAAS,GAAG,WAAW,CAAC;AAE3C,UAAU,KAAM,SAAQ,IAAI,CAAC,wBAAwB,CAAC,QAAQ,CAAC,EAAE,YAAY,GAAG,cAAc,CAAC;IAC7F;;OAEG;IACH,IAAI,EAAE,cAAc,CAAC;IAErB;;OAEG;IACH,MAAM,EAAE,OAAO,CAAC;IAEhB;;;OAGG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;;OAGG;IACH,WAAW,CAAC,EAAE,WAAW,CAAC;CAC3B;AAwBD;;;GAGG;AACH,wBAAgB,UAAU,CAAC,EACzB,IAAI,EACJ,MAAM,EACN,OAAO,EACP,KAAK,EACL,KAAK,EACL,WAAuB,EACvB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,GAAG,GAAG,CAAC,OAAO,CAqBrB"}
|
|
@@ -1,19 +1,29 @@
|
|
|
1
1
|
import { jsx as _jsx } from "@harborclient/sdk/jsx-runtime";
|
|
2
2
|
import { FaIcon } from '../FaIcon/index.js';
|
|
3
3
|
import { cn } from '../utils.js';
|
|
4
|
+
const footerIconBase = 'inline-flex h-7 w-7 shrink-0 cursor-pointer items-center justify-center rounded-md border-none app-no-drag';
|
|
4
5
|
/**
|
|
5
6
|
* Square icon toggle styles for footer sidebar buttons.
|
|
7
|
+
*
|
|
8
|
+
* @param active - Whether the associated panel or sidebar is open.
|
|
9
|
+
* @param activeStyle - Active background treatment for the toggle.
|
|
10
|
+
* @returns Tailwind class string for the footer icon button.
|
|
6
11
|
*/
|
|
7
|
-
function footerIconButton(active) {
|
|
12
|
+
function footerIconButton(active, activeStyle) {
|
|
13
|
+
if (activeStyle === 'selection') {
|
|
14
|
+
return active
|
|
15
|
+
? `${footerIconBase} bg-selection text-text`
|
|
16
|
+
: `${footerIconBase} bg-transparent text-text hover:bg-selection focus-visible:bg-selection focus-visible:text-text`;
|
|
17
|
+
}
|
|
8
18
|
return active
|
|
9
|
-
?
|
|
10
|
-
:
|
|
19
|
+
? `${footerIconBase} bg-surface text-text shadow-sm`
|
|
20
|
+
: `${footerIconBase} bg-transparent text-muted hover:bg-selection hover:text-text`;
|
|
11
21
|
}
|
|
12
22
|
/**
|
|
13
23
|
* Icon-only toggle button for the window footer bar, used to show or hide
|
|
14
24
|
* sidebars and similar panels.
|
|
15
25
|
*/
|
|
16
|
-
export function FooterIcon({ icon, active, onClick, label, title, className, ...props }) {
|
|
26
|
+
export function FooterIcon({ icon, active, onClick, label, title, activeStyle = 'surface', className, ...props }) {
|
|
17
27
|
const accessibleLabel = active ? `Hide ${label}` : `Show ${label}`;
|
|
18
|
-
return (_jsx("button", { ...props, type: "button", className: cn('hc-footer-icon', footerIconButton(active), className), onClick: onClick, "aria-pressed": active, "aria-label": accessibleLabel, title: title ?? accessibleLabel, children: _jsx(FaIcon, { icon: icon, className:
|
|
28
|
+
return (_jsx("button", { ...props, type: "button", className: cn('hc-footer-icon', footerIconButton(active, activeStyle), className), onClick: onClick, "aria-pressed": active, "aria-label": accessibleLabel, title: title ?? accessibleLabel, children: _jsx(FaIcon, { icon: icon, className: cn('hc-footer-icon-icon h-4 w-4', activeStyle === 'selection' && (active ? 'opacity-100' : 'opacity-50')) }) }));
|
|
19
29
|
}
|