@ds-mo/ui 1.3.0 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/ds-bar-nav-action.js +1 -1
- package/dist/components/ds-bar-nav.js +1 -1
- package/dist/components/ds-bar-nav.js.map +1 -1
- package/dist/components/ds-breadcrumb.js +1 -1
- package/dist/components/ds-button-group.js +1 -1
- package/dist/components/ds-button.js +1 -1
- package/dist/components/ds-card.js +1 -1
- package/dist/components/ds-checkbox.js +1 -1
- package/dist/components/ds-chip.js +1 -1
- package/dist/components/ds-divider.js +1 -1
- package/dist/components/ds-empty-state.js +1 -1
- package/dist/components/ds-fade.js +1 -1
- package/dist/components/ds-field.js +1 -1
- package/dist/components/ds-header.js +1 -1
- package/dist/components/ds-icon.js +1 -1
- package/dist/components/ds-input.js +1 -1
- package/dist/components/ds-modal.js +1 -1
- package/dist/components/ds-panel-nav.js +1 -1
- package/dist/components/ds-panel-nav.js.map +1 -1
- package/dist/components/ds-radio-group.js +1 -1
- package/dist/components/ds-radio-group.js.map +1 -1
- package/dist/components/ds-scrollbar.js +1 -1
- package/dist/components/ds-select.js +1 -1
- package/dist/components/ds-surface.js +1 -1
- package/dist/components/ds-tab-group-nav.js +1 -1
- package/dist/components/ds-tab-group.js +1 -1
- package/dist/components/ds-table.js +1 -1
- package/dist/components/ds-table.js.map +1 -1
- package/dist/components/ds-tag.js +1 -1
- package/dist/components/ds-text.js +1 -1
- package/dist/components/ds-toast-provider.js +1 -1
- package/dist/components/ds-toggle-button-group.js +1 -1
- package/dist/components/ds-toggle-button.js +1 -1
- package/dist/components/ds-tooltip.js +1 -1
- package/dist/components/index.d.ts +3 -4
- package/dist/components/index.js +1 -1
- package/dist/components/index.js.map +1 -1
- package/dist/components/{p-COsKOwZR.js → p--YDw8Q4o.js} +2 -2
- package/dist/components/{p-OT-Q-NxH.js → p-C9za7IDu.js} +2 -2
- package/dist/components/p-DceSoh5V.js +2 -0
- package/dist/components/p-DceSoh5V.js.map +1 -0
- package/dist/components/{p-DrDrPeVV.js → p-DqBCQRRd.js} +2 -2
- package/dist/components/p-DznbYg1m.js +2 -0
- package/dist/components/p-DznbYg1m.js.map +1 -0
- package/dist/components/{p-qfvbc9w-.js → p-_LI2ymhS.js} +2 -2
- package/dist/components/p-_LI2ymhS.js.map +1 -0
- package/dist/components/{p-U1A-rprN.js → p-uMN1Ppw2.js} +2 -2
- package/dist/components/{p-X1N_ggsY.js → p-vW9EMP8s.js} +2 -2
- package/dist/types/{.stencil → components}/BarNav/BarNav.d.ts +6 -17
- package/dist/types/components/BarNav/bar-nav-types.d.ts +14 -0
- package/dist/types/{.stencil → components}/BarNav/bar-nav-utils.d.ts +1 -1
- package/dist/types/components/BarNav/index.d.ts +3 -0
- package/dist/types/{.stencil → components}/BarNavAction/BarNavAction.d.ts +1 -1
- package/dist/types/{.stencil → components}/PanelNav/PanelNav.d.ts +11 -26
- package/dist/types/components/PanelNav/index.d.ts +4 -0
- package/dist/types/components/PanelNav/panel-nav-types.d.ts +20 -0
- package/dist/types/components/PanelNav/panel-nav-utils.d.ts +26 -0
- package/dist/types/{.stencil → components}/TabGroupNav/TabGroupNav.d.ts +1 -1
- package/dist/types/components.d.ts +30 -28
- package/dist/types/nav/index.d.ts +5 -0
- package/dist/types/nav/nav-chrome.d.ts +14 -0
- package/dist/types/nav/shell-view-transition.d.ts +21 -0
- package/package.json +7 -2
- package/src/angular/proxies.ts +4 -4
- package/src/wc/components/BarNav/BarNav.tsx +18 -26
- package/src/wc/components/BarNav/bar-nav-types.ts +15 -0
- package/src/wc/components/BarNav/bar-nav-utils.ts +1 -1
- package/src/wc/components/BarNav/index.ts +2 -1
- package/src/wc/components/BarNavAction/BarNavAction.tsx +2 -1
- package/src/wc/components/PanelNav/PanelNav.tsx +46 -90
- package/src/wc/components/PanelNav/index.ts +9 -4
- package/src/wc/components/PanelNav/panel-nav-types.ts +22 -0
- package/src/wc/components/PanelNav/panel-nav-utils.ts +32 -64
- package/src/wc/components/TabGroupNav/TabGroupNav.tsx +8 -2
- package/src/wc/components.d.ts +30 -28
- package/src/wc/nav/index.ts +19 -0
- package/src/wc/nav/nav-chrome.ts +45 -0
- package/src/wc/nav/shell-view-transition.ts +102 -0
- package/dist/components/p-DOtcc9UU.js +0 -2
- package/dist/components/p-DOtcc9UU.js.map +0 -1
- package/dist/components/p-qfvbc9w-.js.map +0 -1
- package/dist/types/.stencil/BarNav/index.d.ts +0 -2
- package/dist/types/.stencil/PanelNav/index.d.ts +0 -3
- package/dist/types/.stencil/PanelNav/panel-nav-utils.d.ts +0 -27
- /package/dist/components/{p-COsKOwZR.js.map → p--YDw8Q4o.js.map} +0 -0
- /package/dist/components/{p-OT-Q-NxH.js.map → p-C9za7IDu.js.map} +0 -0
- /package/dist/components/{p-DrDrPeVV.js.map → p-DqBCQRRd.js.map} +0 -0
- /package/dist/components/{p-U1A-rprN.js.map → p-uMN1Ppw2.js.map} +0 -0
- /package/dist/components/{p-X1N_ggsY.js.map → p-vW9EMP8s.js.map} +0 -0
- /package/dist/types/{.stencil → components}/Accordion/Accordion.d.ts +0 -0
- /package/dist/types/{.stencil → components}/Badge/Badge.d.ts +0 -0
- /package/dist/types/{.stencil → components}/Badge/index.d.ts +0 -0
- /package/dist/types/{.stencil → components}/Banner/Banner.d.ts +0 -0
- /package/dist/types/{.stencil → components}/BarNav/bar-nav-dom-utils.d.ts +0 -0
- /package/dist/types/{.stencil → components}/BarNav/bar-nav-tabs-menu-utils.d.ts +0 -0
- /package/dist/types/{.stencil → components}/BarNavAction/index.d.ts +0 -0
- /package/dist/types/{.stencil → components}/Breadcrumb/Breadcrumb.d.ts +0 -0
- /package/dist/types/{.stencil → components}/Button/Button.d.ts +0 -0
- /package/dist/types/{.stencil → components}/Button/index.d.ts +0 -0
- /package/dist/types/{.stencil → components}/ButtonGroup/ButtonGroup.d.ts +0 -0
- /package/dist/types/{.stencil → components}/Card/Card.d.ts +0 -0
- /package/dist/types/{.stencil → components}/Checkbox/Checkbox.d.ts +0 -0
- /package/dist/types/{.stencil → components}/Checkbox/index.d.ts +0 -0
- /package/dist/types/{.stencil → components}/Chip/Chip.d.ts +0 -0
- /package/dist/types/{.stencil → components}/Chip/index.d.ts +0 -0
- /package/dist/types/{.stencil → components}/Divider/Divider.d.ts +0 -0
- /package/dist/types/{.stencil → components}/Divider/index.d.ts +0 -0
- /package/dist/types/{.stencil → components}/EmptyState/EmptyState.d.ts +0 -0
- /package/dist/types/{.stencil → components}/Fade/Fade.d.ts +0 -0
- /package/dist/types/{.stencil → components}/Fade/index.d.ts +0 -0
- /package/dist/types/{.stencil → components}/Field/Field.d.ts +0 -0
- /package/dist/types/{.stencil → components}/Header/Header.d.ts +0 -0
- /package/dist/types/{.stencil → components}/Icon/Icon.d.ts +0 -0
- /package/dist/types/{.stencil → components}/Icon/flag-icon-catalog.d.ts +0 -0
- /package/dist/types/{.stencil → components}/Icon/index.d.ts +0 -0
- /package/dist/types/{.stencil → components}/Icon/system-icon-catalog.d.ts +0 -0
- /package/dist/types/{.stencil → components}/Input/Input.d.ts +0 -0
- /package/dist/types/{.stencil → components}/Input/index.d.ts +0 -0
- /package/dist/types/{.stencil → components}/Loader/Loader.d.ts +0 -0
- /package/dist/types/{.stencil → components}/Loader/index.d.ts +0 -0
- /package/dist/types/{.stencil → components}/Menu/Menu.d.ts +0 -0
- /package/dist/types/{.stencil → components}/Modal/Modal.d.ts +0 -0
- /package/dist/types/{.stencil → components}/Pagination/Pagination.d.ts +0 -0
- /package/dist/types/{.stencil → components}/RadioGroup/RadioGroup.d.ts +0 -0
- /package/dist/types/{.stencil → components}/RadioGroup/index.d.ts +0 -0
- /package/dist/types/{.stencil → components}/Scrollbar/Scrollbar.d.ts +0 -0
- /package/dist/types/{.stencil → components}/Select/Select.d.ts +0 -0
- /package/dist/types/{.stencil → components}/Sidebar/Sidebar.d.ts +0 -0
- /package/dist/types/{.stencil → components}/Skeleton/Skeleton.d.ts +0 -0
- /package/dist/types/{.stencil → components}/Skeleton/index.d.ts +0 -0
- /package/dist/types/{.stencil → components}/Slider/Slider.d.ts +0 -0
- /package/dist/types/{.stencil → components}/Slider/index.d.ts +0 -0
- /package/dist/types/{.stencil → components}/Surface/Surface.d.ts +0 -0
- /package/dist/types/{.stencil → components}/TabGroup/TabGroup.d.ts +0 -0
- /package/dist/types/{.stencil → components}/TabGroup/tab-item-utils.d.ts +0 -0
- /package/dist/types/{.stencil → components}/Table/Table.d.ts +0 -0
- /package/dist/types/{.stencil → components}/Tag/Tag.d.ts +0 -0
- /package/dist/types/{.stencil → components}/Tag/index.d.ts +0 -0
- /package/dist/types/{.stencil → components}/Text/Text.d.ts +0 -0
- /package/dist/types/{.stencil → components}/Text/index.d.ts +0 -0
- /package/dist/types/{.stencil → components}/Toast/Toast.d.ts +0 -0
- /package/dist/types/{.stencil → components}/Toast/toast-service.d.ts +0 -0
- /package/dist/types/{.stencil → components}/Toggle/Toggle.d.ts +0 -0
- /package/dist/types/{.stencil → components}/Toggle/index.d.ts +0 -0
- /package/dist/types/{.stencil → components}/ToggleButton/ToggleButton.d.ts +0 -0
- /package/dist/types/{.stencil → components}/ToggleButtonGroup/ToggleButtonGroup.d.ts +0 -0
- /package/dist/types/{.stencil → components}/Tooltip/Tooltip.d.ts +0 -0
|
@@ -1,19 +1,6 @@
|
|
|
1
1
|
import { EventEmitter } from '../../stencil-public-runtime';
|
|
2
|
-
import type {
|
|
3
|
-
|
|
4
|
-
/** Same shape as `TabItem` — supports `{ type: 'divider' }` between tab groups. */
|
|
5
|
-
export type BarNavTab = TabItem;
|
|
6
|
-
export interface BarNavActionItem {
|
|
7
|
-
id: string;
|
|
8
|
-
/** Icon name for <ds-icon>. */
|
|
9
|
-
icon: string;
|
|
10
|
-
/** Whether this action button is currently pressed/active. */
|
|
11
|
-
selected?: boolean;
|
|
12
|
-
/** Show a notification dot. */
|
|
13
|
-
dot?: boolean;
|
|
14
|
-
inactive?: boolean;
|
|
15
|
-
ariaLabel?: string;
|
|
16
|
-
}
|
|
2
|
+
import type { NavChromeStyle } from '../../nav/nav-chrome';
|
|
3
|
+
import type { BarNavActionItem, BarNavTab } from './bar-nav-types';
|
|
17
4
|
export declare class BarNav {
|
|
18
5
|
/**
|
|
19
6
|
* Tab items for the left section.
|
|
@@ -36,8 +23,9 @@ export declare class BarNav {
|
|
|
36
23
|
* When tabs are present the heading is hidden.
|
|
37
24
|
*/
|
|
38
25
|
heading: string | undefined;
|
|
39
|
-
/**
|
|
40
|
-
|
|
26
|
+
/** Chrome style: `navigation` = navigation tokens, `default` = app tokens.
|
|
27
|
+
* Property: `navStyle`. HTML attribute: `nav-style`. */
|
|
28
|
+
navStyle: NavChromeStyle;
|
|
41
29
|
/** Section base path (e.g. `/dashboard/safety`). Used with `currentUrl` to derive `value`. */
|
|
42
30
|
basePath: string;
|
|
43
31
|
/** Current route URL. When set with `basePath`, the active tab is derived automatically. */
|
|
@@ -107,6 +95,7 @@ export declare class BarNav {
|
|
|
107
95
|
private handleActionChange;
|
|
108
96
|
private toggleTabMenu;
|
|
109
97
|
private handleTriggerKeyDown;
|
|
98
|
+
private get tabSurface();
|
|
110
99
|
render(): any;
|
|
111
100
|
}
|
|
112
101
|
//# sourceMappingURL=BarNav.d.ts.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { TabItem } from '../TabGroup/tab-item-utils';
|
|
2
|
+
export type BarNavTab = TabItem;
|
|
3
|
+
export interface BarNavActionItem {
|
|
4
|
+
id: string;
|
|
5
|
+
/** Icon name for <ds-icon>. */
|
|
6
|
+
icon: string;
|
|
7
|
+
/** Whether this action button is currently pressed/active. */
|
|
8
|
+
selected?: boolean;
|
|
9
|
+
/** Show a notification dot. */
|
|
10
|
+
dot?: boolean;
|
|
11
|
+
inactive?: boolean;
|
|
12
|
+
ariaLabel?: string;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=bar-nav-types.d.ts.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { EventEmitter } from '../../stencil-public-runtime';
|
|
2
|
-
export type BarNavActionBackground = 'faint' | 'medium' | 'bold' | 'strong' | 'always-dark';
|
|
2
|
+
export type BarNavActionBackground = 'faint' | 'medium' | 'bold' | 'strong' | 'always-dark' | 'navigation';
|
|
3
3
|
export declare class BarNavAction {
|
|
4
4
|
/** Icon name passed to <ds-icon>. */
|
|
5
5
|
icon: string;
|
|
@@ -1,26 +1,11 @@
|
|
|
1
1
|
import { EventEmitter } from '../../stencil-public-runtime';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export interface PanelNavItem {
|
|
5
|
-
id: string;
|
|
6
|
-
icon: string;
|
|
7
|
-
label: string;
|
|
8
|
-
/** Show a notification dot badge on the item */
|
|
9
|
-
dot?: boolean;
|
|
10
|
-
flag?: boolean;
|
|
11
|
-
/** Route path used for `currentUrl` matching. In `anchor` mode also sets `<a href>`.
|
|
12
|
-
* In `event` mode navigation is delegated to the host via `dsNavSelect`. */
|
|
13
|
-
href?: string;
|
|
14
|
-
}
|
|
15
|
-
export interface PanelNavGroup {
|
|
16
|
-
id?: string;
|
|
17
|
-
label?: string;
|
|
18
|
-
items: PanelNavItem[];
|
|
19
|
-
}
|
|
2
|
+
import type { NavChromeStyle } from '../../nav/nav-chrome';
|
|
3
|
+
import type { PanelNavGroup, PanelNavRouterMode } from './panel-nav-types';
|
|
20
4
|
export declare class PanelNav {
|
|
21
|
-
/**
|
|
22
|
-
|
|
23
|
-
|
|
5
|
+
/** Chrome style: `navigation` = navigation tokens, `default` = standard app tokens.
|
|
6
|
+
* Property: `navStyle`. HTML attribute: `nav-style`. */
|
|
7
|
+
navStyle: NavChromeStyle;
|
|
8
|
+
/** When `true`, the component does not run its own View Transition on style
|
|
24
9
|
* change — it just updates the rendered surface synchronously. Use this when
|
|
25
10
|
* the host app orchestrates the page transition itself (e.g. Angular Router's
|
|
26
11
|
* `withViewTransitions`), so the two don't fight or nest. */
|
|
@@ -60,9 +45,9 @@ export declare class PanelNav {
|
|
|
60
45
|
/** Emitted when the footer user button is clicked. */
|
|
61
46
|
dsNavUserAction: EventEmitter<void>;
|
|
62
47
|
el: HTMLElement;
|
|
63
|
-
/** Mirrors `
|
|
48
|
+
/** Mirrors `style` but is only updated inside the VT callback so the
|
|
64
49
|
* View Transition captures a clean before/after snapshot. */
|
|
65
|
-
private
|
|
50
|
+
private renderedStyle;
|
|
66
51
|
private parsedGroups;
|
|
67
52
|
private atBottom;
|
|
68
53
|
private isAnimating;
|
|
@@ -90,7 +75,7 @@ export declare class PanelNav {
|
|
|
90
75
|
onGroupsChange(val: string | PanelNavGroup[]): void;
|
|
91
76
|
onActiveIdChange(): void;
|
|
92
77
|
onCurrentUrlChange(): void;
|
|
93
|
-
|
|
78
|
+
onNavStyleChange(newVal: NavChromeStyle): Promise<void>;
|
|
94
79
|
componentWillLoad(): void;
|
|
95
80
|
componentDidLoad(): void;
|
|
96
81
|
componentDidRender(): void;
|
|
@@ -103,8 +88,8 @@ export declare class PanelNav {
|
|
|
103
88
|
private syncActiveFromUrl;
|
|
104
89
|
/** Re-parse props assigned by the host after componentWillLoad (Angular ngAfterViewInit). */
|
|
105
90
|
private syncHostPropsIfNeeded;
|
|
106
|
-
/** Align `
|
|
107
|
-
private
|
|
91
|
+
/** Align `renderedStyle` with `style` when host bindings land after first paint. */
|
|
92
|
+
private syncRenderedStyleIfNeeded;
|
|
108
93
|
/** Poll across animation frames — host props may land without triggering @Watch. */
|
|
109
94
|
private scheduleDeferredHostPropSync;
|
|
110
95
|
/** Centralised toggle: always emits `dsNavToggle`; when `storageKey` is set
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export type { PanelNavRouterMode, PanelNavItem, PanelNavGroup } from './panel-nav-types';
|
|
2
|
+
export type { NavChromeStyle } from '../../nav/nav-chrome';
|
|
3
|
+
export { NAV_STYLE_HINT_ATTR, setNavStyleHint, clearNavStyleHint, resolvePanelNavStyle, shouldResyncPanelNavStyle, ensurePanelNavVtStyle, deriveActiveIdFromUrl, parsePanelNavGroups, } from './panel-nav-utils';
|
|
4
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { NavChromeStyle } from '../../nav/nav-chrome';
|
|
2
|
+
export type { NavChromeStyle };
|
|
3
|
+
export type PanelNavRouterMode = 'anchor' | 'event';
|
|
4
|
+
export interface PanelNavItem {
|
|
5
|
+
id: string;
|
|
6
|
+
icon: string;
|
|
7
|
+
label: string;
|
|
8
|
+
/** Show a notification dot badge on the item */
|
|
9
|
+
dot?: boolean;
|
|
10
|
+
flag?: boolean;
|
|
11
|
+
/** Route path used for `currentUrl` matching. In `anchor` mode also sets `<a href>`.
|
|
12
|
+
* In `event` mode navigation is delegated to the host via `dsNavSelect`. */
|
|
13
|
+
href?: string;
|
|
14
|
+
}
|
|
15
|
+
export interface PanelNavGroup {
|
|
16
|
+
id?: string;
|
|
17
|
+
label?: string;
|
|
18
|
+
items: PanelNavItem[];
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=panel-nav-types.d.ts.map
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { PanelNavGroup, PanelNavItem } from './panel-nav-types';
|
|
2
|
+
import { NAV_STYLE_HINT_ATTR, clearNavStyleHint, readNavStyleAttr, resolveNavChromeStyle, setNavStyleHint, shouldResyncNavChromeStyle } from '../../nav/nav-chrome';
|
|
3
|
+
import { ensureShellNavVtStyle } from '../../nav/shell-view-transition';
|
|
4
|
+
export type { NavChromeStyle } from '../../nav/nav-chrome';
|
|
5
|
+
export { NAV_STYLE_HINT_ATTR, readNavStyleAttr, setNavStyleHint, clearNavStyleHint, resolveNavChromeStyle as resolvePanelNavStyle, shouldResyncNavChromeStyle as shouldResyncPanelNavStyle, };
|
|
6
|
+
/** @deprecated Use `setNavStyleHint` */
|
|
7
|
+
export declare const setPanelNavStyleHint: typeof setNavStyleHint;
|
|
8
|
+
/** @deprecated Use `clearNavStyleHint` */
|
|
9
|
+
export declare const clearPanelNavStyleHint: typeof clearNavStyleHint;
|
|
10
|
+
/** @deprecated Use `NAV_STYLE_HINT_ATTR` */
|
|
11
|
+
export declare const PANEL_NAV_STYLE_HINT_ATTR = "data-nav-style";
|
|
12
|
+
/** @deprecated Use `ensureShellNavVtStyle` */
|
|
13
|
+
export declare const ensurePanelNavVtStyle: typeof ensureShellNavVtStyle;
|
|
14
|
+
/** Whether `path` matches `href` at a segment boundary (exact or child path). */
|
|
15
|
+
export declare function hrefMatchesPath(path: string, href: string): boolean;
|
|
16
|
+
/** Derive the active nav item id from a URL using longest segment-boundary prefix match. */
|
|
17
|
+
export declare function deriveActiveIdFromUrl(path: string, items: PanelNavItem[]): string;
|
|
18
|
+
/** Total nav item count across all groups. */
|
|
19
|
+
export declare function countPanelNavItems(groups: PanelNavGroup[]): number;
|
|
20
|
+
/** Parse `groups` from either a JSON attribute string or a JS property array. */
|
|
21
|
+
export declare function parsePanelNavGroups(groups: string | unknown): PanelNavGroup[];
|
|
22
|
+
/** Resolve whether VT is disabled from prop and/or host attribute. */
|
|
23
|
+
export declare function resolvePanelNavDisableVt(prop: boolean, attr: string | null): boolean;
|
|
24
|
+
/** True when host `groups` has items but internal parsed state is still empty. */
|
|
25
|
+
export declare function shouldResyncPanelNavGroups(parsedGroups: PanelNavGroup[], groups: string | unknown): boolean;
|
|
26
|
+
//# sourceMappingURL=panel-nav-utils.d.ts.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { EventEmitter } from '../../stencil-public-runtime';
|
|
2
2
|
import { type TabItem } from '../TabGroup/tab-item-utils';
|
|
3
|
-
export type TabGroupNavBackground = 'faint' | 'medium' | 'bold' | 'strong' | 'always-dark';
|
|
3
|
+
export type TabGroupNavBackground = 'faint' | 'medium' | 'bold' | 'strong' | 'always-dark' | 'navigation';
|
|
4
4
|
export declare class TabGroupNav {
|
|
5
5
|
el: HTMLElement;
|
|
6
6
|
value: string;
|
|
@@ -8,7 +8,8 @@ import { HTMLStencilElement, JSXBase } from "./stencil-public-runtime";
|
|
|
8
8
|
import { AccordionItemData } from "./components/Accordion/Accordion";
|
|
9
9
|
import { BadgeSurface, BadgeVariant } from "./components/Badge/Badge";
|
|
10
10
|
import { BannerContrast, BannerIntent } from "./components/Banner/Banner";
|
|
11
|
-
import { BarNavActionItem,
|
|
11
|
+
import { BarNavActionItem, BarNavTab } from "./components/BarNav/bar-nav-types";
|
|
12
|
+
import { NavChromeStyle } from "./nav/nav-chrome";
|
|
12
13
|
import { BarNavActionBackground } from "./components/BarNavAction/BarNavAction";
|
|
13
14
|
import { BreadcrumbItem } from "./components/Breadcrumb/Breadcrumb";
|
|
14
15
|
import { ButtonBackground, ButtonContrast, ButtonElevation, ButtonIntent, ButtonSize, ButtonVariant } from "./components/Button/Button";
|
|
@@ -23,7 +24,7 @@ import { IconColor, IconSize } from "./components/Icon/Icon";
|
|
|
23
24
|
import { InputType } from "./components/Input/Input";
|
|
24
25
|
import { MenuAlign, MenuItemData, MenuSection, MenuSide } from "./components/Menu/Menu";
|
|
25
26
|
import { ModalWidth } from "./components/Modal/Modal";
|
|
26
|
-
import { PanelNavGroup, PanelNavRouterMode
|
|
27
|
+
import { PanelNavGroup, PanelNavRouterMode } from "./components/PanelNav/panel-nav-types";
|
|
27
28
|
import { RadioOption } from "./components/RadioGroup/RadioGroup";
|
|
28
29
|
import { ScrollbarVariant } from "./components/Scrollbar/Scrollbar";
|
|
29
30
|
import { SelectOption } from "./components/Select/Select";
|
|
@@ -43,7 +44,8 @@ import { TooltipAlign, TooltipSide } from "./components/Tooltip/Tooltip";
|
|
|
43
44
|
export { AccordionItemData } from "./components/Accordion/Accordion";
|
|
44
45
|
export { BadgeSurface, BadgeVariant } from "./components/Badge/Badge";
|
|
45
46
|
export { BannerContrast, BannerIntent } from "./components/Banner/Banner";
|
|
46
|
-
export { BarNavActionItem,
|
|
47
|
+
export { BarNavActionItem, BarNavTab } from "./components/BarNav/bar-nav-types";
|
|
48
|
+
export { NavChromeStyle } from "./nav/nav-chrome";
|
|
47
49
|
export { BarNavActionBackground } from "./components/BarNavAction/BarNavAction";
|
|
48
50
|
export { BreadcrumbItem } from "./components/Breadcrumb/Breadcrumb";
|
|
49
51
|
export { ButtonBackground, ButtonContrast, ButtonElevation, ButtonIntent, ButtonSize, ButtonVariant } from "./components/Button/Button";
|
|
@@ -58,7 +60,7 @@ export { IconColor, IconSize } from "./components/Icon/Icon";
|
|
|
58
60
|
export { InputType } from "./components/Input/Input";
|
|
59
61
|
export { MenuAlign, MenuItemData, MenuSection, MenuSide } from "./components/Menu/Menu";
|
|
60
62
|
export { ModalWidth } from "./components/Modal/Modal";
|
|
61
|
-
export { PanelNavGroup, PanelNavRouterMode
|
|
63
|
+
export { PanelNavGroup, PanelNavRouterMode } from "./components/PanelNav/panel-nav-types";
|
|
62
64
|
export { RadioOption } from "./components/RadioGroup/RadioGroup";
|
|
63
65
|
export { ScrollbarVariant } from "./components/Scrollbar/Scrollbar";
|
|
64
66
|
export { SelectOption } from "./components/Select/Select";
|
|
@@ -169,11 +171,6 @@ export namespace Components {
|
|
|
169
171
|
* @default ''
|
|
170
172
|
*/
|
|
171
173
|
"actionsJson": string;
|
|
172
|
-
/**
|
|
173
|
-
* Surface background variant.
|
|
174
|
-
* @default 'secondary'
|
|
175
|
-
*/
|
|
176
|
-
"background": BarNavBackground;
|
|
177
174
|
/**
|
|
178
175
|
* Section base path (e.g. `/dashboard/safety`). Used with `currentUrl` to derive `value`.
|
|
179
176
|
* @default ''
|
|
@@ -188,6 +185,11 @@ export namespace Components {
|
|
|
188
185
|
* Fallback heading shown when no tabs are provided. When tabs are present the heading is hidden.
|
|
189
186
|
*/
|
|
190
187
|
"heading": string | undefined;
|
|
188
|
+
/**
|
|
189
|
+
* Chrome style: `navigation` = navigation tokens, `default` = app tokens. Property: `navStyle`. HTML attribute: `nav-style`.
|
|
190
|
+
* @default 'default'
|
|
191
|
+
*/
|
|
192
|
+
"navStyle": NavChromeStyle;
|
|
191
193
|
/**
|
|
192
194
|
* Tab items for the left section. Set via JS property: `el.tabs = [...]`. Replace the array reference to update.
|
|
193
195
|
* @default []
|
|
@@ -619,7 +621,7 @@ export namespace Components {
|
|
|
619
621
|
*/
|
|
620
622
|
"currentUrl": string;
|
|
621
623
|
/**
|
|
622
|
-
* When `true`, the component does not run its own View Transition on
|
|
624
|
+
* When `true`, the component does not run its own View Transition on style change — it just updates the rendered surface synchronously. Use this when the host app orchestrates the page transition itself (e.g. Angular Router's `withViewTransitions`), so the two don't fight or nest.
|
|
623
625
|
* @default false
|
|
624
626
|
*/
|
|
625
627
|
"disableViewTransition": boolean;
|
|
@@ -628,6 +630,11 @@ export namespace Components {
|
|
|
628
630
|
* @default '[]'
|
|
629
631
|
*/
|
|
630
632
|
"groups": string | PanelNavGroup[];
|
|
633
|
+
/**
|
|
634
|
+
* Chrome style: `navigation` = navigation tokens, `default` = standard app tokens. Property: `navStyle`. HTML attribute: `nav-style`.
|
|
635
|
+
* @default 'navigation'
|
|
636
|
+
*/
|
|
637
|
+
"navStyle": NavChromeStyle;
|
|
631
638
|
/**
|
|
632
639
|
* How items with `href` render: - `anchor` (default): native `<a href>` — works with routers that intercept anchors. - `event`: always `<button>`; host handles navigation via `dsNavSelect`.
|
|
633
640
|
* @default 'anchor'
|
|
@@ -648,11 +655,6 @@ export namespace Components {
|
|
|
648
655
|
* @default ''
|
|
649
656
|
*/
|
|
650
657
|
"userName": string;
|
|
651
|
-
/**
|
|
652
|
-
* Visual variant: `dashboard` = always-dark surface, `settings` = light surface
|
|
653
|
-
* @default 'dashboard'
|
|
654
|
-
*/
|
|
655
|
-
"variant": PanelNavVariant;
|
|
656
658
|
}
|
|
657
659
|
interface DsRadioGroup {
|
|
658
660
|
"ariaLabel": string | undefined;
|
|
@@ -1808,11 +1810,6 @@ declare namespace LocalJSX {
|
|
|
1808
1810
|
* @default ''
|
|
1809
1811
|
*/
|
|
1810
1812
|
"actionsJson"?: string;
|
|
1811
|
-
/**
|
|
1812
|
-
* Surface background variant.
|
|
1813
|
-
* @default 'secondary'
|
|
1814
|
-
*/
|
|
1815
|
-
"background"?: BarNavBackground;
|
|
1816
1813
|
/**
|
|
1817
1814
|
* Section base path (e.g. `/dashboard/safety`). Used with `currentUrl` to derive `value`.
|
|
1818
1815
|
* @default ''
|
|
@@ -1827,6 +1824,11 @@ declare namespace LocalJSX {
|
|
|
1827
1824
|
* Fallback heading shown when no tabs are provided. When tabs are present the heading is hidden.
|
|
1828
1825
|
*/
|
|
1829
1826
|
"heading"?: string | undefined;
|
|
1827
|
+
/**
|
|
1828
|
+
* Chrome style: `navigation` = navigation tokens, `default` = app tokens. Property: `navStyle`. HTML attribute: `nav-style`.
|
|
1829
|
+
* @default 'default'
|
|
1830
|
+
*/
|
|
1831
|
+
"navStyle"?: NavChromeStyle;
|
|
1830
1832
|
/**
|
|
1831
1833
|
* Emitted when an action button is toggled. Detail = { id, selected }.
|
|
1832
1834
|
*/
|
|
@@ -2296,7 +2298,7 @@ declare namespace LocalJSX {
|
|
|
2296
2298
|
*/
|
|
2297
2299
|
"currentUrl"?: string;
|
|
2298
2300
|
/**
|
|
2299
|
-
* When `true`, the component does not run its own View Transition on
|
|
2301
|
+
* When `true`, the component does not run its own View Transition on style change — it just updates the rendered surface synchronously. Use this when the host app orchestrates the page transition itself (e.g. Angular Router's `withViewTransitions`), so the two don't fight or nest.
|
|
2300
2302
|
* @default false
|
|
2301
2303
|
*/
|
|
2302
2304
|
"disableViewTransition"?: boolean;
|
|
@@ -2305,6 +2307,11 @@ declare namespace LocalJSX {
|
|
|
2305
2307
|
* @default '[]'
|
|
2306
2308
|
*/
|
|
2307
2309
|
"groups"?: string | PanelNavGroup[];
|
|
2310
|
+
/**
|
|
2311
|
+
* Chrome style: `navigation` = navigation tokens, `default` = standard app tokens. Property: `navStyle`. HTML attribute: `nav-style`.
|
|
2312
|
+
* @default 'navigation'
|
|
2313
|
+
*/
|
|
2314
|
+
"navStyle"?: NavChromeStyle;
|
|
2308
2315
|
/**
|
|
2309
2316
|
* Emitted when the footer left button (gear / dashboard) is clicked.
|
|
2310
2317
|
*/
|
|
@@ -2341,11 +2348,6 @@ declare namespace LocalJSX {
|
|
|
2341
2348
|
* @default ''
|
|
2342
2349
|
*/
|
|
2343
2350
|
"userName"?: string;
|
|
2344
|
-
/**
|
|
2345
|
-
* Visual variant: `dashboard` = always-dark surface, `settings` = light surface
|
|
2346
|
-
* @default 'dashboard'
|
|
2347
|
-
*/
|
|
2348
|
-
"variant"?: PanelNavVariant;
|
|
2349
2351
|
}
|
|
2350
2352
|
interface DsRadioGroup {
|
|
2351
2353
|
"ariaLabel"?: string | undefined;
|
|
@@ -2795,7 +2797,7 @@ declare namespace LocalJSX {
|
|
|
2795
2797
|
"value": string;
|
|
2796
2798
|
"actionsJson": string;
|
|
2797
2799
|
"heading": string | undefined;
|
|
2798
|
-
"
|
|
2800
|
+
"navStyle": NavChromeStyle;
|
|
2799
2801
|
"basePath": string;
|
|
2800
2802
|
"currentUrl": string;
|
|
2801
2803
|
}
|
|
@@ -2933,7 +2935,7 @@ declare namespace LocalJSX {
|
|
|
2933
2935
|
"inactive": boolean;
|
|
2934
2936
|
}
|
|
2935
2937
|
interface DsPanelNavAttributes {
|
|
2936
|
-
"
|
|
2938
|
+
"navStyle": NavChromeStyle;
|
|
2937
2939
|
"disableViewTransition": boolean;
|
|
2938
2940
|
"groups": string | PanelNavGroup[];
|
|
2939
2941
|
"routerMode": PanelNavRouterMode;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export type { NavChromeStyle } from './nav-chrome';
|
|
2
|
+
export { NAV_STYLE_HINT_ATTR, readNavStyleAttr, setNavStyleHint, clearNavStyleHint, resolveNavChromeStyle, shouldResyncNavChromeStyle, } from './nav-chrome';
|
|
3
|
+
export { SHELL_BAR_NAV_VT_NAME, parseCssTimeMs, ensureShellNavVtStyle, resolveShellNavRevealOrigin, setShellNavRevealOriginVars, animateShellNavRadialReveal, runShellNavStyleRevealOnReady, } from './shell-view-transition';
|
|
4
|
+
export type { ShellNavRevealOrigin } from './shell-view-transition';
|
|
5
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/** Visual chrome family for primary/secondary navigation surfaces. */
|
|
2
|
+
export type NavChromeStyle = 'navigation' | 'default';
|
|
3
|
+
/** `document.documentElement` attribute for pre-bootstrap style hints (SPA hard reload). */
|
|
4
|
+
export declare const NAV_STYLE_HINT_ATTR = "data-nav-style";
|
|
5
|
+
/** Parse `nav-style` from a host or document hint attribute value. */
|
|
6
|
+
export declare function readNavStyleAttr(attr: string | null): NavChromeStyle | undefined;
|
|
7
|
+
/** Set a document-level style hint before nav custom elements upgrade (hard reload). */
|
|
8
|
+
export declare function setNavStyleHint(style: NavChromeStyle): void;
|
|
9
|
+
export declare function clearNavStyleHint(): void;
|
|
10
|
+
/** Resolve initial nav chrome style — host attr, then document hint, then prop default. */
|
|
11
|
+
export declare function resolveNavChromeStyle(styleProp: NavChromeStyle, styleAttr: string | null, documentStyleAttr?: string | null): NavChromeStyle;
|
|
12
|
+
/** True when internal rendered surface lags the host `style` prop. */
|
|
13
|
+
export declare function shouldResyncNavChromeStyle(renderedStyle: NavChromeStyle, style: NavChromeStyle): boolean;
|
|
14
|
+
//# sourceMappingURL=nav-chrome.d.ts.map
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/** `view-transition-name` on `ds-bar-nav` — pairs with root reveal in shell apps. */
|
|
2
|
+
export declare const SHELL_BAR_NAV_VT_NAME = "ds-shell-bar-nav";
|
|
3
|
+
/** Parse a CSS <time> value to milliseconds. */
|
|
4
|
+
export declare function parseCssTimeMs(value: string, fallback: number): number;
|
|
5
|
+
/** Suppress default cross-fade and pin new snapshots to a 0px circle for WAAPI reveal. */
|
|
6
|
+
export declare function ensureShellNavVtStyle(): void;
|
|
7
|
+
export interface ShellNavRevealOrigin {
|
|
8
|
+
x: number;
|
|
9
|
+
y: number;
|
|
10
|
+
maxRadius: number;
|
|
11
|
+
}
|
|
12
|
+
/** Origin for the radial reveal — defaults to panel-nav footer gear, then viewport center. */
|
|
13
|
+
export declare function resolveShellNavRevealOrigin(originEl?: HTMLElement | null): ShellNavRevealOrigin;
|
|
14
|
+
export declare function setShellNavRevealOriginVars(origin: ShellNavRevealOrigin): void;
|
|
15
|
+
/** Animate root + bar-nav snapshots with the same radial clip-path reveal. */
|
|
16
|
+
export declare function animateShellNavRadialReveal(origin: ShellNavRevealOrigin, durationMs?: number): void;
|
|
17
|
+
/** Run radial reveal when a view transition's `ready` promise settles (app/router driver). */
|
|
18
|
+
export declare function runShellNavStyleRevealOnReady(transition: {
|
|
19
|
+
ready: Promise<void>;
|
|
20
|
+
}, originEl?: HTMLElement | null): void;
|
|
21
|
+
//# sourceMappingURL=shell-view-transition.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ds-mo/ui",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.0",
|
|
4
4
|
"description": "CompoMo — composable web components styled with TokoMo design tokens",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"web-components",
|
|
@@ -41,6 +41,10 @@
|
|
|
41
41
|
"types": "./src/wc/components.d.ts",
|
|
42
42
|
"import": "./dist/components/index.js"
|
|
43
43
|
},
|
|
44
|
+
"./nav": {
|
|
45
|
+
"types": "./src/wc/nav/index.ts",
|
|
46
|
+
"import": "./src/wc/nav/index.ts"
|
|
47
|
+
},
|
|
44
48
|
"./dist/components/*": "./dist/components/*"
|
|
45
49
|
},
|
|
46
50
|
"files": [
|
|
@@ -50,6 +54,7 @@
|
|
|
50
54
|
"src/wc/components/**/*.tsx",
|
|
51
55
|
"!src/wc/components/**/*.stories.ts",
|
|
52
56
|
"!src/wc/components/**/*.stories.tsx",
|
|
57
|
+
"src/wc/nav",
|
|
53
58
|
"src/angular",
|
|
54
59
|
"src/react"
|
|
55
60
|
],
|
|
@@ -58,7 +63,7 @@
|
|
|
58
63
|
"pretypecheck": "node scripts/generate-icon-catalog.mjs",
|
|
59
64
|
"pretest": "node scripts/generate-icon-catalog.mjs",
|
|
60
65
|
"build": "stencil build && node scripts/patch-index-types.mjs && node scripts/verify-icons-externalized.mjs",
|
|
61
|
-
"test": "node --import tsx/esm --test tests/panel-nav-utils.test.ts tests/bar-nav-utils.test.ts tests/bar-nav-tabs-menu-utils.test.ts tests/bar-nav-dom-utils.test.ts tests/icon-catalog.test.ts",
|
|
66
|
+
"test": "node --import tsx/esm --test tests/panel-nav-utils.test.ts tests/shell-view-transition.test.ts tests/bar-nav-utils.test.ts tests/bar-nav-tabs-menu-utils.test.ts tests/bar-nav-dom-utils.test.ts tests/icon-catalog.test.ts",
|
|
62
67
|
"test:e2e": "npm run build && playwright test",
|
|
63
68
|
"test:e2e:install": "playwright install chromium",
|
|
64
69
|
"build:docs": "stencil build --docs",
|
package/src/angular/proxies.ts
CHANGED
|
@@ -87,14 +87,14 @@ export declare interface DsBanner extends Components.DsBanner {
|
|
|
87
87
|
|
|
88
88
|
|
|
89
89
|
@ProxyCmp({
|
|
90
|
-
inputs: ['actions', 'actionsJson', '
|
|
90
|
+
inputs: ['actions', 'actionsJson', 'basePath', 'currentUrl', 'heading', 'navStyle', 'tabs', 'tabsJson', 'value']
|
|
91
91
|
})
|
|
92
92
|
@Component({
|
|
93
93
|
selector: 'ds-bar-nav',
|
|
94
94
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
95
95
|
template: '<ng-content></ng-content>',
|
|
96
96
|
// eslint-disable-next-line @angular-eslint/no-inputs-metadata-property
|
|
97
|
-
inputs: ['actions', 'actionsJson', '
|
|
97
|
+
inputs: ['actions', 'actionsJson', 'basePath', 'currentUrl', 'heading', 'navStyle', 'tabs', 'tabsJson', 'value'],
|
|
98
98
|
outputs: ['dsTabChange', 'dsActionChange'],
|
|
99
99
|
standalone: false
|
|
100
100
|
})
|
|
@@ -619,14 +619,14 @@ export declare interface DsPagination extends Components.DsPagination {
|
|
|
619
619
|
|
|
620
620
|
|
|
621
621
|
@ProxyCmp({
|
|
622
|
-
inputs: ['activeId', 'breakpoint', 'collapsed', 'currentUrl', 'disableViewTransition', 'groups', 'routerMode', 'storageKey', 'userInitial', 'userName'
|
|
622
|
+
inputs: ['activeId', 'breakpoint', 'collapsed', 'currentUrl', 'disableViewTransition', 'groups', 'navStyle', 'routerMode', 'storageKey', 'userInitial', 'userName']
|
|
623
623
|
})
|
|
624
624
|
@Component({
|
|
625
625
|
selector: 'ds-panel-nav',
|
|
626
626
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
627
627
|
template: '<ng-content></ng-content>',
|
|
628
628
|
// eslint-disable-next-line @angular-eslint/no-inputs-metadata-property
|
|
629
|
-
inputs: ['activeId', 'breakpoint', 'collapsed', 'currentUrl', 'disableViewTransition', 'groups', 'routerMode', 'storageKey', 'userInitial', 'userName'
|
|
629
|
+
inputs: ['activeId', 'breakpoint', 'collapsed', 'currentUrl', 'disableViewTransition', 'groups', 'navStyle', 'routerMode', 'storageKey', 'userInitial', 'userName'],
|
|
630
630
|
outputs: ['dsNavSelect', 'dsNavToggle', 'dsNavFooterAction', 'dsNavUserAction'],
|
|
631
631
|
standalone: false
|
|
632
632
|
})
|
|
@@ -10,7 +10,9 @@ import {
|
|
|
10
10
|
} from '@stencil/core';
|
|
11
11
|
import type { MenuItemData } from '../Menu/Menu';
|
|
12
12
|
import type { BarNavActionBackground } from '../BarNavAction/BarNavAction';
|
|
13
|
-
import type {
|
|
13
|
+
import type { NavChromeStyle } from '../../nav/nav-chrome';
|
|
14
|
+
import { SHELL_BAR_NAV_VT_NAME } from '../../nav/shell-view-transition';
|
|
15
|
+
import type { BarNavActionItem, BarNavTab } from './bar-nav-types';
|
|
14
16
|
import {
|
|
15
17
|
deriveBarNavValueFromUrl,
|
|
16
18
|
parseJsonArrayProp,
|
|
@@ -28,23 +30,6 @@ import {
|
|
|
28
30
|
tabsToMenuSections,
|
|
29
31
|
} from './bar-nav-tabs-menu-utils';
|
|
30
32
|
|
|
31
|
-
export type BarNavBackground = 'primary' | 'secondary' | 'transparent' | 'translucent';
|
|
32
|
-
|
|
33
|
-
/** Same shape as `TabItem` — supports `{ type: 'divider' }` between tab groups. */
|
|
34
|
-
export type BarNavTab = TabItem;
|
|
35
|
-
|
|
36
|
-
export interface BarNavActionItem {
|
|
37
|
-
id: string;
|
|
38
|
-
/** Icon name for <ds-icon>. */
|
|
39
|
-
icon: string;
|
|
40
|
-
/** Whether this action button is currently pressed/active. */
|
|
41
|
-
selected?: boolean;
|
|
42
|
-
/** Show a notification dot. */
|
|
43
|
-
dot?: boolean;
|
|
44
|
-
inactive?: boolean;
|
|
45
|
-
ariaLabel?: string;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
33
|
@Component({
|
|
49
34
|
tag: 'ds-bar-nav',
|
|
50
35
|
styleUrl: 'BarNav.css',
|
|
@@ -78,8 +63,9 @@ export class BarNav {
|
|
|
78
63
|
*/
|
|
79
64
|
@Prop() heading: string | undefined;
|
|
80
65
|
|
|
81
|
-
/**
|
|
82
|
-
|
|
66
|
+
/** Chrome style: `navigation` = navigation tokens, `default` = app tokens.
|
|
67
|
+
* Property: `navStyle`. HTML attribute: `nav-style`. */
|
|
68
|
+
@Prop({ attribute: 'nav-style', reflect: true }) navStyle: NavChromeStyle = 'default';
|
|
83
69
|
|
|
84
70
|
/** Section base path (e.g. `/dashboard/safety`). Used with `currentUrl` to derive `value`. */
|
|
85
71
|
@Prop() basePath: string = '';
|
|
@@ -455,20 +441,24 @@ export class BarNav {
|
|
|
455
441
|
}
|
|
456
442
|
}
|
|
457
443
|
|
|
444
|
+
private get tabSurface(): BarNavActionBackground | undefined {
|
|
445
|
+
return this.navStyle === 'navigation' ? 'navigation' : undefined;
|
|
446
|
+
}
|
|
447
|
+
|
|
458
448
|
render() {
|
|
459
449
|
const hasTabs = this.resolvedTabs.length > 0 && !this.hideTabsForDetailRoute;
|
|
460
|
-
|
|
461
|
-
const bgToActionBg: Partial<Record<BarNavBackground, BarNavActionBackground>> = {};
|
|
462
|
-
const actionBg: BarNavActionBackground | undefined = bgToActionBg[this.background];
|
|
450
|
+
const tabSurface = this.tabSurface;
|
|
463
451
|
|
|
464
452
|
return (
|
|
465
453
|
<Host>
|
|
466
454
|
<header
|
|
467
455
|
class={{
|
|
468
456
|
'bar-nav': true,
|
|
469
|
-
|
|
457
|
+
'bar-nav--navigation': this.navStyle === 'navigation',
|
|
458
|
+
'bar-nav--default': this.navStyle === 'default',
|
|
470
459
|
'bar-nav--tabs-collapsed': hasTabs && this.tabsCollapsed,
|
|
471
460
|
}}
|
|
461
|
+
style={{ viewTransitionName: SHELL_BAR_NAV_VT_NAME }}
|
|
472
462
|
ref={el => {
|
|
473
463
|
this.headerEl = el as HTMLElement;
|
|
474
464
|
if (el && !this.resizeObserver) {
|
|
@@ -488,6 +478,7 @@ export class BarNav {
|
|
|
488
478
|
}}
|
|
489
479
|
tabs={this.resolvedTabs}
|
|
490
480
|
value={this.effectiveValue}
|
|
481
|
+
background={tabSurface}
|
|
491
482
|
/>
|
|
492
483
|
</div>
|
|
493
484
|
)}
|
|
@@ -501,6 +492,7 @@ export class BarNav {
|
|
|
501
492
|
}}
|
|
502
493
|
tabs={this.resolvedTabs}
|
|
503
494
|
value={this.effectiveValue}
|
|
495
|
+
background={tabSurface}
|
|
504
496
|
onDsChange={(e: Event) => this.handleTabChange(e)}
|
|
505
497
|
/>
|
|
506
498
|
</div>
|
|
@@ -554,7 +546,7 @@ export class BarNav {
|
|
|
554
546
|
<ds-badge
|
|
555
547
|
class="bar-nav__tab-trigger-dot"
|
|
556
548
|
variant="dot"
|
|
557
|
-
background="var(--
|
|
549
|
+
background="var(--_bar-nav-bg)"
|
|
558
550
|
label=""
|
|
559
551
|
aria-hidden="true"
|
|
560
552
|
/>
|
|
@@ -583,7 +575,7 @@ export class BarNav {
|
|
|
583
575
|
dot={action.dot ?? false}
|
|
584
576
|
inactive={action.inactive}
|
|
585
577
|
aria-label={action.ariaLabel ?? action.id}
|
|
586
|
-
background={
|
|
578
|
+
background={tabSurface}
|
|
587
579
|
onDsChange={(e: Event) => this.handleActionChange(action.id, e)}
|
|
588
580
|
/>
|
|
589
581
|
))}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { TabItem } from '../TabGroup/tab-item-utils';
|
|
2
|
+
|
|
3
|
+
export type BarNavTab = TabItem;
|
|
4
|
+
|
|
5
|
+
export interface BarNavActionItem {
|
|
6
|
+
id: string;
|
|
7
|
+
/** Icon name for <ds-icon>. */
|
|
8
|
+
icon: string;
|
|
9
|
+
/** Whether this action button is currently pressed/active. */
|
|
10
|
+
selected?: boolean;
|
|
11
|
+
/** Show a notification dot. */
|
|
12
|
+
dot?: boolean;
|
|
13
|
+
inactive?: boolean;
|
|
14
|
+
ariaLabel?: string;
|
|
15
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getSelectableTabs } from '../TabGroup/tab-item-utils';
|
|
2
|
-
import type { BarNavActionItem, BarNavTab } from './
|
|
2
|
+
import type { BarNavActionItem, BarNavTab } from './bar-nav-types';
|
|
3
3
|
|
|
4
4
|
export interface BarNavUrlState {
|
|
5
5
|
/** Tab id derived from the URL, or empty when none applies. */
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export type {
|
|
1
|
+
export type { BarNavTab, BarNavActionItem } from './bar-nav-types';
|
|
2
|
+
export type { NavChromeStyle } from '../../nav/nav-chrome';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Component, Prop, Event, EventEmitter, h, Host } from '@stencil/core';
|
|
2
2
|
|
|
3
|
-
export type BarNavActionBackground = 'faint' | 'medium' | 'bold' | 'strong' | 'always-dark';
|
|
3
|
+
export type BarNavActionBackground = 'faint' | 'medium' | 'bold' | 'strong' | 'always-dark' | 'navigation';
|
|
4
4
|
|
|
5
5
|
@Component({
|
|
6
6
|
tag: 'ds-bar-nav-action',
|
|
@@ -44,6 +44,7 @@ export class BarNavAction {
|
|
|
44
44
|
onBold: bg === 'bold',
|
|
45
45
|
onStrong: bg === 'strong',
|
|
46
46
|
onAlwaysDark: bg === 'always-dark',
|
|
47
|
+
onNavigation: bg === 'navigation',
|
|
47
48
|
};
|
|
48
49
|
|
|
49
50
|
return (
|