@ds-mo/ui 1.2.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/README.md +82 -2
- package/dist/components/ds-badge.js +1 -1
- package/dist/components/ds-badge.js.map +1 -1
- package/dist/components/ds-banner.js +1 -1
- package/dist/components/ds-banner.js.map +1 -1
- 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.d.ts +11 -0
- package/dist/components/ds-chip.js +2 -0
- package/dist/components/ds-chip.js.map +1 -0
- 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-fade.js.map +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-modal.js.map +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-sidebar.js +1 -1
- package/dist/components/ds-sidebar.js.map +1 -1
- package/dist/components/ds-slider.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-tab-group.js.map +1 -1
- package/dist/components/ds-table.js +1 -1
- package/dist/components/ds-tag.js +1 -1
- package/dist/components/ds-tag.js.map +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-toggle.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-B_enucPQ.js +2 -0
- package/dist/components/p-B_enucPQ.js.map +1 -0
- package/dist/components/{p-Cj00JkJb.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-H89PzqGU.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-_LI2ymhS.js +2 -0
- package/dist/components/p-_LI2ymhS.js.map +1 -0
- package/dist/components/{p-CE5zeV1w.js → p-uMN1Ppw2.js} +2 -2
- package/dist/components/p-vW9EMP8s.js +2 -0
- package/dist/components/p-vW9EMP8s.js.map +1 -0
- package/dist/types/components/Badge/Badge.d.ts +20 -0
- package/dist/types/components/Badge/index.d.ts +2 -0
- 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/components/Chip/Chip.d.ts +30 -0
- package/dist/types/components/Chip/index.d.ts +2 -0
- package/dist/types/components/Fade/Fade.d.ts +25 -0
- package/dist/types/components/Fade/index.d.ts +2 -0
- 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/Tag/Tag.d.ts +15 -0
- package/dist/types/components/Tag/index.d.ts +2 -0
- package/dist/types/components.d.ts +256 -108
- 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 +18 -6
- package/src/angular/index.ts +1 -0
- package/src/angular/proxies.ts +51 -28
- package/src/react/components.ts +1 -0
- package/src/react/ds-chip.ts +35 -0
- package/src/react/ds-tag.ts +3 -12
- package/src/wc/components/Badge/Badge.tsx +58 -8
- package/src/wc/components/Badge/index.ts +1 -1
- package/src/wc/components/Banner/Banner.tsx +2 -2
- package/src/wc/components/BarNav/BarNav.tsx +24 -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 +11 -2
- package/src/wc/components/Chip/Chip.tsx +127 -0
- package/src/wc/components/Chip/index.ts +1 -0
- package/src/wc/components/Fade/Fade.tsx +86 -6
- package/src/wc/components/Fade/index.ts +1 -1
- package/src/wc/components/PanelNav/PanelNav.tsx +63 -91
- 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/TabGroup/TabGroup.tsx +9 -1
- package/src/wc/components/TabGroupNav/TabGroupNav.tsx +17 -3
- package/src/wc/components/Tag/Tag.tsx +3 -70
- package/src/wc/components/Tag/index.ts +1 -1
- package/src/wc/components.d.ts +256 -108
- 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-CQQe6VNo.js +0 -2
- package/dist/components/p-CQQe6VNo.js.map +0 -1
- package/dist/components/p-Vwlmhl4E.js +0 -2
- package/dist/components/p-Vwlmhl4E.js.map +0 -1
- package/dist/types/.stencil/Badge/Badge.d.ts +0 -8
- package/dist/types/.stencil/Badge/index.d.ts +0 -2
- package/dist/types/.stencil/BarNav/index.d.ts +0 -2
- package/dist/types/.stencil/Fade/Fade.d.ts +0 -10
- package/dist/types/.stencil/Fade/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/types/.stencil/Tag/Tag.d.ts +0 -32
- package/dist/types/.stencil/Tag/index.d.ts +0 -2
- /package/dist/components/{p-COsKOwZR.js.map → p--YDw8Q4o.js.map} +0 -0
- /package/dist/components/{p-Cj00JkJb.js.map → p-C9za7IDu.js.map} +0 -0
- /package/dist/components/{p-H89PzqGU.js.map → p-DqBCQRRd.js.map} +0 -0
- /package/dist/components/{p-CE5zeV1w.js.map → p-uMN1Ppw2.js.map} +0 -0
- /package/dist/types/{.stencil → components}/Accordion/Accordion.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}/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}/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}/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
|
@@ -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,18 +63,24 @@
|
|
|
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",
|
|
65
|
-
"dev": "node scripts/generate-icon-catalog.mjs && stencil build --
|
|
66
|
-
"storybook": "
|
|
70
|
+
"dev": "node scripts/generate-icon-catalog.mjs && stencil build --watch",
|
|
71
|
+
"storybook:ui": "storybook dev -p 6006 --no-open",
|
|
72
|
+
"storybook": "node scripts/storybook-dev.mjs",
|
|
67
73
|
"storybook:build": "storybook build",
|
|
68
74
|
"clean": "rm -rf dist",
|
|
69
75
|
"typecheck": "tsc --noEmit",
|
|
70
76
|
"lint": "eslint src/",
|
|
71
77
|
"registry:build": "node scripts/build-registry.mjs",
|
|
72
|
-
"mcp": "node scripts/mcp-server.mjs"
|
|
78
|
+
"mcp": "node scripts/mcp-server.mjs",
|
|
79
|
+
"figma:connect:help": "figma connect --help",
|
|
80
|
+
"figma:connect:publish:dry-run": "figma connect publish --dry-run -c figma.config.json --exit-on-unreadable-files",
|
|
81
|
+
"figma:connect:publish": "figma connect publish -c figma.config.json --exit-on-unreadable-files",
|
|
82
|
+
"figma:connect:preview": "figma connect preview -c figma.config.json",
|
|
83
|
+
"typecheck:figma": "tsc -p tsconfig.figma.json --noEmit"
|
|
73
84
|
},
|
|
74
85
|
"peerDependencies": {
|
|
75
86
|
"@ds-mo/icons": "^6.0.0",
|
|
@@ -87,8 +98,9 @@
|
|
|
87
98
|
},
|
|
88
99
|
"devDependencies": {
|
|
89
100
|
"@ds-mo/icons": "^6.0.0",
|
|
90
|
-
"@ds-mo/tokens": "^2.
|
|
101
|
+
"@ds-mo/tokens": "^2.10.0",
|
|
91
102
|
"@eslint/js": "^10.0.1",
|
|
103
|
+
"@figma/code-connect": "^1.4.8",
|
|
92
104
|
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
93
105
|
"@playwright/test": "^1.55.0",
|
|
94
106
|
"@stencil/angular-output-target": "^1.3.1",
|
package/src/angular/index.ts
CHANGED
package/src/angular/proxies.ts
CHANGED
|
@@ -36,14 +36,14 @@ export declare interface DsAccordion extends Components.DsAccordion {
|
|
|
36
36
|
|
|
37
37
|
|
|
38
38
|
@ProxyCmp({
|
|
39
|
-
inputs: ['count', 'isSelected', 'label']
|
|
39
|
+
inputs: ['background', 'count', 'isSelected', 'label', 'max', 'surface', 'variant']
|
|
40
40
|
})
|
|
41
41
|
@Component({
|
|
42
42
|
selector: 'ds-badge',
|
|
43
43
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
44
44
|
template: '<ng-content></ng-content>',
|
|
45
45
|
// eslint-disable-next-line @angular-eslint/no-inputs-metadata-property
|
|
46
|
-
inputs: ['count', 'isSelected', 'label'],
|
|
46
|
+
inputs: ['background', 'count', 'isSelected', 'label', 'max', 'surface', 'variant'],
|
|
47
47
|
standalone: false
|
|
48
48
|
})
|
|
49
49
|
export class DsBadge {
|
|
@@ -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
|
})
|
|
@@ -296,6 +296,46 @@ export declare interface DsCheckbox extends Components.DsCheckbox {
|
|
|
296
296
|
}
|
|
297
297
|
|
|
298
298
|
|
|
299
|
+
@ProxyCmp({
|
|
300
|
+
inputs: ['background', 'contrast', 'elevation', 'inactive', 'intent', 'label', 'maxWidth', 'pressed', 'removable', 'rounded', 'size']
|
|
301
|
+
})
|
|
302
|
+
@Component({
|
|
303
|
+
selector: 'ds-chip',
|
|
304
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
305
|
+
template: '<ng-content></ng-content>',
|
|
306
|
+
// eslint-disable-next-line @angular-eslint/no-inputs-metadata-property
|
|
307
|
+
inputs: ['background', 'contrast', 'elevation', 'inactive', 'intent', { name: 'label', required: true }, 'maxWidth', 'pressed', 'removable', 'rounded', 'size'],
|
|
308
|
+
outputs: ['dsRemove', 'dsClick', 'dsPressedChange'],
|
|
309
|
+
standalone: false
|
|
310
|
+
})
|
|
311
|
+
export class DsChip {
|
|
312
|
+
protected el: HTMLDsChipElement;
|
|
313
|
+
@Output() dsRemove = new EventEmitter<CustomEvent<void>>();
|
|
314
|
+
@Output() dsClick = new EventEmitter<CustomEvent<void>>();
|
|
315
|
+
@Output() dsPressedChange = new EventEmitter<CustomEvent<boolean>>();
|
|
316
|
+
constructor(c: ChangeDetectorRef, r: ElementRef, protected z: NgZone) {
|
|
317
|
+
c.detach();
|
|
318
|
+
this.el = r.nativeElement;
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
|
|
323
|
+
export declare interface DsChip extends Components.DsChip {
|
|
324
|
+
/**
|
|
325
|
+
* Fired when the remove button is clicked.
|
|
326
|
+
*/
|
|
327
|
+
dsRemove: EventEmitter<CustomEvent<void>>;
|
|
328
|
+
/**
|
|
329
|
+
* Fired when an interactive chip is clicked.
|
|
330
|
+
*/
|
|
331
|
+
dsClick: EventEmitter<CustomEvent<void>>;
|
|
332
|
+
/**
|
|
333
|
+
* Fired when the pressed state toggles.
|
|
334
|
+
*/
|
|
335
|
+
dsPressedChange: EventEmitter<CustomEvent<boolean>>;
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
|
|
299
339
|
@ProxyCmp({
|
|
300
340
|
inputs: ['inset', 'length', 'orientation', 'semantic', 'surface']
|
|
301
341
|
})
|
|
@@ -343,14 +383,14 @@ export declare interface DsEmptyState extends Components.DsEmptyState {}
|
|
|
343
383
|
|
|
344
384
|
|
|
345
385
|
@ProxyCmp({
|
|
346
|
-
inputs: ['background', 'height', 'side']
|
|
386
|
+
inputs: ['background', 'height', 'side', 'size', 'surface', 'visible']
|
|
347
387
|
})
|
|
348
388
|
@Component({
|
|
349
389
|
selector: 'ds-fade',
|
|
350
390
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
351
391
|
template: '<ng-content></ng-content>',
|
|
352
392
|
// eslint-disable-next-line @angular-eslint/no-inputs-metadata-property
|
|
353
|
-
inputs: ['background', 'height',
|
|
393
|
+
inputs: ['background', 'height', 'side', 'size', 'surface', 'visible'],
|
|
354
394
|
standalone: false
|
|
355
395
|
})
|
|
356
396
|
export class DsFade {
|
|
@@ -579,14 +619,14 @@ export declare interface DsPagination extends Components.DsPagination {
|
|
|
579
619
|
|
|
580
620
|
|
|
581
621
|
@ProxyCmp({
|
|
582
|
-
inputs: ['activeId', 'breakpoint', 'collapsed', 'currentUrl', 'disableViewTransition', 'groups', 'routerMode', 'storageKey', 'userInitial', 'userName'
|
|
622
|
+
inputs: ['activeId', 'breakpoint', 'collapsed', 'currentUrl', 'disableViewTransition', 'groups', 'navStyle', 'routerMode', 'storageKey', 'userInitial', 'userName']
|
|
583
623
|
})
|
|
584
624
|
@Component({
|
|
585
625
|
selector: 'ds-panel-nav',
|
|
586
626
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
587
627
|
template: '<ng-content></ng-content>',
|
|
588
628
|
// eslint-disable-next-line @angular-eslint/no-inputs-metadata-property
|
|
589
|
-
inputs: ['activeId', 'breakpoint', 'collapsed', 'currentUrl', 'disableViewTransition', 'groups', 'routerMode', 'storageKey', 'userInitial', 'userName'
|
|
629
|
+
inputs: ['activeId', 'breakpoint', 'collapsed', 'currentUrl', 'disableViewTransition', 'groups', 'navStyle', 'routerMode', 'storageKey', 'userInitial', 'userName'],
|
|
590
630
|
outputs: ['dsNavSelect', 'dsNavToggle', 'dsNavFooterAction', 'dsNavUserAction'],
|
|
591
631
|
standalone: false
|
|
592
632
|
})
|
|
@@ -902,22 +942,18 @@ export declare interface DsTable extends Components.DsTable {
|
|
|
902
942
|
|
|
903
943
|
|
|
904
944
|
@ProxyCmp({
|
|
905
|
-
inputs: ['
|
|
945
|
+
inputs: ['contrast', 'elevation', 'intent', 'label', 'maxWidth', 'rounded', 'size']
|
|
906
946
|
})
|
|
907
947
|
@Component({
|
|
908
948
|
selector: 'ds-tag',
|
|
909
949
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
910
950
|
template: '<ng-content></ng-content>',
|
|
911
951
|
// eslint-disable-next-line @angular-eslint/no-inputs-metadata-property
|
|
912
|
-
inputs: ['
|
|
913
|
-
outputs: ['dsRemove', 'dsClick', 'dsPressedChange'],
|
|
952
|
+
inputs: ['contrast', 'elevation', 'intent', { name: 'label', required: true }, 'maxWidth', 'rounded', 'size'],
|
|
914
953
|
standalone: false
|
|
915
954
|
})
|
|
916
955
|
export class DsTag {
|
|
917
956
|
protected el: HTMLDsTagElement;
|
|
918
|
-
@Output() dsRemove = new EventEmitter<CustomEvent<void>>();
|
|
919
|
-
@Output() dsClick = new EventEmitter<CustomEvent<void>>();
|
|
920
|
-
@Output() dsPressedChange = new EventEmitter<CustomEvent<boolean>>();
|
|
921
957
|
constructor(c: ChangeDetectorRef, r: ElementRef, protected z: NgZone) {
|
|
922
958
|
c.detach();
|
|
923
959
|
this.el = r.nativeElement;
|
|
@@ -925,20 +961,7 @@ export class DsTag {
|
|
|
925
961
|
}
|
|
926
962
|
|
|
927
963
|
|
|
928
|
-
export declare interface DsTag extends Components.DsTag {
|
|
929
|
-
/**
|
|
930
|
-
* Fired when the remove button is clicked.
|
|
931
|
-
*/
|
|
932
|
-
dsRemove: EventEmitter<CustomEvent<void>>;
|
|
933
|
-
/**
|
|
934
|
-
* Fired when an interactive tag is clicked.
|
|
935
|
-
*/
|
|
936
|
-
dsClick: EventEmitter<CustomEvent<void>>;
|
|
937
|
-
/**
|
|
938
|
-
* Fired when the pressed state toggles.
|
|
939
|
-
*/
|
|
940
|
-
dsPressedChange: EventEmitter<CustomEvent<boolean>>;
|
|
941
|
-
}
|
|
964
|
+
export declare interface DsTag extends Components.DsTag {}
|
|
942
965
|
|
|
943
966
|
|
|
944
967
|
@ProxyCmp({
|
package/src/react/components.ts
CHANGED
|
@@ -14,6 +14,7 @@ export { DsButtonGroup } from "./ds-button-group.js";
|
|
|
14
14
|
export { DsButton } from "./ds-button.js";
|
|
15
15
|
export { DsCard } from "./ds-card.js";
|
|
16
16
|
export { DsCheckbox } from "./ds-checkbox.js";
|
|
17
|
+
export { DsChip } from "./ds-chip.js";
|
|
17
18
|
export { DsDivider } from "./ds-divider.js";
|
|
18
19
|
export { DsEmptyState } from "./ds-empty-state.js";
|
|
19
20
|
export { DsFade } from "./ds-fade.js";
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* This file was automatically generated by the Stencil React Output Target.
|
|
5
|
+
* Changes to this file may cause incorrect behavior and will be lost if the code is regenerated.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
/* eslint-disable */
|
|
9
|
+
|
|
10
|
+
import type { EventName, StencilReactComponent } from '@stencil/react-output-target/runtime';
|
|
11
|
+
import { createComponent } from '@stencil/react-output-target/runtime';
|
|
12
|
+
import React from 'react';
|
|
13
|
+
|
|
14
|
+
import { type DsChipCustomEvent } from "@ds-mo/ui";
|
|
15
|
+
import type { Components } from "@ds-mo/ui/dist/components";
|
|
16
|
+
import { DsChip as DsChipElement, defineCustomElement as defineDsChip } from "@ds-mo/ui/dist/components/ds-chip.js";
|
|
17
|
+
|
|
18
|
+
export type DsChipEvents = {
|
|
19
|
+
onDsRemove: EventName<DsChipCustomEvent<void>>,
|
|
20
|
+
onDsClick: EventName<DsChipCustomEvent<void>>,
|
|
21
|
+
onDsPressedChange: EventName<DsChipCustomEvent<boolean>>
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export const DsChip: StencilReactComponent<DsChipElement, DsChipEvents, Components.DsChip> = /*@__PURE__*/ createComponent<DsChipElement, DsChipEvents, Components.DsChip>({
|
|
25
|
+
tagName: 'ds-chip',
|
|
26
|
+
elementClass: DsChipElement,
|
|
27
|
+
// @ts-ignore - ignore potential React type mismatches between the Stencil Output Target and your project.
|
|
28
|
+
react: React,
|
|
29
|
+
events: {
|
|
30
|
+
onDsRemove: 'dsRemove',
|
|
31
|
+
onDsClick: 'dsClick',
|
|
32
|
+
onDsPressedChange: 'dsPressedChange'
|
|
33
|
+
} as DsChipEvents,
|
|
34
|
+
defineCustomElement: defineDsChip
|
|
35
|
+
});
|
package/src/react/ds-tag.ts
CHANGED
|
@@ -7,29 +7,20 @@
|
|
|
7
7
|
|
|
8
8
|
/* eslint-disable */
|
|
9
9
|
|
|
10
|
-
import type {
|
|
10
|
+
import type { StencilReactComponent } from '@stencil/react-output-target/runtime';
|
|
11
11
|
import { createComponent } from '@stencil/react-output-target/runtime';
|
|
12
12
|
import React from 'react';
|
|
13
13
|
|
|
14
|
-
import { type DsTagCustomEvent } from "@ds-mo/ui";
|
|
15
14
|
import type { Components } from "@ds-mo/ui/dist/components";
|
|
16
15
|
import { DsTag as DsTagElement, defineCustomElement as defineDsTag } from "@ds-mo/ui/dist/components/ds-tag.js";
|
|
17
16
|
|
|
18
|
-
export type DsTagEvents =
|
|
19
|
-
onDsRemove: EventName<DsTagCustomEvent<void>>,
|
|
20
|
-
onDsClick: EventName<DsTagCustomEvent<void>>,
|
|
21
|
-
onDsPressedChange: EventName<DsTagCustomEvent<boolean>>
|
|
22
|
-
};
|
|
17
|
+
export type DsTagEvents = NonNullable<unknown>;
|
|
23
18
|
|
|
24
19
|
export const DsTag: StencilReactComponent<DsTagElement, DsTagEvents, Components.DsTag> = /*@__PURE__*/ createComponent<DsTagElement, DsTagEvents, Components.DsTag>({
|
|
25
20
|
tagName: 'ds-tag',
|
|
26
21
|
elementClass: DsTagElement,
|
|
27
22
|
// @ts-ignore - ignore potential React type mismatches between the Stencil Output Target and your project.
|
|
28
23
|
react: React,
|
|
29
|
-
events: {
|
|
30
|
-
onDsRemove: 'dsRemove',
|
|
31
|
-
onDsClick: 'dsClick',
|
|
32
|
-
onDsPressedChange: 'dsPressedChange'
|
|
33
|
-
} as DsTagEvents,
|
|
24
|
+
events: {} as DsTagEvents,
|
|
34
25
|
defineCustomElement: defineDsTag
|
|
35
26
|
});
|
|
@@ -1,32 +1,82 @@
|
|
|
1
1
|
import { Component, Prop, h, Host } from '@stencil/core';
|
|
2
2
|
|
|
3
|
+
export type BadgeVariant = 'counter' | 'dot';
|
|
4
|
+
export type BadgeSurface =
|
|
5
|
+
| 'default'
|
|
6
|
+
| 'primary'
|
|
7
|
+
| 'secondary'
|
|
8
|
+
| 'medium'
|
|
9
|
+
| 'bold'
|
|
10
|
+
| 'strong'
|
|
11
|
+
| 'navigation'
|
|
12
|
+
| 'always-dark';
|
|
13
|
+
|
|
14
|
+
const SURFACE_RING: Record<BadgeSurface, string> = {
|
|
15
|
+
default: 'var(--color-background-secondary)',
|
|
16
|
+
primary: 'var(--color-background-primary)',
|
|
17
|
+
secondary: 'var(--color-background-secondary)',
|
|
18
|
+
medium: 'var(--color-background-medium-neutral)',
|
|
19
|
+
bold: 'var(--color-background-bold-neutral)',
|
|
20
|
+
strong: 'var(--color-background-strong-neutral)',
|
|
21
|
+
navigation: 'var(--color-navigation-background)',
|
|
22
|
+
'always-dark': 'var(--color-always-dark-background)',
|
|
23
|
+
};
|
|
24
|
+
|
|
3
25
|
@Component({
|
|
4
26
|
tag: 'ds-badge',
|
|
5
27
|
styleUrl: 'Badge.css',
|
|
6
28
|
scoped: true,
|
|
7
29
|
})
|
|
8
30
|
export class Badge {
|
|
31
|
+
/** Render as a compact counter or notification dot. */
|
|
32
|
+
@Prop() variant: BadgeVariant = 'counter';
|
|
33
|
+
|
|
34
|
+
/** Count shown for counter badges. Count 0 hides the badge. */
|
|
9
35
|
@Prop() count: number = 0;
|
|
36
|
+
|
|
37
|
+
/** Highest count shown before compacting to "+". */
|
|
38
|
+
@Prop() max: number = 9;
|
|
39
|
+
|
|
40
|
+
/** Surface context for the ring around dots. */
|
|
41
|
+
@Prop() surface: BadgeSurface = 'default';
|
|
42
|
+
|
|
43
|
+
/** Direct ring background override for component-local surfaces. */
|
|
44
|
+
@Prop() background: string | undefined;
|
|
45
|
+
|
|
46
|
+
/** Deprecated alias for selected counter styling. Prefer context-specific color in the parent. */
|
|
10
47
|
@Prop() isSelected: boolean = false;
|
|
48
|
+
|
|
11
49
|
/** Accessible label. Defaults to the count as a string. */
|
|
12
50
|
@Prop() label: string | undefined;
|
|
13
51
|
|
|
14
52
|
render() {
|
|
15
|
-
|
|
53
|
+
const isDot = this.variant === 'dot';
|
|
54
|
+
|
|
55
|
+
if (!isDot && this.count === 0) return <Host style={{ display: 'none' }} />;
|
|
16
56
|
|
|
17
|
-
const display = this.count >
|
|
18
|
-
const ariaLabel = this.label ?? String(this.count);
|
|
57
|
+
const display = this.count > this.max ? '+' : String(this.count);
|
|
58
|
+
const ariaLabel = this.label ?? (isDot ? 'Notification' : String(this.count));
|
|
59
|
+
const ring = this.background ?? SURFACE_RING[this.surface];
|
|
19
60
|
|
|
20
61
|
return (
|
|
21
|
-
<Host
|
|
62
|
+
<Host
|
|
63
|
+
class={{
|
|
64
|
+
badge: true,
|
|
65
|
+
'badge--counter': !isDot,
|
|
66
|
+
'badge--dot': isDot,
|
|
67
|
+
'badge--selected': this.isSelected,
|
|
68
|
+
}}
|
|
69
|
+
aria-label={ariaLabel}
|
|
70
|
+
style={{ '--_badge-ring': ring }}
|
|
71
|
+
>
|
|
22
72
|
<span
|
|
23
73
|
class={{
|
|
24
|
-
'
|
|
25
|
-
'
|
|
26
|
-
'badge__text--selected': this.isSelected,
|
|
74
|
+
'badge__mark': true,
|
|
75
|
+
'text-caption-emphasis': !isDot,
|
|
27
76
|
}}
|
|
77
|
+
aria-hidden="true"
|
|
28
78
|
>
|
|
29
|
-
{display}
|
|
79
|
+
{!isDot && display}
|
|
30
80
|
</span>
|
|
31
81
|
</Host>
|
|
32
82
|
);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export type {} from './Badge';
|
|
1
|
+
export type { BadgeVariant, BadgeSurface } from './Badge';
|
|
@@ -87,8 +87,8 @@ export class Banner {
|
|
|
87
87
|
|
|
88
88
|
private getElevation(): string {
|
|
89
89
|
return this.floating
|
|
90
|
-
? 'var(--effect-elevation-elevated-floating
|
|
91
|
-
: 'var(--effect-elevation-elevated)';
|
|
90
|
+
? 'var(--effect-elevation-elevated-floating)'
|
|
91
|
+
: 'var(--effect-elevation-elevated-sm)';
|
|
92
92
|
}
|
|
93
93
|
|
|
94
94
|
render() {
|
|
@@ -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>
|
|
@@ -551,7 +543,13 @@ export class BarNav {
|
|
|
551
543
|
{this.activeTabLabel}
|
|
552
544
|
</span>
|
|
553
545
|
{this.activeTabHasDot && (
|
|
554
|
-
<
|
|
546
|
+
<ds-badge
|
|
547
|
+
class="bar-nav__tab-trigger-dot"
|
|
548
|
+
variant="dot"
|
|
549
|
+
background="var(--_bar-nav-bg)"
|
|
550
|
+
label=""
|
|
551
|
+
aria-hidden="true"
|
|
552
|
+
/>
|
|
555
553
|
)}
|
|
556
554
|
</span>
|
|
557
555
|
<ds-icon
|
|
@@ -577,7 +575,7 @@ export class BarNav {
|
|
|
577
575
|
dot={action.dot ?? false}
|
|
578
576
|
inactive={action.inactive}
|
|
579
577
|
aria-label={action.ariaLabel ?? action.id}
|
|
580
|
-
background={
|
|
578
|
+
background={tabSurface}
|
|
581
579
|
onDsChange={(e: Event) => this.handleActionChange(action.id, e)}
|
|
582
580
|
/>
|
|
583
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 (
|
|
@@ -58,7 +59,15 @@ export class BarNavAction {
|
|
|
58
59
|
>
|
|
59
60
|
<span class="action-btn__icon-wrap">
|
|
60
61
|
<ds-icon name={this.icon} size="md" color="inherit" />
|
|
61
|
-
{this.dot &&
|
|
62
|
+
{this.dot && (
|
|
63
|
+
<ds-badge
|
|
64
|
+
class="action-btn__dot"
|
|
65
|
+
variant="dot"
|
|
66
|
+
background="var(--_dot-ring)"
|
|
67
|
+
label=""
|
|
68
|
+
aria-hidden="true"
|
|
69
|
+
/>
|
|
70
|
+
)}
|
|
62
71
|
</span>
|
|
63
72
|
</button>
|
|
64
73
|
</Host>
|