@harborclient/sdk 1.0.34 → 1.0.36
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.
|
@@ -190,7 +190,7 @@ export function SegmentedTabs({ tabs, value: valueProp, onChange: onChangeProp,
|
|
|
190
190
|
}, [visibleTabs, value, onChange, isRadiogroup, context, getPanelId]);
|
|
191
191
|
return (_jsxs("div", { ...props, className: outerClassName, children: [_jsx("div", { className: tabListClassName, role: isRadiogroup ? 'radiogroup' : 'tablist', "aria-label": ariaLabel, ...(!isRadiogroup ? { 'aria-orientation': 'horizontal' } : {}), onKeyDown: handleKeyDown, children: visibleTabs.map((tab) => {
|
|
192
192
|
const selected = value === tab.value;
|
|
193
|
-
const tabClassName = `hc-segmented-tabs-tab flex items-center ${segment(selected)}${fullWidth ? ' flex-1' : ''}`;
|
|
193
|
+
const tabClassName = `hc-segmented-tabs-tab flex items-center justify-center ${segment(selected)}${fullWidth ? ' flex-1' : ''}`;
|
|
194
194
|
return (_jsx("button", { ref: (element) => {
|
|
195
195
|
if (element)
|
|
196
196
|
tabRefs.current.set(tab.value, element);
|
|
@@ -203,6 +203,6 @@ export function SegmentedTabs({ tabs, value: valueProp, onChange: onChangeProp,
|
|
|
203
203
|
id: getTabId(tab.value),
|
|
204
204
|
'aria-selected': selected,
|
|
205
205
|
...(context ? { 'aria-controls': getPanelId(tab.value) } : {})
|
|
206
|
-
}), children: _jsxs("span", { className: "hc-segmented-tabs-tab-label inline-flex items-center gap-1.5", children: [_jsx("span", { className: "inline-flex shrink-0 items-center px-1.5", children: _jsx("span", { className: cn('hc-segmented-tabs-tab-indicator h-1.5 w-1.5 shrink-0 rounded-full', tab.indicator ? 'bg-accent' : 'bg-transparent'), "aria-hidden": true }) }), tab.label, _jsx("span", { className: "hc-segmented-tabs-tab-indicator-spacer inline-flex shrink-0 items-center px-1.5", "aria-hidden": true, children: _jsx("span", { className: "h-1.5 w-1.5 shrink-0" }) })] }) }, tab.value));
|
|
206
|
+
}), children: _jsxs("span", { className: "hc-segmented-tabs-tab-label inline-flex items-center justify-center gap-1.5", children: [_jsx("span", { className: "inline-flex shrink-0 items-center px-1.5", children: _jsx("span", { className: cn('hc-segmented-tabs-tab-indicator h-1.5 w-1.5 shrink-0 rounded-full', tab.indicator ? 'bg-accent' : 'bg-transparent'), "aria-hidden": true }) }), tab.label, _jsx("span", { className: "hc-segmented-tabs-tab-indicator-spacer inline-flex shrink-0 items-center px-1.5", "aria-hidden": true, children: _jsx("span", { className: "h-1.5 w-1.5 shrink-0" }) })] }) }, tab.value));
|
|
207
207
|
}) }), editable && (_jsx(SegmentedTabsVisibilityMenu, { tabs: editableTabs, visibleTabValues: visibleTabValues, onToggle: handleVisibilityToggle }))] }));
|
|
208
208
|
}
|
|
@@ -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/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wB,CAAC,KAAK,CAAC,EAAE,UAAU,GAAG,YAAY,CAAC;IACtF;;OAEG;IACH,OAAO,EAAE,aAAa,EAAE,CAAC;IAEzB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAQD;;GAEG;AACH,wBAAgB,OAAO,CAAC,EACtB,OAAO,EACP,SAAqB,EACrB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,GAAG,GAAG,CAAC,OAAO,CA4CrB"}
|
|
@@ -2,29 +2,15 @@ import { jsx as _jsx, jsxs as _jsxs } from "@harborclient/sdk/jsx-runtime";
|
|
|
2
2
|
import { FaIcon } from '../FaIcon/index.js';
|
|
3
3
|
import { cn } from '../utils.js';
|
|
4
4
|
/**
|
|
5
|
-
* Tailwind classes for
|
|
5
|
+
* Tailwind classes for toolbar icon action buttons.
|
|
6
6
|
*/
|
|
7
|
-
const
|
|
8
|
-
/**
|
|
9
|
-
* Tailwind classes for pressed toolbar toggles, matching footer layout icon buttons.
|
|
10
|
-
*/
|
|
11
|
-
const TOOLBAR_ACTION_BUTTON_ACTIVE = 'hc-toolbar-action inline-flex h-7 w-7 shrink-0 cursor-pointer items-center justify-center rounded-md border-none bg-control text-text shadow-sm focus-visible:bg-surface focus-visible:text-text disabled:cursor-not-allowed disabled:opacity-50 app-no-drag';
|
|
12
|
-
/**
|
|
13
|
-
* Resolves toolbar button classes for a declarative action.
|
|
14
|
-
*/
|
|
15
|
-
function toolbarActionButton(action) {
|
|
16
|
-
return action.ariaPressed === true
|
|
17
|
-
? TOOLBAR_ACTION_BUTTON_ACTIVE
|
|
18
|
-
: TOOLBAR_ACTION_BUTTON_INACTIVE;
|
|
19
|
-
}
|
|
7
|
+
const TOOLBAR_ACTION_BUTTON = 'hc-toolbar-action inline-flex h-7 w-7 shrink-0 cursor-pointer items-center justify-center rounded-md border-none bg-transparent text-text hover:bg-selection focus-visible:bg-selection focus-visible:text-text disabled:cursor-not-allowed disabled:opacity-50 app-no-drag';
|
|
20
8
|
/**
|
|
21
9
|
* Top-of-sidebar toolbar with left-aligned icon actions.
|
|
22
10
|
*/
|
|
23
11
|
export function Toolbar({ actions, ariaLabel = 'Toolbar', className, ...props }) {
|
|
24
12
|
return (_jsx("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", children: actions.map((action) => {
|
|
25
13
|
const title = action.title ?? action.label;
|
|
26
|
-
return (_jsxs("div", { className: "hc-toolbar-action-wrap relative", children: [_jsx("button", { type: "button", ref: action.buttonRef, className:
|
|
27
|
-
? 'hc-toolbar-action-icon h-5! w-5!'
|
|
28
|
-
: 'hc-toolbar-action-icon h-5! w-5!' }) }), action.popover] }, action.id));
|
|
14
|
+
return (_jsxs("div", { className: "hc-toolbar-action-wrap relative", children: [_jsx("button", { type: "button", ref: action.buttonRef, className: TOOLBAR_ACTION_BUTTON, title: title, "aria-label": action.label, "aria-expanded": action.ariaExpanded, "aria-pressed": action.ariaPressed, "aria-haspopup": action.ariaHaspopup, disabled: action.disabled, onClick: action.onClick, children: _jsx(FaIcon, { icon: action.icon, className: cn('hc-toolbar-action-icon h-5! w-5!', action.ariaPressed === true ? 'opacity-100' : 'opacity-50') }) }), action.popover] }, action.id));
|
|
29
15
|
}) }) }));
|
|
30
16
|
}
|