@daffodil/design 0.90.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 (277) hide show
  1. package/accordion/README.md +26 -38
  2. package/accordion/index.d.ts +9 -6
  3. package/article/README.md +66 -46
  4. package/article/index.d.ts +41 -0
  5. package/article/src/article-theme.scss +22 -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 +27 -6
  11. package/button/src/button/basic/button-theme.scss +4 -2
  12. package/button/src/button/button-base.scss +29 -6
  13. package/button/src/button/icon/icon-theme.scss +10 -6
  14. package/button/src/button/raised/raised-theme.scss +6 -4
  15. package/callout/README.md +15 -27
  16. package/card/README.md +36 -69
  17. package/card/index.d.ts +7 -41
  18. package/card/src/card-base-theme.scss +2 -5
  19. package/card/src/card-base.scss +2 -2
  20. package/checkbox/README.md +0 -0
  21. package/checkbox/index.d.ts +177 -0
  22. package/container/README.md +18 -23
  23. package/fesm2022/daffodil-design-accordion.mjs +34 -25
  24. package/fesm2022/daffodil-design-accordion.mjs.map +1 -1
  25. package/fesm2022/daffodil-design-article.mjs +283 -17
  26. package/fesm2022/daffodil-design-article.mjs.map +1 -1
  27. package/fesm2022/daffodil-design-breadcrumb.mjs +180 -28
  28. package/fesm2022/daffodil-design-breadcrumb.mjs.map +1 -1
  29. package/fesm2022/daffodil-design-button.mjs +90 -45
  30. package/fesm2022/daffodil-design-button.mjs.map +1 -1
  31. package/fesm2022/daffodil-design-callout.mjs +23 -23
  32. package/fesm2022/daffodil-design-callout.mjs.map +1 -1
  33. package/fesm2022/daffodil-design-card.mjs +43 -90
  34. package/fesm2022/daffodil-design-card.mjs.map +1 -1
  35. package/fesm2022/daffodil-design-checkbox.mjs +317 -0
  36. package/fesm2022/daffodil-design-checkbox.mjs.map +1 -0
  37. package/fesm2022/daffodil-design-container.mjs +8 -8
  38. package/fesm2022/daffodil-design-container.mjs.map +1 -1
  39. package/fesm2022/daffodil-design-form-field.mjs +56 -86
  40. package/fesm2022/daffodil-design-form-field.mjs.map +1 -1
  41. package/fesm2022/daffodil-design-form.mjs +62 -0
  42. package/fesm2022/daffodil-design-form.mjs.map +1 -0
  43. package/fesm2022/daffodil-design-hero.mjs +23 -23
  44. package/fesm2022/daffodil-design-hero.mjs.map +1 -1
  45. package/fesm2022/daffodil-design-image.mjs +19 -11
  46. package/fesm2022/daffodil-design-image.mjs.map +1 -1
  47. package/fesm2022/daffodil-design-input.mjs +18 -14
  48. package/fesm2022/daffodil-design-input.mjs.map +1 -1
  49. package/fesm2022/daffodil-design-link-set.mjs +25 -17
  50. package/fesm2022/daffodil-design-link-set.mjs.map +1 -1
  51. package/fesm2022/daffodil-design-list.mjs +16 -16
  52. package/fesm2022/daffodil-design-list.mjs.map +1 -1
  53. package/fesm2022/daffodil-design-loading-icon.mjs +8 -8
  54. package/fesm2022/daffodil-design-loading-icon.mjs.map +1 -1
  55. package/fesm2022/daffodil-design-media-gallery.mjs +13 -13
  56. package/fesm2022/daffodil-design-media-gallery.mjs.map +1 -1
  57. package/fesm2022/daffodil-design-menu.mjs +223 -60
  58. package/fesm2022/daffodil-design-menu.mjs.map +1 -1
  59. package/fesm2022/daffodil-design-modal.mjs +86 -83
  60. package/fesm2022/daffodil-design-modal.mjs.map +1 -1
  61. package/fesm2022/daffodil-design-native-select.mjs +47 -41
  62. package/fesm2022/daffodil-design-native-select.mjs.map +1 -1
  63. package/fesm2022/daffodil-design-navbar.mjs +25 -21
  64. package/fesm2022/daffodil-design-navbar.mjs.map +1 -1
  65. package/fesm2022/daffodil-design-notification.mjs +28 -64
  66. package/fesm2022/daffodil-design-notification.mjs.map +1 -1
  67. package/fesm2022/daffodil-design-paginator.mjs +11 -16
  68. package/fesm2022/daffodil-design-paginator.mjs.map +1 -1
  69. package/fesm2022/daffodil-design-progress-bar.mjs +10 -10
  70. package/fesm2022/daffodil-design-progress-bar.mjs.map +1 -1
  71. package/fesm2022/daffodil-design-quantity-field.mjs +19 -18
  72. package/fesm2022/daffodil-design-quantity-field.mjs.map +1 -1
  73. package/fesm2022/daffodil-design-radio.mjs +27 -56
  74. package/fesm2022/daffodil-design-radio.mjs.map +1 -1
  75. package/fesm2022/daffodil-design-select.mjs +6 -6
  76. package/fesm2022/daffodil-design-select.mjs.map +1 -1
  77. package/fesm2022/daffodil-design-sidebar.mjs +30 -60
  78. package/fesm2022/daffodil-design-sidebar.mjs.map +1 -1
  79. package/fesm2022/daffodil-design-spinner.mjs +99 -0
  80. package/fesm2022/daffodil-design-spinner.mjs.map +1 -0
  81. package/fesm2022/daffodil-design-switch.mjs +49 -106
  82. package/fesm2022/daffodil-design-switch.mjs.map +1 -1
  83. package/fesm2022/daffodil-design-tabs.mjs +35 -27
  84. package/fesm2022/daffodil-design-tabs.mjs.map +1 -1
  85. package/fesm2022/daffodil-design-tag.mjs +7 -7
  86. package/fesm2022/daffodil-design-tag.mjs.map +1 -1
  87. package/fesm2022/daffodil-design-text-snippet.mjs +6 -8
  88. package/fesm2022/daffodil-design-text-snippet.mjs.map +1 -1
  89. package/fesm2022/daffodil-design-textarea.mjs +6 -3
  90. package/fesm2022/daffodil-design-textarea.mjs.map +1 -1
  91. package/fesm2022/daffodil-design-toast.mjs +79 -80
  92. package/fesm2022/daffodil-design-toast.mjs.map +1 -1
  93. package/fesm2022/daffodil-design-tree.mjs +152 -112
  94. package/fesm2022/daffodil-design-tree.mjs.map +1 -1
  95. package/fesm2022/daffodil-design-youtube-player.mjs +6 -6
  96. package/fesm2022/daffodil-design-youtube-player.mjs.map +1 -1
  97. package/fesm2022/daffodil-design.mjs +559 -711
  98. package/fesm2022/daffodil-design.mjs.map +1 -1
  99. package/form/README.md +75 -0
  100. package/form/index.d.ts +27 -0
  101. package/form-field/README.md +74 -99
  102. package/form-field/index.d.ts +64 -42
  103. package/hero/README.md +5 -5
  104. package/image/README.md +27 -19
  105. package/image/index.d.ts +6 -1
  106. package/index.d.ts +282 -447
  107. package/input/README.md +36 -16
  108. package/input/index.d.ts +4 -3
  109. package/link-set/index.d.ts +9 -1
  110. package/list/README.md +2 -2
  111. package/loading-icon/README.md +1 -1
  112. package/loading-icon/index.d.ts +1 -1
  113. package/media-gallery/README.md +3 -3
  114. package/menu/README.md +107 -10
  115. package/menu/index.d.ts +143 -11
  116. package/modal/README.md +107 -17
  117. package/modal/index.d.ts +72 -35
  118. package/native-select/README.md +52 -15
  119. package/native-select/index.d.ts +8 -7
  120. package/navbar/README.md +23 -17
  121. package/navbar/index.d.ts +12 -2
  122. package/navbar/src/navbar-theme.scss +4 -46
  123. package/notification/README.md +4 -4
  124. package/notification/index.d.ts +7 -38
  125. package/package.json +1 -1
  126. package/paginator/README.md +42 -6
  127. package/paginator/index.d.ts +5 -9
  128. package/progress-bar/README.md +3 -3
  129. package/quantity-field/README.md +4 -4
  130. package/quantity-field/index.d.ts +4 -1
  131. package/radio/README.md +1 -1
  132. package/radio/index.d.ts +0 -16
  133. package/scss/layout/_breakpoint.scss +1 -1
  134. package/scss/theme.scss +9 -5
  135. package/scss/theming/_color-palettes.scss +19 -11
  136. package/scss/theming/_configure-theme.scss +11 -10
  137. package/scss/theming/_daff-theme.scss +5 -14
  138. package/scss/theming/_get-base-color.scss +2 -2
  139. package/scss/theming/_get-palette.scss +2 -2
  140. package/scss/theming/_get-theme-mode.scss +3 -3
  141. package/scss/theming/_index.scss +2 -1
  142. package/scss/theming/contrast/max-contrast/max-contrast.scss +3 -3
  143. package/scss/theming/contrast/text-contrast/text-contrast.scss +22 -16
  144. package/scss/theming/contrast/text-contrast/text-contrast.spec.scss +57 -0
  145. package/scss/theming/create-theme/_create-theme.scss +330 -0
  146. package/scss/theming/create-theme/_create-theme.spec.scss +122 -0
  147. package/scss/theming/create-theme/_index.scss +1 -0
  148. package/scss/theming/get-font-colors/_get-font-colors.scss +36 -0
  149. package/scss/theming/get-font-colors/_get-font-colors.spec.scss +72 -0
  150. package/scss/typography/mixins/_font-weight.scss +8 -14
  151. package/select/README.md +107 -4
  152. package/sidebar/README.md +6 -14
  153. package/sidebar/index.d.ts +3 -15
  154. package/spinner/README.md +57 -0
  155. package/spinner/index.d.ts +53 -0
  156. package/spinner/src/spinner-theme.scss +62 -0
  157. package/switch/README.md +21 -29
  158. package/switch/index.d.ts +18 -48
  159. package/switch/src/switch-theme.scss +26 -18
  160. package/tabs/README.md +1 -1
  161. package/tabs/index.d.ts +8 -5
  162. package/tag/README.md +24 -30
  163. package/tag/index.d.ts +1 -1
  164. package/tag/src/tag-theme.scss +11 -9
  165. package/text-snippet/README.md +1 -1
  166. package/text-snippet/src/text-snippet-theme.scss +12 -0
  167. package/textarea/README.md +36 -6
  168. package/textarea/index.d.ts +4 -4
  169. package/toast/README.md +4 -4
  170. package/tree/README.md +39 -22
  171. package/tree/index.d.ts +57 -96
  172. package/tree/src/tree-theme.scss +0 -4
  173. package/accordion/examples/index.d.ts +0 -20
  174. package/article/examples/index.d.ts +0 -50
  175. package/breadcrumb/examples/index.d.ts +0 -10
  176. package/button/examples/index.d.ts +0 -67
  177. package/callout/examples/index.d.ts +0 -41
  178. package/card/examples/index.d.ts +0 -62
  179. package/card/src/card/raised/raised-theme.scss +0 -28
  180. package/checkbox/examples/index.d.ts +0 -32
  181. package/container/examples/index.d.ts +0 -16
  182. package/fesm2022/daffodil-design-accordion-examples.mjs +0 -50
  183. package/fesm2022/daffodil-design-accordion-examples.mjs.map +0 -1
  184. package/fesm2022/daffodil-design-article-examples.mjs +0 -134
  185. package/fesm2022/daffodil-design-article-examples.mjs.map +0 -1
  186. package/fesm2022/daffodil-design-breadcrumb-examples.mjs +0 -46
  187. package/fesm2022/daffodil-design-breadcrumb-examples.mjs.map +0 -1
  188. package/fesm2022/daffodil-design-button-examples.mjs +0 -178
  189. package/fesm2022/daffodil-design-button-examples.mjs.map +0 -1
  190. package/fesm2022/daffodil-design-callout-examples.mjs +0 -116
  191. package/fesm2022/daffodil-design-callout-examples.mjs.map +0 -1
  192. package/fesm2022/daffodil-design-card-examples.mjs +0 -168
  193. package/fesm2022/daffodil-design-card-examples.mjs.map +0 -1
  194. package/fesm2022/daffodil-design-checkbox-examples.mjs +0 -76
  195. package/fesm2022/daffodil-design-checkbox-examples.mjs.map +0 -1
  196. package/fesm2022/daffodil-design-container-examples.mjs +0 -41
  197. package/fesm2022/daffodil-design-container-examples.mjs.map +0 -1
  198. package/fesm2022/daffodil-design-form-field-examples.mjs +0 -96
  199. package/fesm2022/daffodil-design-form-field-examples.mjs.map +0 -1
  200. package/fesm2022/daffodil-design-hero-examples.mjs +0 -121
  201. package/fesm2022/daffodil-design-hero-examples.mjs.map +0 -1
  202. package/fesm2022/daffodil-design-image-examples.mjs +0 -58
  203. package/fesm2022/daffodil-design-image-examples.mjs.map +0 -1
  204. package/fesm2022/daffodil-design-input-examples.mjs +0 -108
  205. package/fesm2022/daffodil-design-input-examples.mjs.map +0 -1
  206. package/fesm2022/daffodil-design-list-examples.mjs +0 -77
  207. package/fesm2022/daffodil-design-list-examples.mjs.map +0 -1
  208. package/fesm2022/daffodil-design-loading-icon-examples.mjs +0 -44
  209. package/fesm2022/daffodil-design-loading-icon-examples.mjs.map +0 -1
  210. package/fesm2022/daffodil-design-media-gallery-examples.mjs +0 -104
  211. package/fesm2022/daffodil-design-media-gallery-examples.mjs.map +0 -1
  212. package/fesm2022/daffodil-design-menu-examples.mjs +0 -50
  213. package/fesm2022/daffodil-design-menu-examples.mjs.map +0 -1
  214. package/fesm2022/daffodil-design-modal-examples.mjs +0 -51
  215. package/fesm2022/daffodil-design-modal-examples.mjs.map +0 -1
  216. package/fesm2022/daffodil-design-native-select-examples.mjs +0 -71
  217. package/fesm2022/daffodil-design-native-select-examples.mjs.map +0 -1
  218. package/fesm2022/daffodil-design-navbar-examples.mjs +0 -88
  219. package/fesm2022/daffodil-design-navbar-examples.mjs.map +0 -1
  220. package/fesm2022/daffodil-design-notification-examples.mjs +0 -102
  221. package/fesm2022/daffodil-design-notification-examples.mjs.map +0 -1
  222. package/fesm2022/daffodil-design-paginator-examples.mjs +0 -59
  223. package/fesm2022/daffodil-design-paginator-examples.mjs.map +0 -1
  224. package/fesm2022/daffodil-design-progress-bar-examples.mjs +0 -57
  225. package/fesm2022/daffodil-design-progress-bar-examples.mjs.map +0 -1
  226. package/fesm2022/daffodil-design-quantity-field-examples.mjs +0 -85
  227. package/fesm2022/daffodil-design-quantity-field-examples.mjs.map +0 -1
  228. package/fesm2022/daffodil-design-radio-examples.mjs +0 -34
  229. package/fesm2022/daffodil-design-radio-examples.mjs.map +0 -1
  230. package/fesm2022/daffodil-design-select-examples.mjs +0 -117
  231. package/fesm2022/daffodil-design-select-examples.mjs.map +0 -1
  232. package/fesm2022/daffodil-design-sidebar-examples.mjs +0 -109
  233. package/fesm2022/daffodil-design-sidebar-examples.mjs.map +0 -1
  234. package/fesm2022/daffodil-design-sticky-examples.mjs +0 -25
  235. package/fesm2022/daffodil-design-sticky-examples.mjs.map +0 -1
  236. package/fesm2022/daffodil-design-switch-examples.mjs +0 -110
  237. package/fesm2022/daffodil-design-switch-examples.mjs.map +0 -1
  238. package/fesm2022/daffodil-design-tabs-examples.mjs +0 -115
  239. package/fesm2022/daffodil-design-tabs-examples.mjs.map +0 -1
  240. package/fesm2022/daffodil-design-tag-examples.mjs +0 -125
  241. package/fesm2022/daffodil-design-tag-examples.mjs.map +0 -1
  242. package/fesm2022/daffodil-design-text-snippet-examples.mjs +0 -25
  243. package/fesm2022/daffodil-design-text-snippet-examples.mjs.map +0 -1
  244. package/fesm2022/daffodil-design-textarea-examples.mjs +0 -66
  245. package/fesm2022/daffodil-design-textarea-examples.mjs.map +0 -1
  246. package/fesm2022/daffodil-design-toast-examples.mjs +0 -147
  247. package/fesm2022/daffodil-design-toast-examples.mjs.map +0 -1
  248. package/fesm2022/daffodil-design-tree-examples.mjs +0 -104
  249. package/fesm2022/daffodil-design-tree-examples.mjs.map +0 -1
  250. package/form-field/examples/index.d.ts +0 -18
  251. package/hero/examples/index.d.ts +0 -45
  252. package/image/examples/index.d.ts +0 -10
  253. package/input/examples/index.d.ts +0 -10
  254. package/list/examples/index.d.ts +0 -29
  255. package/loading-icon/examples/index.d.ts +0 -16
  256. package/media-gallery/examples/index.d.ts +0 -38
  257. package/menu/examples/index.d.ts +0 -20
  258. package/modal/examples/index.d.ts +0 -15
  259. package/native-select/examples/index.d.ts +0 -10
  260. package/navbar/examples/index.d.ts +0 -31
  261. package/notification/examples/index.d.ts +0 -12
  262. package/paginator/examples/index.d.ts +0 -26
  263. package/progress-bar/examples/index.d.ts +0 -10
  264. package/quantity-field/examples/index.d.ts +0 -30
  265. package/radio/examples/index.d.ts +0 -13
  266. package/select/examples/index.d.ts +0 -28
  267. package/sidebar/examples/index.d.ts +0 -10
  268. package/sticky/examples/index.d.ts +0 -10
  269. package/switch/examples/index.d.ts +0 -46
  270. package/tabs/examples/index.d.ts +0 -12
  271. package/tag/examples/index.d.ts +0 -50
  272. package/text-snippet/examples/index.d.ts +0 -10
  273. package/textarea/examples/index.d.ts +0 -10
  274. package/toast/examples/index.d.ts +0 -56
  275. package/tree/examples/index.d.ts +0 -18
  276. /package/{form-field → form}/src/error-message/error-message-theme.scss +0 -0
  277. /package/{form-field → form}/src/hint/hint-theme.scss +0 -0
package/input/README.md CHANGED
@@ -1,15 +1,15 @@
1
1
  # Input
2
- The input component allows a native HTML input element to work with the form field component.
2
+ Input works alongside the native HTML input element, with additional custom styling and functionality.
3
3
 
4
4
  ## Overview
5
- The input component has the same functionality as a native HTML `<input>` element, with additional custom styling and functionality. It **cannot** be used by itself and must be contained within a [DaffFormFieldComponent](/libs/design/src/atoms/form/form-field/README.md).
5
+ Input has the same functionality as a native HTML input 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="input-with-form-field"></design-land-example-viewer-container>
7
+ <daff-docs-example-viewer example="input-with-form-field"></daff-docs-example-viewer>
8
8
 
9
9
  ## Usage
10
10
 
11
11
  ### Within a standalone component
12
- To use form field in a standalone component, import `DaffInputComponent` directly into your custom component:
12
+ To use input in a standalone component, import `DaffInputComponent` directly into your custom component:
13
13
 
14
14
  ```ts
15
15
  import { DaffInputComponent } from '@daffodil/design/input';
@@ -25,7 +25,7 @@ export class CustomComponent {}
25
25
  ```
26
26
 
27
27
  ### Within a module (deprecated)
28
- To use form field in a module, import `DaffInputModule` into your custom module:
28
+ To use input in a module, import `DaffInputModule` into your custom module:
29
29
 
30
30
  ```ts
31
31
  import { NgModule } from '@angular/core';
@@ -33,7 +33,7 @@ import { DaffInputModule } from '@daffodil/design/input';
33
33
  import { CustomComponent } from './custom.component';
34
34
 
35
35
  @NgModule({
36
- declarations: [
36
+ declarations: [
37
37
  CustomComponent,
38
38
  ],
39
39
  exports: [
@@ -46,21 +46,41 @@ import { CustomComponent } from './custom.component';
46
46
  export class CustomComponentModule { }
47
47
  ```
48
48
 
49
+ > **Warning**
50
+ >
49
51
  > This method is deprecated. It's recommended to update all custom components to standalone.
50
52
 
51
- ## Examples
53
+ ## Anatomy
54
+ Input must be used inside `<daff-form-field>` to enable proper state management and provide enhanced UI features such as hints, error messages, prefixes, and suffixes. The form field component also ensures accessibility compliance. For more details, see the [form field documentation](/libs/design/form-field/README.md).
52
55
 
53
- ### Disabled input
54
- The input in this example is disabled using the native HTML disabled attribute.
56
+ ### Basic structure
57
+ ```html
58
+ <daff-form-field>
59
+ <daff-form-label>First Name</daff-form-label>
60
+ <input daff-input type="text" name="first-name" />
61
+ </daff-form-field>
62
+ ```
63
+
64
+ ## States
65
+
66
+ ### Disabled
67
+ Input can be disabled in two ways: using Angular's reactive forms with `FormControl` or with the native HTML `disabled` attribute.
68
+
69
+ <daff-docs-example-viewer example="input-disabled"></daff-docs-example-viewer>
70
+
71
+ ### Error
72
+ Input 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 input is invalid and has been touched or submitted.
73
+
74
+ <daff-docs-example-viewer example="input-error"></daff-docs-example-viewer>
55
75
 
56
- <design-land-example-viewer-container example="input-disabled"></design-land-example-viewer-container>
76
+ 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.
57
77
 
58
- ### Input with error messages
59
- The input in this example uses the `ReactiveFormsModule` to display errors.
78
+ ## Hints
79
+ Hints provide additional context or instructions to help users complete the input field correctly. Use `<daff-hint>` within the form field to display helpful information below the input. Unlike error messages, hints are always visible and provide guidance rather than validation feedback.
60
80
 
61
- <design-land-example-viewer-container example="input-error"></design-land-example-viewer-container>
81
+ <daff-docs-example-viewer example="input-hint"></daff-docs-example-viewer>
62
82
 
63
- ### Input with hint
64
- The input in this example has a hint.
83
+ ## Accessibility
84
+ When `<daff-form-label>` is used within `<daff-form-field>`, the label automatically associates with the input using the `for` and `id` attributes.
65
85
 
66
- <design-land-example-viewer-container example="input-hint"></design-land-example-viewer-container>
86
+ If a `<daff-form-label>` is not specified, use the `<label>` element to associate text with form elements explicitly. The `for` attribute of the label must exactly match the `id` of the form control.
package/input/index.d.ts CHANGED
@@ -29,7 +29,7 @@ declare class DaffInputComponent extends DaffFormFieldControl<string> implements
29
29
  /**
30
30
  * @docs-private
31
31
  */
32
- get disabledAttribute(): true;
32
+ get disabledAttribute(): boolean;
33
33
  private _required;
34
34
  /**
35
35
  * @docs-private
@@ -46,10 +46,11 @@ declare class DaffInputComponent extends DaffFormFieldControl<string> implements
46
46
  * @docs-private
47
47
  */
48
48
  get ariaDescribedBy(): string;
49
- /** @docs-private */
50
49
  focus(): void;
51
50
  /** @docs-private */
52
- blur(): void;
51
+ _handleFocus(): void;
52
+ /** @docs-private */
53
+ _handleBlur(): void;
53
54
  constructor(
54
55
  /** @docs-private */
55
56
  ngControl: NgControl, _elementRef: ElementRef<HTMLInputElement>, formField: DaffFormFieldComponent);
@@ -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 };