@daffodil/design 0.91.0 → 0.92.3-rc.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.
Files changed (142) hide show
  1. package/accordion/README.md +26 -38
  2. package/accordion/index.d.ts +2 -2
  3. package/article/README.md +66 -46
  4. package/article/index.d.ts +22 -1
  5. package/article/src/article-theme.scss +12 -0
  6. package/breadcrumb/README.md +6 -1
  7. package/breadcrumb/index.d.ts +65 -11
  8. package/breadcrumb/src/breadcrumb-theme.scss +1 -1
  9. package/button/README.md +36 -33
  10. package/button/index.d.ts +26 -5
  11. package/button/src/button/basic/button-theme.scss +4 -2
  12. package/button/src/button/button-base.scss +26 -3
  13. package/button/src/button/icon/icon-theme.scss +10 -6
  14. package/button/src/button/raised/raised-theme.scss +4 -2
  15. package/callout/README.md +15 -27
  16. package/card/README.md +36 -61
  17. package/container/README.md +18 -23
  18. package/fesm2022/daffodil-design-accordion.mjs +13 -13
  19. package/fesm2022/daffodil-design-accordion.mjs.map +1 -1
  20. package/fesm2022/daffodil-design-article.mjs +168 -26
  21. package/fesm2022/daffodil-design-article.mjs.map +1 -1
  22. package/fesm2022/daffodil-design-breadcrumb.mjs +180 -28
  23. package/fesm2022/daffodil-design-breadcrumb.mjs.map +1 -1
  24. package/fesm2022/daffodil-design-button.mjs +83 -42
  25. package/fesm2022/daffodil-design-button.mjs.map +1 -1
  26. package/fesm2022/daffodil-design-callout.mjs +23 -23
  27. package/fesm2022/daffodil-design-callout.mjs.map +1 -1
  28. package/fesm2022/daffodil-design-card.mjs +33 -33
  29. package/fesm2022/daffodil-design-card.mjs.map +1 -1
  30. package/fesm2022/daffodil-design-checkbox.mjs +13 -13
  31. package/fesm2022/daffodil-design-checkbox.mjs.map +1 -1
  32. package/fesm2022/daffodil-design-container.mjs +8 -8
  33. package/fesm2022/daffodil-design-container.mjs.map +1 -1
  34. package/fesm2022/daffodil-design-form-field.mjs +26 -26
  35. package/fesm2022/daffodil-design-form-field.mjs.map +1 -1
  36. package/fesm2022/daffodil-design-form.mjs +9 -9
  37. package/fesm2022/daffodil-design-form.mjs.map +1 -1
  38. package/fesm2022/daffodil-design-hero.mjs +23 -23
  39. package/fesm2022/daffodil-design-hero.mjs.map +1 -1
  40. package/fesm2022/daffodil-design-image.mjs +8 -8
  41. package/fesm2022/daffodil-design-image.mjs.map +1 -1
  42. package/fesm2022/daffodil-design-input.mjs +18 -14
  43. package/fesm2022/daffodil-design-input.mjs.map +1 -1
  44. package/fesm2022/daffodil-design-link-set.mjs +25 -17
  45. package/fesm2022/daffodil-design-link-set.mjs.map +1 -1
  46. package/fesm2022/daffodil-design-list.mjs +16 -16
  47. package/fesm2022/daffodil-design-list.mjs.map +1 -1
  48. package/fesm2022/daffodil-design-loading-icon.mjs +8 -8
  49. package/fesm2022/daffodil-design-loading-icon.mjs.map +1 -1
  50. package/fesm2022/daffodil-design-media-gallery.mjs +13 -13
  51. package/fesm2022/daffodil-design-media-gallery.mjs.map +1 -1
  52. package/fesm2022/daffodil-design-menu.mjs +223 -60
  53. package/fesm2022/daffodil-design-menu.mjs.map +1 -1
  54. package/fesm2022/daffodil-design-modal.mjs +33 -29
  55. package/fesm2022/daffodil-design-modal.mjs.map +1 -1
  56. package/fesm2022/daffodil-design-native-select.mjs +47 -41
  57. package/fesm2022/daffodil-design-native-select.mjs.map +1 -1
  58. package/fesm2022/daffodil-design-navbar.mjs +25 -21
  59. package/fesm2022/daffodil-design-navbar.mjs.map +1 -1
  60. package/fesm2022/daffodil-design-notification.mjs +16 -16
  61. package/fesm2022/daffodil-design-notification.mjs.map +1 -1
  62. package/fesm2022/daffodil-design-paginator.mjs +7 -7
  63. package/fesm2022/daffodil-design-paginator.mjs.map +1 -1
  64. package/fesm2022/daffodil-design-progress-bar.mjs +10 -10
  65. package/fesm2022/daffodil-design-progress-bar.mjs.map +1 -1
  66. package/fesm2022/daffodil-design-quantity-field.mjs +17 -14
  67. package/fesm2022/daffodil-design-quantity-field.mjs.map +1 -1
  68. package/fesm2022/daffodil-design-radio.mjs +16 -16
  69. package/fesm2022/daffodil-design-radio.mjs.map +1 -1
  70. package/fesm2022/daffodil-design-select.mjs +6 -6
  71. package/fesm2022/daffodil-design-select.mjs.map +1 -1
  72. package/fesm2022/daffodil-design-sidebar.mjs +25 -25
  73. package/fesm2022/daffodil-design-sidebar.mjs.map +1 -1
  74. package/fesm2022/daffodil-design-spinner.mjs +99 -0
  75. package/fesm2022/daffodil-design-spinner.mjs.map +1 -0
  76. package/fesm2022/daffodil-design-switch.mjs +3 -3
  77. package/fesm2022/daffodil-design-switch.mjs.map +1 -1
  78. package/fesm2022/daffodil-design-tabs.mjs +15 -15
  79. package/fesm2022/daffodil-design-tabs.mjs.map +1 -1
  80. package/fesm2022/daffodil-design-tag.mjs +7 -7
  81. package/fesm2022/daffodil-design-tag.mjs.map +1 -1
  82. package/fesm2022/daffodil-design-text-snippet.mjs +6 -8
  83. package/fesm2022/daffodil-design-text-snippet.mjs.map +1 -1
  84. package/fesm2022/daffodil-design-textarea.mjs +6 -3
  85. package/fesm2022/daffodil-design-textarea.mjs.map +1 -1
  86. package/fesm2022/daffodil-design-toast.mjs +23 -25
  87. package/fesm2022/daffodil-design-toast.mjs.map +1 -1
  88. package/fesm2022/daffodil-design-tree.mjs +152 -103
  89. package/fesm2022/daffodil-design-tree.mjs.map +1 -1
  90. package/fesm2022/daffodil-design-youtube-player.mjs +6 -6
  91. package/fesm2022/daffodil-design-youtube-player.mjs.map +1 -1
  92. package/fesm2022/daffodil-design.mjs +385 -326
  93. package/fesm2022/daffodil-design.mjs.map +1 -1
  94. package/form-field/README.md +50 -85
  95. package/form-field/index.d.ts +11 -9
  96. package/hero/README.md +5 -5
  97. package/image/README.md +2 -2
  98. package/index.d.ts +184 -270
  99. package/input/README.md +4 -4
  100. package/input/index.d.ts +4 -3
  101. package/link-set/index.d.ts +9 -1
  102. package/list/README.md +2 -2
  103. package/loading-icon/README.md +1 -1
  104. package/loading-icon/index.d.ts +1 -1
  105. package/media-gallery/README.md +3 -3
  106. package/menu/README.md +107 -10
  107. package/menu/index.d.ts +143 -11
  108. package/modal/README.md +1 -1
  109. package/modal/index.d.ts +23 -15
  110. package/native-select/README.md +4 -4
  111. package/native-select/index.d.ts +8 -7
  112. package/navbar/README.md +23 -17
  113. package/navbar/index.d.ts +12 -2
  114. package/navbar/src/navbar-theme.scss +4 -46
  115. package/notification/README.md +4 -4
  116. package/package.json +1 -1
  117. package/paginator/README.md +42 -6
  118. package/paginator/index.d.ts +4 -2
  119. package/progress-bar/README.md +3 -3
  120. package/quantity-field/README.md +4 -4
  121. package/quantity-field/index.d.ts +4 -1
  122. package/radio/README.md +1 -1
  123. package/scss/theme.scss +7 -1
  124. package/scss/theming/_color-palettes.scss +0 -6
  125. package/select/README.md +4 -4
  126. package/sidebar/README.md +6 -6
  127. package/spinner/README.md +57 -0
  128. package/spinner/index.d.ts +53 -0
  129. package/spinner/src/spinner-theme.scss +62 -0
  130. package/switch/README.md +4 -4
  131. package/switch/index.d.ts +2 -2
  132. package/tabs/README.md +1 -1
  133. package/tabs/index.d.ts +2 -2
  134. package/tag/README.md +24 -30
  135. package/tag/index.d.ts +1 -1
  136. package/text-snippet/README.md +1 -1
  137. package/text-snippet/src/text-snippet-theme.scss +12 -0
  138. package/textarea/README.md +4 -4
  139. package/textarea/index.d.ts +4 -4
  140. package/toast/README.md +4 -4
  141. package/tree/README.md +39 -22
  142. package/tree/index.d.ts +57 -90
@@ -3,6 +3,8 @@ import * as i1 from '@daffodil/design';
3
3
  import * as i1$1 from '@angular/common';
4
4
 
5
5
  /**
6
+ * @deprecated Deprecated in version 0.92.0. Will be removed in version 0.95.0.
7
+ *
6
8
  * DaffLinkSetComponent is a component for displaying a two or more links.
7
9
  */
8
10
  declare class DaffLinkSetComponent {
@@ -15,6 +17,7 @@ declare class DaffLinkSetComponent {
15
17
  }
16
18
 
17
19
  /**
20
+ * @deprecated Deprecated in version 0.92.0. Will be removed in version 0.95.0.
18
21
  * A directive for adding a heading to a daff-link-set.
19
22
  */
20
23
  declare class DaffLinkSetHeadingDirective {
@@ -27,6 +30,8 @@ declare class DaffLinkSetHeadingDirective {
27
30
  }
28
31
 
29
32
  /**
33
+ * @deprecated Deprecated in version 0.92.0. Will be removed in version 0.95.0.
34
+ *
30
35
  * A directive for adding a subheading to a daff-link-set.
31
36
  */
32
37
  declare class DaffLinkSetSubheadingDirective {
@@ -38,6 +43,9 @@ declare class DaffLinkSetSubheadingDirective {
38
43
  static ɵdir: i0.ɵɵDirectiveDeclaration<DaffLinkSetSubheadingDirective, "[daffLinkSetSubheading]", never, {}, {}, never, never, true, never>;
39
44
  }
40
45
 
46
+ /**
47
+ * @deprecated Deprecated in version 0.92.0. Will be removed in version 0.95.0.
48
+ */
41
49
  declare class DaffLinkSetItemComponent {
42
50
  /**
43
51
  * @docs-private
@@ -48,7 +56,7 @@ declare class DaffLinkSetItemComponent {
48
56
  }
49
57
 
50
58
  /**
51
- * @deprecated in favor of {@link DAFF_LINK_SET_COMPONENTS}. Deprecated in version 0.78.0. Will be removed in version 1.0.0.
59
+ * @deprecated Deprecated in version 0.92.0. Will be removed in version 0.95.0.
52
60
  */
53
61
  declare class DaffLinkSetModule {
54
62
  static ɵfac: i0.ɵɵFactoryDeclaration<DaffLinkSetModule, never>;
package/list/README.md CHANGED
@@ -88,12 +88,12 @@ A list consists of the following components:
88
88
  ### Icon support
89
89
  Use the `[daffPrefix]` element to display a leading visual icon for a list item.
90
90
 
91
- <design-land-example-viewer-container example="icon-list"></design-land-example-viewer-container>
91
+ <daff-docs-example-viewer example="icon-list"></daff-docs-example-viewer>
92
92
 
93
93
  ### Multi-line lists
94
94
  For list items that contain multiple lines of text, use the `[daffListItemTitle]` element to identify the primary title. Additional supporting content can be added using `<div>` or `<p>` elements.
95
95
 
96
- <design-land-example-viewer-container example="multiline-list"></design-land-example-viewer-container>
96
+ <daff-docs-example-viewer example="multiline-list"></daff-docs-example-viewer>
97
97
 
98
98
  ## Accessibility
99
99
  By default, list includes appropriate ARIA roles by default to support screen readers and provide an accessible experience.
@@ -51,7 +51,7 @@ Use the `color` property to change the color of a loading icon. The default colo
51
51
 
52
52
  > `theme` and `white` should be used on a darker background in order to have sufficient contrast.
53
53
 
54
- <design-land-example-viewer-container example="loading-icon-color"></design-land-example-viewer-container>
54
+ <daff-docs-example-viewer example="loading-icon-color"></daff-docs-example-viewer>
55
55
 
56
56
  ## Accessibility
57
57
  Loading icons should be given meaningful labels by using `aria-label` or `aria-labelledby`.
@@ -3,7 +3,7 @@ import * as i1$1 from '@angular/common';
3
3
  import * as i1 from '@daffodil/design';
4
4
 
5
5
  /**
6
- * @inheritdoc
6
+ * @deprecated in favor of `DaffSpinnerComponent`. Deprecated in version 0.91.1. Will be removed in version 0.94.0.
7
7
  */
8
8
  declare class DaffLoadingIconComponent {
9
9
  /**
@@ -4,7 +4,7 @@ A media gallery displays a group of thumbnails in a gallery format, allowing use
4
4
  ## Overview
5
5
  Media galleries are ideal for showcasing multiple images or other media related to a single product or topic. They provide an interactive way to browse through content with thumbnail previews that update the primary display when selected.
6
6
 
7
- <design-land-example-viewer-container example="basic-media-gallery"></design-land-example-viewer-container>
7
+ <daff-docs-example-viewer example="basic-media-gallery"></daff-docs-example-viewer>
8
8
 
9
9
  ## Best practices
10
10
 
@@ -86,14 +86,14 @@ A media gallery consists of the following components:
86
86
 
87
87
  > Never use `[daffThumbnail]` as a standalone element. It must be placed within a `<daff-media-gallery>`.
88
88
 
89
- <design-land-example-viewer-container example="media-gallery-with-video"></design-land-example-viewer-container>
89
+ <daff-docs-example-viewer example="media-gallery-with-video"></daff-docs-example-viewer>
90
90
 
91
91
  ## Aspect ratio
92
92
  Use a consistent aspect ratio across all content to avoid layout shifts. Mismatched content sizes can cause the primary content area to shift as different thumbnails are selected.
93
93
 
94
94
  Thumbnails are rendered in a square by default, so a 1:1 ratio is recommended, but not required since thumbnails are automatically centered horizontally and vertically.
95
95
 
96
- <design-land-example-viewer-container example="mismatched-sizes-media-gallery"></design-land-example-viewer-container>
96
+ <daff-docs-example-viewer example="mismatched-sizes-media-gallery"></daff-docs-example-viewer>
97
97
 
98
98
  ## Accessibility
99
99
  - Always provide an accessible label for each thumbnail using the `label` attribute.
package/menu/README.md CHANGED
@@ -1,14 +1,42 @@
1
1
  # Menu
2
- Menu is a small floating panel used to display a list of actions or navigational items.
2
+ A menu is a floating panel that displays a list of actions or navigational items.
3
3
 
4
4
  ## Overview
5
- Menus only appear when a user interacts with a menu activator button. They should be used for secondary actions or options where users don't need immediate access to.
5
+ Menus appear when users interact with a menu activator button. Use menus for secondary actions or options that don't require immediate access.
6
6
 
7
- ## Basic Menu
8
- <design-land-example-viewer-container example="basic-menu"></design-land-example-viewer-container>
7
+ <daff-docs-example-viewer example="basic-menu"></daff-docs-example-viewer>
8
+
9
+ ## Best practices
10
+
11
+ **When to use**
12
+ - Displaying a list of actions that don't need to be visible at all times
13
+ - Providing secondary or contextual options
14
+ - Creating dropdown navigation
15
+
16
+ **When not to use**
17
+ - Actions need to be immediately visible and accessible
18
+ - There are only one or two actions (consider using buttons instead)
9
19
 
10
20
  ## Usage
11
- To use menu, import `DaffMenuModule` into your custom module:
21
+
22
+ ### Within a standalone component
23
+ To use menu in a standalone component, import `DAFF_MENU_COMPONENTS` directly into your custom component:
24
+
25
+ ```ts
26
+ import { DAFF_MENU_COMPONENTS } from '@daffodil/design/menu';
27
+
28
+ @Component({
29
+ selector: 'custom-component',
30
+ templateUrl: './custom-component.component.html',
31
+ imports: [
32
+ DAFF_MENU_COMPONENTS,
33
+ ],
34
+ })
35
+ export class CustomComponent {}
36
+ ```
37
+
38
+ ### Within a module (deprecated)
39
+ To use menu in a module, import `DaffMenuModule` into your custom module:
12
40
 
13
41
  ```ts
14
42
  import { NgModule } from '@angular/core';
@@ -29,13 +57,82 @@ import { CustomComponent } from './custom.component';
29
57
  export class CustomComponentModule { }
30
58
  ```
31
59
 
32
- ## Supported Content Types
60
+ > This method is deprecated. It's recommended to update all custom components to standalone.
61
+
62
+ ## Anatomy
63
+ A menu component consists of the following parts:
64
+
65
+ ### Menu Activator
66
+ **`[daffMenuActivator]`**: A directive attached to a button that triggers the menu to open. The selector doubles as an input for the menu content to display.
67
+
68
+ ### Menu
69
+ **`<daff-menu>`**: The container component that holds menu items.
33
70
 
34
71
  ### Menu Item
35
- A menu consists of multiple `daff-menu-item`s. Menu items should be used with an anchor or button HTML element.
72
+ **`<daff-menu-item>`**: Represents a single action or navigation item within the menu. Should be used with an anchor or button HTML element.
36
73
 
37
74
  ### Icon
38
- An icon can be added before the content in `daff-menu-item` by using the `daffPrefix` selector.
75
+ Use the `[daffPrefix]` directive to add a decorative icon before the menu item content.
39
76
 
40
- ### Menu Activator
41
- A menu is attached to and triggered by the `daffMenuActivator` directive.
77
+ ### Basic structure
78
+ ```html
79
+ <button [daffMenuActivator]="menu">
80
+ Open Menu
81
+ </button>
82
+
83
+ <ng-template #menu>
84
+ <daff-menu>
85
+ <button daff-menu-item>
86
+ <fa-icon [icon]="faEdit" daffPrefix></fa-icon>
87
+ Edit
88
+ </button>
89
+ <button daff-menu-item>
90
+ <fa-icon [icon]="faTrash" daffPrefix></fa-icon>
91
+ Delete
92
+ </button>
93
+ <a href="/settings" daff-menu-item>
94
+ <fa-icon [icon]="faCog" daffPrefix></fa-icon>
95
+ Settings
96
+ </a>
97
+ </daff-menu>
98
+ </ng-template>
99
+ ```
100
+
101
+ ## Features
102
+
103
+ ### Accessing menu state
104
+ The menu activator provides an `isOpen` property that tracks whether the menu is currently open or closed. Use this to update your UI based on the menu state, such as changing icons or styling.
105
+
106
+ <daff-docs-example-viewer example="menu-with-icon-toggle"></daff-docs-example-viewer>
107
+
108
+
109
+ ### Setting an ID
110
+
111
+ The menu activator accepts an optional `id` input. When set, the opened menu's `id` is derived as `{id}-menu`. When no `id` is provided, a unique ID is auto-generated.
112
+
113
+ <daff-docs-example-viewer example="menu-with-id"></daff-docs-example-viewer>
114
+
115
+ ## Accessibility
116
+ Menu follows the [Menu and Menubar WAI-ARIA design pattern](https://www.w3.org/WAI/ARIA/apg/patterns/menubar/).
117
+
118
+ ### Daffodil provides
119
+ - `role="menu"` and `role="menuitem"` on appropriate elements
120
+ - Focus management when menu opens and closes
121
+ - `aria-expanded` on the activator indicating the menu state
122
+
123
+ #### Keyboard interactions
124
+ Keyboard focus is placed on the first item when a menu is opened.
125
+
126
+ | Key | Action |
127
+ | --- | ------ |
128
+ | `Enter` / `Space` | Opens the menu when focused on the activator, or activates the focused menu item |
129
+ | `Escape` | Closes the menu and returns focus to the menu activator |
130
+ | `Down Arrow` | Moves focus to the next item. If focus is on the last item, focus moves to the first item |
131
+ | `Up Arrow` | Moves focus to the previous item. If focus is on the first item, focus moves to the last item |
132
+ | `Home` | Moves focus to the first item |
133
+ | `End` | Moves focus to the last item |
134
+
135
+ ### Developer responsibilities
136
+ - Provide a meaningful label on the menu activator
137
+ - Ensure menu items have descriptive text or labels
138
+ - Use appropriate HTML elements (`<button>` for actions, `<a>` for navigation)
package/menu/index.d.ts CHANGED
@@ -1,11 +1,22 @@
1
1
  import * as i2 from '@angular/cdk/overlay';
2
2
  import { Overlay, OverlayRef } from '@angular/cdk/overlay';
3
3
  import * as i0 from '@angular/core';
4
- import { Injector, ViewContainerRef, TemplateRef, Type, OnDestroy, ChangeDetectorRef, AfterContentInit, AfterViewInit, NgZone, ElementRef } from '@angular/core';
4
+ import { Injector, ViewContainerRef, TemplateRef, Type, OnDestroy, ChangeDetectorRef, AfterContentInit, AfterViewInit, ElementRef } from '@angular/core';
5
5
  import { Observable } from 'rxjs';
6
+ import * as i6 from '@daffodil/design';
6
7
  import { DaffLazyComponent, DaffPrefixDirective } from '@daffodil/design';
7
8
  import * as i1 from '@angular/common';
8
- import { ConfigurableFocusTrapFactory } from '@angular/cdk/a11y';
9
+ import { ConfigurableFocusTrapFactory, FocusableOption } from '@angular/cdk/a11y';
10
+
11
+ /**
12
+ * Configuration for a menu instance.
13
+ */
14
+ interface DaffMenuConfig {
15
+ /**
16
+ * A unique identifier for the menu instance.
17
+ */
18
+ menuId?: string;
19
+ }
9
20
 
10
21
  type DaffMenuSlot = TemplateRef<unknown> | DaffLazyComponent | Type<unknown>;
11
22
  declare class DaffMenuService {
@@ -16,39 +27,121 @@ declare class DaffMenuService {
16
27
  private $_open;
17
28
  open$: Observable<boolean>;
18
29
  constructor(overlay: Overlay, injector: Injector);
19
- protected _createOverlay(activatorElement: ViewContainerRef, component: DaffMenuSlot): Promise<void>;
30
+ /**
31
+ * @docs-private
32
+ */
33
+ protected _createOverlay(activatorElement: ViewContainerRef, component: DaffMenuSlot, config?: DaffMenuConfig): Promise<void>;
34
+ /**
35
+ * @docs-private
36
+ */
20
37
  protected _destroyOverlay(): void;
21
38
  close(): void;
22
- open(activator: ViewContainerRef, component: DaffMenuSlot): void;
39
+ open(activator: ViewContainerRef, component: DaffMenuSlot, config?: DaffMenuConfig): void;
23
40
  static ɵfac: i0.ɵɵFactoryDeclaration<DaffMenuService, never>;
24
41
  static ɵprov: i0.ɵɵInjectableDeclaration<DaffMenuService>;
25
42
  }
26
43
 
44
+ /**
45
+ * Directive that triggers the menu to open/close. Applied to the button that activates the menu. The selector doubles as an input for the menu content to display.
46
+ *
47
+ * @example
48
+ * ```html
49
+ * <button [daffMenuActivator]="menu">
50
+ * Open Menu
51
+ * </button>
52
+ * ```
53
+ */
27
54
  declare class DaffMenuActivatorDirective implements OnDestroy {
28
55
  private service;
29
56
  private viewContainerRef;
30
57
  private cdRef;
31
58
  private _destroyed$;
32
59
  private _open;
60
+ private _defaultMenuId;
61
+ readonly isOpen: i0.WritableSignal<boolean>;
62
+ /**
63
+ * The menu content to display when activated.
64
+ */
33
65
  daffMenuActivator: Type<unknown> | TemplateRef<unknown>;
66
+ /**
67
+ * An optional ID for the activator.
68
+ * When set, the menu's ID is derived as `${id}-menu`.
69
+ */
70
+ id: i0.InputSignal<string>;
71
+ /**
72
+ * The resolved menu ID.
73
+ */
74
+ private menuId;
75
+ /**
76
+ * @docs-private
77
+ */
78
+ get ariaExpanded(): "true" | "false";
34
79
  constructor(service: DaffMenuService, viewContainerRef: ViewContainerRef, cdRef: ChangeDetectorRef);
80
+ /**
81
+ * @docs-private
82
+ */
35
83
  ngOnDestroy(): void;
84
+ /**
85
+ * @docs-private
86
+ */
36
87
  focus(): void;
37
88
  /**
38
89
  * @docs-private
39
90
  */
40
91
  onClick(event: MouseEvent): void;
41
92
  static ɵfac: i0.ɵɵFactoryDeclaration<DaffMenuActivatorDirective, never>;
42
- static ɵdir: i0.ɵɵDirectiveDeclaration<DaffMenuActivatorDirective, "[daffMenuActivator]", never, { "daffMenuActivator": { "alias": "daffMenuActivator"; "required": false; }; }, {}, never, never, true, never>;
93
+ static ɵdir: i0.ɵɵDirectiveDeclaration<DaffMenuActivatorDirective, "[daffMenuActivator]", ["daffMenuActivator"], { "daffMenuActivator": { "alias": "daffMenuActivator"; "required": false; }; "id": { "alias": "id"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
43
94
  }
44
95
 
96
+ /**
97
+ * The floating panel that contains menu items.
98
+ *
99
+ * @example
100
+ * ```html
101
+ * <daff-menu>
102
+ * <button daff-menu-item>
103
+ * <fa-icon [icon]="faEdit" daffPrefix></fa-icon>
104
+ * Edit
105
+ * </button>
106
+ * <button daff-menu-item>
107
+ * <fa-icon [icon]="faTrash" daffPrefix></fa-icon>
108
+ * Delete
109
+ * </button>
110
+ * <a href="/settings" daff-menu-item>
111
+ * <fa-icon [icon]="faCog" daffPrefix></fa-icon>
112
+ * Settings
113
+ * </a>
114
+ * </daff-menu>
115
+ * ```
116
+ */
45
117
  declare class DaffMenuComponent implements AfterContentInit, AfterViewInit {
46
118
  private _focusTrapFactory;
47
- private _ngZone;
48
119
  private _elementRef;
49
120
  private menuService;
121
+ /**
122
+ * @docs-private
123
+ */
124
+ readonly config: DaffMenuConfig;
50
125
  private _focusTrap;
51
- constructor(_focusTrapFactory: ConfigurableFocusTrapFactory, _ngZone: NgZone, _elementRef: ElementRef<HTMLElement>, menuService: DaffMenuService);
126
+ private _keyManager;
127
+ /**
128
+ * @docs-private
129
+ *
130
+ * Content children that provide `DAFF_MENU_ITEM_TOKEN` are treated as menu items.
131
+ * This includes both `daff-menu-item` components and any custom directives that also provide the token.
132
+ */
133
+ private _items;
134
+ constructor(_focusTrapFactory: ConfigurableFocusTrapFactory, _elementRef: ElementRef<HTMLElement>, menuService: DaffMenuService,
135
+ /**
136
+ * @docs-private
137
+ */
138
+ config: DaffMenuConfig);
139
+ /**
140
+ * @docs-private
141
+ *
142
+ * Handle keyboard navigation
143
+ */
144
+ handleKeydown(event: KeyboardEvent): void;
52
145
  /**
53
146
  * @docs-private
54
147
  */
@@ -58,22 +151,61 @@ declare class DaffMenuComponent implements AfterContentInit, AfterViewInit {
58
151
  */
59
152
  ngAfterViewInit(): void;
60
153
  static ɵfac: i0.ɵɵFactoryDeclaration<DaffMenuComponent, never>;
61
- static ɵcmp: i0.ɵɵComponentDeclaration<DaffMenuComponent, "daff-menu", never, {}, {}, never, ["[daff-menu-item]"], true, never>;
154
+ static ɵcmp: i0.ɵɵComponentDeclaration<DaffMenuComponent, "daff-menu", never, {}, {}, ["_items"], ["*"], true, never>;
62
155
  }
63
156
 
64
- declare class DaffMenuItemComponent {
157
+ /**
158
+ * Individual clickable items within the menu. Applied to `<button>` or `<a>` elements.
159
+ *
160
+ * @example
161
+ * ```
162
+ * <a daff-menu-item href="/">Settings</a>
163
+ * <button daff-menu-item href="/">Settings</button>
164
+ * ```
165
+ */
166
+ declare class DaffMenuItemComponent implements FocusableOption {
167
+ private _elementRef;
168
+ private _menuService;
65
169
  /**
66
170
  * @docs-private
67
171
  */
68
172
  _prefix: DaffPrefixDirective;
173
+ constructor(_elementRef: ElementRef<HTMLElement>, _menuService: DaffMenuService);
174
+ /**
175
+ * @docs-private
176
+ */
177
+ onClick(): void;
178
+ /**
179
+ * Focus the menu item.
180
+ */
181
+ focus(): void;
69
182
  static ɵfac: i0.ɵɵFactoryDeclaration<DaffMenuItemComponent, never>;
70
183
  static ɵcmp: i0.ɵɵComponentDeclaration<DaffMenuItemComponent, "a[daff-menu-item],button[daff-menu-item]", never, {}, {}, ["_prefix"], ["[daffPrefix]", "*"], true, never>;
71
184
  }
72
185
 
186
+ /**
187
+ * @deprecated in favor of {@link DAFF_MENU_COMPONENTS} Deprecated in version 0.92.0. Will be removed in version 0.95.0.
188
+ */
73
189
  declare class DaffMenuModule {
74
190
  static ɵfac: i0.ɵɵFactoryDeclaration<DaffMenuModule, never>;
75
- static ɵmod: i0.ɵɵNgModuleDeclaration<DaffMenuModule, never, [typeof i1.CommonModule, typeof i2.OverlayModule, typeof DaffMenuActivatorDirective, typeof DaffMenuComponent, typeof DaffMenuItemComponent], [typeof DaffMenuActivatorDirective, typeof DaffMenuComponent, typeof DaffMenuItemComponent]>;
191
+ static ɵmod: i0.ɵɵNgModuleDeclaration<DaffMenuModule, never, [typeof i1.CommonModule, typeof i2.OverlayModule, typeof DaffMenuActivatorDirective, typeof DaffMenuComponent, typeof DaffMenuItemComponent, typeof i6.DaffPrefixDirective], [typeof DaffMenuActivatorDirective, typeof DaffMenuComponent, typeof DaffMenuItemComponent, typeof i6.DaffPrefixDirective]>;
76
192
  static ɵinj: i0.ɵɵInjectorDeclaration<DaffMenuModule>;
77
193
  }
78
194
 
79
- export { DaffMenuActivatorDirective, DaffMenuComponent, DaffMenuItemComponent, DaffMenuModule, DaffMenuService };
195
+ /**
196
+ * @docs-private
197
+ */
198
+ declare const DAFF_MENU_COMPONENTS: readonly [typeof DaffMenuComponent, typeof DaffMenuActivatorDirective, typeof DaffMenuItemComponent];
199
+
200
+ /**
201
+ * Injection token/provider pair used to identify menu items.
202
+ *
203
+ * `DaffMenuComponent` uses `@ContentChildren(DAFF_MENU_ITEM_TOKEN)` to discover
204
+ * its menu items. Use `provideDaffMenuItemToken` in component providers to register
205
+ * custom directives and components as menu items alongside native `daff-menu-item` elements.
206
+ */
207
+ declare const DAFF_MENU_ITEM_TOKEN: i0.InjectionToken<FocusableOption>;
208
+ declare const provideDaffMenuItemToken: <R extends FocusableOption = FocusableOption>(klass: i0.Type<R>) => i0.ExistingProvider;
209
+
210
+ export { DAFF_MENU_COMPONENTS, DAFF_MENU_ITEM_TOKEN, DaffMenuActivatorDirective, DaffMenuComponent, DaffMenuItemComponent, DaffMenuModule, DaffMenuService, provideDaffMenuItemToken };
211
+ export type { DaffMenuConfig, DaffMenuSlot };
package/modal/README.md CHANGED
@@ -4,7 +4,7 @@ Modal is a dynamically rendered element that floats above the rest of a page's c
4
4
  ## Overview
5
5
  Modals are used to capture information or attention. They overlay the main content and prevent interaction with the page until the modal is dismissed.
6
6
 
7
- <design-land-example-viewer-container example="basic-modal"></design-land-example-viewer-container>
7
+ <daff-docs-example-viewer example="basic-modal"></daff-docs-example-viewer>
8
8
 
9
9
  ## Best practices
10
10
 
package/modal/index.d.ts CHANGED
@@ -1,18 +1,37 @@
1
1
  import * as rxjs from 'rxjs';
2
+ import { Observable } from 'rxjs';
2
3
  import { ConfigurableFocusTrapFactory } from '@angular/cdk/a11y';
3
4
  import * as i2 from '@angular/cdk/portal';
4
5
  import { ComponentPortal } from '@angular/cdk/portal';
5
6
  import * as i0 from '@angular/core';
6
- import { Type, AfterContentInit, AfterViewInit, OnDestroy, ElementRef, ChangeDetectorRef, ComponentRef } from '@angular/core';
7
+ import { Type, AfterContentInit, AfterViewInit, OnDestroy, ElementRef, ChangeDetectorRef } from '@angular/core';
7
8
  import * as i1 from '@daffodil/design';
8
9
  import { DaffOpenable, DaffOpenableDirective, DaffFocusStackService } from '@daffodil/design';
9
10
  import * as i3 from '@angular/cdk/overlay';
10
- import { Overlay, OverlayRef } from '@angular/cdk/overlay';
11
+ import { Overlay } from '@angular/cdk/overlay';
11
12
  import * as i1$1 from '@angular/common';
12
13
  import * as i4 from '@daffodil/design/button';
13
14
  import * as i5 from '@fortawesome/angular-fontawesome';
14
15
  import * as _fortawesome_fontawesome_common_types from '@fortawesome/fontawesome-common-types';
15
16
 
17
+ /**
18
+ * Reference to modal instance.
19
+ */
20
+ interface DaffModalRef<T> {
21
+ /**
22
+ * The component instance inside the modal.
23
+ */
24
+ instance: T;
25
+ /**
26
+ * Closes the modal.
27
+ */
28
+ close(): void;
29
+ /**
30
+ * Emits when the modal close animation completes.
31
+ */
32
+ afterClosed: Observable<boolean>;
33
+ }
34
+
16
35
  type DaffModalVerticalPosition = 'top' | 'center';
17
36
  interface DaffModalPosition {
18
37
  /**
@@ -59,7 +78,7 @@ declare class DaffModalService {
59
78
  private _createOverlayRef;
60
79
  private _removeModal;
61
80
  private _closeAllModals;
62
- open(component: Type<any>, configuration?: Partial<DaffModalConfiguration>): DaffModalComponent;
81
+ open<T>(component: Type<T>, configuration?: Partial<DaffModalConfiguration>): DaffModalRef<T>;
63
82
  close(component: DaffModalComponent): void;
64
83
  static ɵfac: i0.ɵɵFactoryDeclaration<DaffModalService, never>;
65
84
  static ɵprov: i0.ɵɵInjectableDeclaration<DaffModalService>;
@@ -203,21 +222,10 @@ declare class DaffModalModule {
203
222
  static ɵinj: i0.ɵɵInjectorDeclaration<DaffModalModule>;
204
223
  }
205
224
 
206
- interface DaffModal {
207
- /**
208
- * The reference to the modal in question
209
- */
210
- modal: ComponentRef<DaffModalComponent>;
211
- /**
212
- * The overlay associated with a given modal.
213
- */
214
- overlay: OverlayRef;
215
- }
216
-
217
225
  /**
218
226
  * @docs-private
219
227
  */
220
228
  declare const DAFF_MODAL_COMPONENTS: readonly [typeof DaffModalHeaderComponent, typeof DaffModalTitleDirective, typeof DaffModalContentComponent, typeof DaffModalActionsComponent, typeof DaffModalCloseDirective];
221
229
 
222
230
  export { DAFF_MODAL_COMPONENTS, DaffModalActionsComponent, DaffModalCloseDirective, DaffModalComponent, DaffModalContentComponent, DaffModalHeaderComponent, DaffModalModule, DaffModalService, DaffModalTitleDirective };
223
- export type { DaffModal };
231
+ export type { DaffModalRef };
@@ -4,7 +4,7 @@ Native select works alongside the HTML select element, with additional custom st
4
4
  ## Overview
5
5
  Native select has the same functionality as a native HTML select element, with additional custom styling and functionality. It **cannot** be used by itself and must be contained within a [form field](/libs/design/form-field/README.md).
6
6
 
7
- <design-land-example-viewer-container example="basic-native-select"></design-land-example-viewer-container>
7
+ <daff-docs-example-viewer example="basic-native-select"></daff-docs-example-viewer>
8
8
 
9
9
  ## Usage
10
10
  To use native select, import `DAFF_NATIVE_SELECT_COMPONENTS` directly into your custom component:
@@ -42,19 +42,19 @@ Native select must be used inside `<daff-form-field>` to enable proper state man
42
42
  ### Disabled
43
43
  Native select can be disabled in two ways: using Angular's reactive forms with `FormControl` or with the native HTML `disabled` attribute.
44
44
 
45
- <design-land-example-viewer-container example="native-select-disabled"></design-land-example-viewer-container>
45
+ <daff-docs-example-viewer example="native-select-disabled"></daff-docs-example-viewer>
46
46
 
47
47
  ### Error
48
48
  Native select supports validation and error messages through Angular's form validation system. Use `<daff-error-message>` within the form field to display context-specific error messages. Error messages automatically appear when the select is invalid and has been touched or submitted.
49
49
 
50
- <design-land-example-viewer-container example="native-select-error"></design-land-example-viewer-container>
50
+ <daff-docs-example-viewer example="native-select-error"></daff-docs-example-viewer>
51
51
 
52
52
  Multiple error messages can be displayed conditionally based on the type of validation error. The form field component handles the styling and positioning of error messages.
53
53
 
54
54
  ## Hints
55
55
  Hints provide additional context or instructions to help users complete the select field correctly. Use `<daff-hint>` within the form field to display helpful information below the select. Unlike error messages, hints are always visible and provide guidance rather than validation feedback.
56
56
 
57
- <design-land-example-viewer-container example="native-select-hint"></design-land-example-viewer-container>
57
+ <daff-docs-example-viewer example="native-select-hint"></daff-docs-example-viewer>
58
58
 
59
59
  ## Accessibility
60
60
  When `<daff-form-label>` is used within `<daff-form-field>`, the label automatically associates with the select using the `for` and `id` attributes.
@@ -29,6 +29,11 @@ declare class DaffNativeSelectComponent extends DaffFormFieldControl<string> imp
29
29
  * Implemented as part of DaffFormFieldControl.
30
30
  */
31
31
  private get _id();
32
+ constructor(
33
+ /**
34
+ * @docs-private
35
+ */
36
+ ngControl: NgControl, _elementRef: ElementRef<HTMLInputElement>, formField: DaffFormFieldComponent);
32
37
  /**
33
38
  * @docs-private
34
39
  */
@@ -42,7 +47,7 @@ declare class DaffNativeSelectComponent extends DaffFormFieldControl<string> imp
42
47
  /**
43
48
  * @docs-private
44
49
  */
45
- get disabledAttribute(): true;
50
+ get disabledAttribute(): boolean;
46
51
  private _required;
47
52
  /**
48
53
  * @docs-private
@@ -55,19 +60,15 @@ declare class DaffNativeSelectComponent extends DaffFormFieldControl<string> imp
55
60
  * @docs-private
56
61
  */
57
62
  get requiredAttribute(): true;
58
- /**
59
- * @docs-private
60
- */
61
63
  focus(): void;
62
64
  /**
63
65
  * @docs-private
64
66
  */
65
- blur(): void;
66
- constructor(
67
+ _handleFocus(): void;
67
68
  /**
68
69
  * @docs-private
69
70
  */
70
- ngControl: NgControl, _elementRef: ElementRef<HTMLInputElement>, formField: DaffFormFieldComponent);
71
+ _handleBlur(): void;
71
72
  /** @docs-private */
72
73
  ngOnInit(): void;
73
74
  /**