dap-design-system 0.53.3 → 0.53.4

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.
@@ -277,6 +277,8 @@ export default class DapDSButton extends GenericFormElement {
277
277
  oklchPoc: boolean;
278
278
  /** The text for the target blank link, applicable when target is _blank. PRO TIP: Use parenthesis to wrap the text */
279
279
  targetBlankText: string;
280
+ /** Overrides the ARIA role on the internal native button/anchor element. Use when the host's semantics must differ from the native element (e.g. role="link" on a button acting as a SPA navigation trigger). */
281
+ forceRole?: string;
280
282
  static readonly styles: import('lit').CSSResult;
281
283
  private loadingTimer?;
282
284
  private getSecureRel;
@@ -285,6 +287,7 @@ export default class DapDSButton extends GenericFormElement {
285
287
  private validateProperties;
286
288
  private isValidUrl;
287
289
  private handleClick;
290
+ private handleKeyDown;
288
291
  private toggleHighContrast;
289
292
  private startLoadingTimeout;
290
293
  private clearLoadingTimeout;
@@ -1,4 +1,4 @@
1
- import { FloatingStrategy, PopupPlacement } from '../../common/types';
1
+ import { FloatingStrategy, LinkTarget, PopupPlacement } from '../../common/types';
2
2
  import { DdsElement } from '../../internal/dds-hu-element';
3
3
  import { SubmenuController } from './submenu-controller';
4
4
  declare const DapDSNavigationMenuItem_base: typeof DdsElement & {
@@ -15,6 +15,7 @@ declare const DapDSNavigationMenuItem_base: typeof DdsElement & {
15
15
  * @title - Navigation Menu Item
16
16
  * @group navigation-menu
17
17
  *
18
+ * @property {string} label - The label text for the navigation item. This will be displayed in the title slot if no custom title slot content is provided.
18
19
  * @property {'xs' | 'sm' | 'lg'} size - The size of the popup. Default is 'sm'.
19
20
  * @property {boolean} disabled - The disabled state of the popup. Default is false.
20
21
  * @property {boolean} opened - The open state of the popup. Default is false.
@@ -32,6 +33,9 @@ declare const DapDSNavigationMenuItem_base: typeof DdsElement & {
32
33
  * @property {string} ariaLabelledBy - The name of the element that labels the navigation dropdown.
33
34
  * @property {string} activeHref - The href of the navigation item that is active (receives aria-current="page").
34
35
  * @property {string} baseHref - The href of the navigation item. If provided, the navigation item will be active if the href is a substring of the activeHref.
36
+ * @property {string} href - The href URL for the navigation item link. When provided, the default trigger renders as a link.
37
+ * @property {'_blank' | '_self' | '_parent' | '_top'} target - The target attribute for link navigation.
38
+ * @property {string} rel - The rel attribute for link security and behavior.
35
39
  * @property {number} level - The nesting level of this navigation item (0 = top-level, automatically set for nested items). Default is 0.
36
40
  * @property {'horizontal' | 'vertical'} orientation - The orientation of the parent navigation menu (automatically inherited). Default is 'horizontal'.
37
41
  *
@@ -41,6 +45,8 @@ declare const DapDSNavigationMenuItem_base: typeof DdsElement & {
41
45
  * @slot trigger - The trigger element (link, button, etc.) for this navigation item.
42
46
  * @slot title - The title of the navigation item.
43
47
  * @slot indicator - The expand indicator icon (defaults to arrow icon based on orientation and level).
48
+ * @slot link - A router link element (e.g. Next.js Link) used for SPA navigation.
49
+ * Rendered outside the popup so it is always accessible to programmatic clicks.
44
50
  * @slot - The dropdown content (can contain nested dap-ds-navigation-menu-item elements).
45
51
  *
46
52
  * @csspart base - The base part of the navigation item.
@@ -112,23 +118,40 @@ export default class DapDSNavigationMenuItem extends DapDSNavigationMenuItem_bas
112
118
  baseHref?: string;
113
119
  /** Whether the navigation item should use exact href matching. */
114
120
  exactHref: boolean;
121
+ /** The href URL for the navigation item link. When provided, the default trigger renders as a link. */
122
+ href?: string;
123
+ /** The target attribute for link navigation. */
124
+ target?: LinkTarget;
125
+ /** The rel attribute for link security and behavior. */
126
+ rel?: string;
127
+ /** The label text for the navigation item, displayed in the title slot when no slot content is provided. */
128
+ label?: string;
115
129
  /** The nesting level of this navigation item (0 = top-level). */
116
130
  level: number;
117
131
  /** The orientation of the parent navigation menu. */
118
132
  orientation: 'horizontal' | 'vertical';
119
133
  hasContent: boolean;
134
+ private hasLink;
135
+ private hasTitleSlot;
120
136
  private active;
121
137
  private openedByHover;
122
138
  private _isRovingActive;
123
139
  /** Computed property to detect if this item contains nested navigation menu items. */
124
140
  get hasNestedItems(): boolean;
125
141
  private get _trigger();
142
+ /** Get the element slotted into the `link` slot, if any. */
143
+ private _getLinkElement;
144
+ /** Handle slot change for the `link` slot. */
145
+ private _handleLinkSlotChange;
146
+ /** Handle slot change for the `title` slot. */
147
+ private _handleTitleSlotChange;
126
148
  constructor();
127
149
  connectedCallback(): void;
128
150
  disconnectedCallback(): void;
129
151
  firstUpdated(changedProperties: Map<string, unknown>): Promise<void>;
130
152
  handleOpenedChange(): void;
131
153
  handleActiveHrefChange(): void;
154
+ handleHrefChange(): void;
132
155
  handleLayoutChange(): void;
133
156
  /** Update nested navigation menu items with current properties. */
134
157
  private _updateNestedItems;