@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/modal/README.md CHANGED
@@ -1,8 +1,20 @@
1
1
  # Modal
2
- Modal is a dynamically rendered element that floats above the rest of a page's content. It can be especially useful for interstitials that require additional user feedback.
2
+ Modal is a dynamically rendered element that floats above the rest of a page's content, requiring user interaction before returning to the main application.
3
3
 
4
- ## Basic Modal
5
- <design-land-example-viewer-container example="basic-modal"></design-land-example-viewer-container>
4
+ ## Overview
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
+
7
+ <daff-docs-example-viewer example="basic-modal"></daff-docs-example-viewer>
8
+
9
+ ## Best practices
10
+
11
+ **When to use**
12
+ - Display important information that require a user response
13
+ - Display non-essential but detailed content related to the underlying page
14
+
15
+ **When not to use**
16
+ - To display critical information or warnings
17
+ - To provide status feedback or messages (use [Notification](/libs/design/notification/README.md) or [Toast](/libs/design/toast/README.md) instead)
6
18
 
7
19
  ## Usage
8
20
 
@@ -46,31 +58,106 @@ export class CustomComponentModule { }
46
58
 
47
59
  > This method is deprecated. It's recommended to update all custom components to standalone.
48
60
 
49
- ## Supported Content Types
50
- A modal includes minimally pre-styled components and directives to help structure the content in your modal.
61
+ ## Anatomy
62
+ A modal consists of the following contents, displayed in the order listed:
51
63
 
52
64
  ### Header
53
- Header can be added to a modal by using `<daff-modal-header>`. The header includes a title and an optional close button.
65
+ **`<daff-modal-header>`**: The header section containing the title and optional close button.
54
66
 
55
67
  #### Title
56
- Title can be added to the header by using the `[daffModalTitle]` directive.
68
+ **`[daffModalTitle]`**: The primary text summarizing the modal.
57
69
 
58
- #### Close Button
70
+ #### Close button
59
71
  The close button in the header is shown by default but can be hidden by setting the `dismissible` property to `false` on the header.
60
72
 
61
73
  ### Content
62
- Content can be added to a modal by using `<daff-modal-content>`. It should only be used once. It's a wrapper container that can be used to place all additional components and text content within a modal. The content container allows for a ton of control and customization because it's minimally pre-styled and serves as a wrapping and spacing container that is scrollable.
74
+ **`<daff-modal-content>`**: The scrollable container for the modal's main content. Use this once per modal to wrap all body content.
63
75
 
64
76
  ### Actions
65
- Buttons can be added to a modal by using `<daff-modal-actions>`. This container will always be positioned at the bottom of a modal. The horizontal alignment of the actions is set to `end`.
77
+ **`<daff-modal-actions>`**: The container for action buttons, positioned at the bottom of the modal with right-aligned buttons. If two buttons are needed, place the primary button the left and the secondary button on the right.
78
+
79
+ ### Basic structure
80
+ ```html
81
+ <daff-modal-header>
82
+ <h2 daffModalTitle>Modal Title</h2>
83
+ </daff-modal-header>
84
+ <daff-modal-content>
85
+ <p>Modal content goes here</p>
86
+ </daff-modal-content>
87
+ <daff-modal-actions>
88
+ <button daff-button>Cancel</button>
89
+ <button daff-button color="primary">Confirm</button>
90
+ </daff-modal-actions>
91
+ ```
66
92
 
67
- ## Dismissing a Modal
68
- A modal can be dismissed via the close button or the `ESC` key. The close button is shown by default but can be hidden by setting the `dismissible` property to `false` on `<daff-modal-header>`. Additionally, the `[daffModalClose]` directive can be added to a `<button>` HTML element.
93
+ ## Dismissing a modal
94
+ A modal can be dismissed via:
95
+ - The close button in the header (shown by default)
96
+ - The `ESC` key
97
+ - A button with the `[daffModalClose]` directive within `<daff-modal-actions>`.
69
98
 
70
- ## Accessibility
71
- Modal works with the ARIA `role="dialog"` and `aria-modal="true"` attributes to provide an accessible experience. The first tabbable element will receive focus when a modal is opened.
99
+ To hide the close button, set `dismissible` to `false` on `<daff-modal-header>`:
72
100
 
73
- `aria-labelledby` is assigned the `[daffModalTitle]` string when it's used. If there is no title, `aria-labelledby` should be set in the configurations through the `DaffModalService`.
101
+ ```html
102
+ <daff-modal-header [dismissible]="false">
103
+ <h2 daffModalTitle>Modal Title</h2>
104
+ </daff-modal-header>
105
+ ```
106
+
107
+ ### Position configuration
108
+ By default, modals are horizontally and vertically centered on the screen. You can position a modal at the top of the screen by passing a `position` configuration when opening the modal:
109
+
110
+ ```ts
111
+ constructor(private modalService: DaffModalService) {}
112
+
113
+ showModal() {
114
+ this.modal = this.modalService.open(
115
+ ModalContentComponent,
116
+ {
117
+ position: {
118
+ vertical: 'top',
119
+ },
120
+ },
121
+ );
122
+ }
123
+ ```
124
+
125
+ You can also adjust how far from the top the modal appears by setting `offsetTop`:
126
+
127
+ ```ts
128
+ showModal() {
129
+ this.modal = this.modalService.open(
130
+ ModalContentComponent,
131
+ {
132
+ position: {
133
+ vertical: 'top',
134
+ offsetTop: '5rem',
135
+ }
136
+ },
137
+ );
138
+ }
139
+ ```
140
+
141
+ > Note: The horizontal position is always centered and cannot be customized.
142
+
143
+ ## Accessibility
144
+ Modal implements the [Dialog (Modal) WAI-ARIA design pattern](https://www.w3.org/WAI/ARIA/apg/patterns/dialog-modal/).
145
+
146
+ ### Daffodil provides
147
+ - `role="dialog"`
148
+ - `aria-modal="true"`
149
+ - `aria-labelledby` linked to the `[daffModalTitle]` element
150
+ - When opened, focus moves to the first tabbable element within the modal
151
+ - Focus is trapped within the modal while open
152
+ - When closed, focus returns to the element that triggered the modal
153
+
154
+ ### Developer responsibilities
155
+ - Provide an `aria-labelledby` through the `DafffModalService` if `[daffModalTitle]` is not used
156
+ - Add `aria-haspopup="dialog"` to the element that opens the modal
157
+
158
+ ```html
159
+ <button daff-button (click)="showModal()" aria-haspopup="dialog">Open Modal</button>
160
+ ```
74
161
 
75
162
  ```ts
76
163
  constructor(private modalService: DaffModalService) {}
@@ -83,5 +170,8 @@ showModal() {
83
170
  }
84
171
  ```
85
172
 
86
- ### Keyboard Interactions
87
- A modal can be closed by choosing one of the actions buttons, the close button in the header, or it can be dismissed by pressing the `ESC` key.
173
+ ### Keyboard interactions
174
+ | Key | Action |
175
+ | --- | ------ |
176
+ | `Tab` | Moves focus to the next focusable element within the modal. |
177
+ | `ESC` | Closes the modal and returns focus to the triggering element. |
package/modal/index.d.ts CHANGED
@@ -1,27 +1,70 @@
1
1
  import * as rxjs from 'rxjs';
2
- import { AnimationEvent } from '@angular/animations';
2
+ import { Observable } from 'rxjs';
3
3
  import { ConfigurableFocusTrapFactory } from '@angular/cdk/a11y';
4
4
  import * as i2 from '@angular/cdk/portal';
5
5
  import { ComponentPortal } from '@angular/cdk/portal';
6
6
  import * as i0 from '@angular/core';
7
- import { Type, AfterContentInit, AfterViewInit, OnDestroy, EventEmitter, ElementRef, ChangeDetectorRef, ComponentRef } from '@angular/core';
7
+ import { Type, AfterContentInit, AfterViewInit, OnDestroy, ElementRef, ChangeDetectorRef } from '@angular/core';
8
8
  import * as i1 from '@daffodil/design';
9
9
  import { DaffOpenable, DaffOpenableDirective, DaffFocusStackService } from '@daffodil/design';
10
10
  import * as i3 from '@angular/cdk/overlay';
11
- import { Overlay, OverlayRef } from '@angular/cdk/overlay';
11
+ import { Overlay } from '@angular/cdk/overlay';
12
12
  import * as i1$1 from '@angular/common';
13
13
  import * as i4 from '@daffodil/design/button';
14
14
  import * as i5 from '@fortawesome/angular-fontawesome';
15
15
  import * as _fortawesome_fontawesome_common_types from '@fortawesome/fontawesome-common-types';
16
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
+
35
+ type DaffModalVerticalPosition = 'top' | 'center';
36
+ interface DaffModalPosition {
37
+ /**
38
+ * The vertical position of the modal. Can be 'top' or 'center'.
39
+ */
40
+ vertical?: DaffModalVerticalPosition;
41
+ /**
42
+ * Optional offset from the top edge. Defaults to `10rem`.
43
+ */
44
+ offsetTop?: string;
45
+ }
17
46
  interface DaffModalConfiguration {
18
47
  /**
19
48
  * A hook for what to do when the backdrop behind a
20
49
  * DaffModalComponent is interacted with.
21
50
  */
22
51
  onBackdropClicked?: () => void;
23
- /** Sets the `aria-labelledby` property on the modal */
52
+ /** Sets the `aria-labelledby` property on the modal. */
24
53
  ariaLabelledBy?: string;
54
+ /**
55
+ * The position of the modal. If not provided, defaults to centered horizontally and vertically.
56
+ * Horizontal position is always center.
57
+ *
58
+ * @example
59
+ * ```ts
60
+ * // Center (default)
61
+ * { vertical: 'center' }
62
+ *
63
+ * // Top with offset
64
+ * { vertical: 'top', offsetTop: '2rem' }
65
+ * ```
66
+ */
67
+ position?: DaffModalPosition;
25
68
  }
26
69
 
27
70
  declare class DaffModalService {
@@ -31,9 +74,11 @@ declare class DaffModalService {
31
74
  private defaultConfiguration;
32
75
  private _attachModal;
33
76
  private _attachModalContent;
77
+ private _createPositionStrategy;
34
78
  private _createOverlayRef;
35
79
  private _removeModal;
36
- open(component: Type<any>, configuration?: Partial<DaffModalConfiguration>): DaffModalComponent;
80
+ private _closeAllModals;
81
+ open<T>(component: Type<T>, configuration?: Partial<DaffModalConfiguration>): DaffModalRef<T>;
37
82
  close(component: DaffModalComponent): void;
38
83
  static ɵfac: i0.ɵɵFactoryDeclaration<DaffModalService, never>;
39
84
  static ɵprov: i0.ɵɵInjectableDeclaration<DaffModalService>;
@@ -46,17 +91,21 @@ declare class DaffModalComponent implements AfterContentInit, AfterViewInit, OnD
46
91
  private openDirective;
47
92
  private _focusStack;
48
93
  private changeDetector;
94
+ private closing;
49
95
  private _ariaLabelledBy;
96
+ /**
97
+ * @docs-private
98
+ *
99
+ * By default, the `aria-labelledby` of the modal is set to the `id` of the modal title.
100
+ */
50
101
  get ariaLabelledBy(): string;
51
102
  set ariaLabelledBy(value: string);
52
103
  /**
104
+ * @docs-private
105
+ *
53
106
  * The CDK Portal outlet used to portal content into the modal.
54
107
  */
55
108
  private _portalOutlet;
56
- /**
57
- * Event fired when the close animation is completed.
58
- */
59
- animationCompleted: EventEmitter<any>;
60
109
  /**
61
110
  * Private subject for closed animation completion events.
62
111
  */
@@ -64,7 +113,7 @@ declare class DaffModalComponent implements AfterContentInit, AfterViewInit, OnD
64
113
  /**
65
114
  * Observable that emits when the close animation is completed.
66
115
  */
67
- readonly closedAnimationCompleted$: rxjs.Observable<AnimationEvent>;
116
+ readonly closedAnimationCompleted$: rxjs.Observable<boolean>;
68
117
  /**
69
118
  * @docs-private
70
119
  */
@@ -80,32 +129,31 @@ declare class DaffModalComponent implements AfterContentInit, AfterViewInit, OnD
80
129
  */
81
130
  ngAfterViewInit(): void;
82
131
  /**
132
+ * @docs-private
133
+ *
83
134
  * Helper method to attach portable content to modal.
84
135
  */
85
136
  attachContent(portal: ComponentPortal<any>): any;
86
- /** Animation hook that controls the entrance and exit animations of the modal. */
87
137
  /**
88
- * @docs-private
89
- */
90
- get fadeState(): string;
91
- /**
92
- * Animation event that can used to hook into when
93
- * animations are fully completed. We use this in the DaffModalService
94
- * to determine when to actually remove the dynamically rendered element from the DOM
95
- * so that the animation does not clip as the element is removed.
138
+ * Tracks the open state of the modal.
96
139
  */
97
- animationDone(e: AnimationEvent): void;
98
140
  get open(): boolean;
99
141
  /**
100
- * Reveals the modal
142
+ * @docs-private
143
+ *
144
+ * Reveals the modal.
101
145
  */
102
146
  reveal(): void;
103
147
  /**
104
- * Hides the modal
148
+ * @docs-private
149
+ *
150
+ * Hides the modal.
105
151
  */
106
152
  hide(): void;
107
153
  /**
108
- * Toggles the visibility of the modal
154
+ * @docs-private
155
+ *
156
+ * Toggles the visibility of the modal.
109
157
  */
110
158
  toggle(): void;
111
159
  /**
@@ -174,21 +222,10 @@ declare class DaffModalModule {
174
222
  static ɵinj: i0.ɵɵInjectorDeclaration<DaffModalModule>;
175
223
  }
176
224
 
177
- interface DaffModal {
178
- /**
179
- * The reference to the modal in question
180
- */
181
- modal: ComponentRef<DaffModalComponent>;
182
- /**
183
- * The overlay associated with a given modal.
184
- */
185
- overlay: OverlayRef;
186
- }
187
-
188
225
  /**
189
226
  * @docs-private
190
227
  */
191
228
  declare const DAFF_MODAL_COMPONENTS: readonly [typeof DaffModalHeaderComponent, typeof DaffModalTitleDirective, typeof DaffModalContentComponent, typeof DaffModalActionsComponent, typeof DaffModalCloseDirective];
192
229
 
193
230
  export { DAFF_MODAL_COMPONENTS, DaffModalActionsComponent, DaffModalCloseDirective, DaffModalComponent, DaffModalContentComponent, DaffModalHeaderComponent, DaffModalModule, DaffModalService, DaffModalTitleDirective };
194
- export type { DaffModal };
231
+ export type { DaffModalRef };
@@ -1,25 +1,62 @@
1
- # Native select
2
- The native select component allows a native HTML select element to work with the form field component.
1
+ # Native Select
2
+ Native select works alongside the HTML select element, with additional custom styling and functionality.
3
3
 
4
4
  ## Overview
5
- The native select component 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 [DaffFormFieldComponent](/libs/design/src/atoms/form/form-field/README.md).
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="default-select"></design-land-example-viewer-container>
7
+ <daff-docs-example-viewer example="basic-native-select"></daff-docs-example-viewer>
8
8
 
9
- ## Examples
9
+ ## Usage
10
+ To use native select, import `DAFF_NATIVE_SELECT_COMPONENTS` directly into your custom component:
10
11
 
11
- ### Disabled select
12
- <design-land-example-viewer-container example="disabled-select"></design-land-example-viewer-container>
12
+ ```ts
13
+ import { DAFF_NATIVE_SELECT_COMPONENTS } from '@daffodil/design/native-select';
13
14
 
14
- ### Select with error messages
15
- The select in this example uses the `ReactiveFormsModule` to display errors.
15
+ @Component({
16
+ selector: 'custom-component',
17
+ templateUrl: './custom-component.component.html',
18
+ imports: [
19
+ DAFF_NATIVE_SELECT_COMPONENTS,
20
+ ],
21
+ })
22
+ export class CustomComponent {}
23
+ ```
16
24
 
17
- <design-land-example-viewer-container example="select-with-error"></design-land-example-viewer-container>
25
+ ## Anatomy
26
+ Native select 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).
18
27
 
19
- ### Select with hint
20
- The select in this example has a hint.
28
+ ### Basic structure
29
+ ```html
30
+ <daff-form-field>
31
+ <daff-form-label>Sort By</daff-form-label>
32
+ <select daff-native-select>
33
+ <option value="price-low-high">Price: Low to High</option>
34
+ <option value="price-high-low">Price: High to Low</option>
35
+ <option value="newest">Newest Arrivals</option>
36
+ </select>
37
+ </daff-form-field>
38
+ ```
21
39
 
22
- <design-land-example-viewer-container example="select-with-hint"></design-land-example-viewer-container>
40
+ ## States
23
41
 
24
- ### Loading select
25
- <design-land-example-viewer-container example="skeleton-select"></design-land-example-viewer-container>
42
+ ### Disabled
43
+ Native select can be disabled in two ways: using Angular's reactive forms with `FormControl` or with the native HTML `disabled` attribute.
44
+
45
+ <daff-docs-example-viewer example="native-select-disabled"></daff-docs-example-viewer>
46
+
47
+ ### Error
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
+
50
+ <daff-docs-example-viewer example="native-select-error"></daff-docs-example-viewer>
51
+
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
+
54
+ ## Hints
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
+
57
+ <daff-docs-example-viewer example="native-select-hint"></daff-docs-example-viewer>
58
+
59
+ ## Accessibility
60
+ When `<daff-form-label>` is used within `<daff-form-field>`, the label automatically associates with the select using the `for` and `id` attributes.
61
+
62
+ 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.
@@ -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
  /**
package/navbar/README.md CHANGED
@@ -1,11 +1,10 @@
1
1
  # Navbar
2
- Navbar is a flexible and extensible, horizontally stacked component intended for major blocks of navigation links.
2
+ Navbar is a flexible and extensible component that provides a container for navigation elements.
3
3
 
4
4
  ## Overview
5
5
  The navbar contains minimal layout styles, allowing the content within it to be fluid and customizable. It utilizes the `flex` display and is customizable with all the flexbox properties. It's required to be used with the native HTML `<nav>` element to ensure an accessible experience by default.
6
6
 
7
- ## Basic Navbar
8
- <design-land-example-viewer-container example="basic-navbar"></design-land-example-viewer-container>
7
+ <daff-docs-example-viewer example="basic-navbar"></daff-docs-example-viewer>
9
8
 
10
9
  ## Usage
11
10
 
@@ -49,34 +48,41 @@ export class CustomComponentModule { }
49
48
 
50
49
  > This method is deprecated. It's recommended to update all custom components to standalone.
51
50
 
52
- ## Theming
53
- The default background color of a navbar is light gray, but it can be updated to one of the supported colors by using the `color` property.
51
+ ## Features
54
52
 
55
- Supported colors: `primary | secondary | tertiary | black | white | theme | theme-contrast`
53
+ ### Elevation
54
+ Use the `elevated` property to add a shadow effect to the navbar.
56
55
 
57
- <design-land-example-viewer-container example="navbar-theming"></design-land-example-viewer-container>
56
+ <daff-docs-example-viewer example="elevated-navbar"></daff-docs-example-viewer>
58
57
 
59
- ## Contained Navbar
60
- A navbar can be contained to a specific width by using the [Container](/libs/design/container/README.md) component. The layout styles set on the navbar will automatically be passed down to the container.
58
+ ### Blurred background
59
+ Use the `blurred` property to add a semi-transparent background effect to the navbar, creating a frosted glass appearance.
61
60
 
62
- <design-land-example-viewer-container example="contained-navbar"></design-land-example-viewer-container>
61
+ <daff-docs-example-viewer example="blurred-navbar"></daff-docs-example-viewer>
63
62
 
64
- ## Raised Navbar
65
- The raised property adds elevation to a navbar. To enable it, set the `raised` property on `<nav daff-navbar>`.
63
+ Both `elevated` and `blurred` can be combined for a layered effect:
66
64
 
67
- <design-land-example-viewer-container example="raised-navbar"></design-land-example-viewer-container>
65
+ ```html
66
+ <nav daff-navbar [elevated]="true" [blurred]="true">
67
+ <!-- navigation items -->
68
+ </nav>
69
+ ```
70
+
71
+ ### Contained navbar
72
+ A navbar can be contained to a specific width by using the [container](/libs/design/container/README.md) component. The layout styles set on the navbar will automatically be passed down to the container.
73
+
74
+ <daff-docs-example-viewer example="contained-navbar"></daff-docs-example-viewer>
68
75
 
69
76
  ## Accessibility
70
- Daffodil enforces the usage of the native `<nav>` HTML element to ensure an accessible experience by default. If more than one navbar is used, every navbar should be given a meaningful label by using the `aria-labelledby` attribute.
77
+ Daffodil enforces the usage of the native `<nav>` HTML element to ensure an accessible experience by default. If more than one navbar is used, every navbar should be given a meaningful label by using the `aria-label` attribute.
71
78
 
72
- ### Example
73
79
  ```html
74
- <nav daff-navbar aria-labelledby="main-navigation">
80
+ <nav daff-navbar aria-label="main navigation">
75
81
  <!-- navigation items -->
76
82
  </nav>
77
83
 
78
84
  <footer>
79
- <nav daff-navbar aria-labelledby="footer-navigation">
85
+ <nav daff-navbar aria-label="footer navigation">
80
86
  <!-- navigation items -->
81
87
  </nav>
82
88
  </footer>
package/navbar/index.d.ts CHANGED
@@ -2,10 +2,20 @@ import * as i0 from '@angular/core';
2
2
  import * as i1$1 from '@angular/common';
3
3
  import * as i1 from '@daffodil/design';
4
4
 
5
+ /**
6
+ * Navbar is a flexible and extensible component that provides a container for navigation elements.
7
+ */
5
8
  declare class DaffNavbarComponent {
6
- raised: boolean;
9
+ /**
10
+ * Whether the navbar should have an elevated appearance with a shadow effect.
11
+ */
12
+ elevated: i0.InputSignal<boolean>;
13
+ /**
14
+ * Whether the navbar should have a blurred background effect.
15
+ */
16
+ blurred: i0.InputSignal<boolean>;
7
17
  static ɵfac: i0.ɵɵFactoryDeclaration<DaffNavbarComponent, never>;
8
- static ɵcmp: i0.ɵɵComponentDeclaration<DaffNavbarComponent, "nav[daff-navbar]", never, { "raised": { "alias": "raised"; "required": false; }; }, {}, never, ["*"], true, [{ directive: typeof i1.DaffManageContainerLayoutDirective; inputs: {}; outputs: {}; }, { directive: typeof i1.DaffColorableDirective; inputs: { "color": "color"; }; outputs: {}; }]>;
18
+ static ɵcmp: i0.ɵɵComponentDeclaration<DaffNavbarComponent, "nav[daff-navbar]", never, { "elevated": { "alias": "elevated"; "required": false; "isSignal": true; }; "blurred": { "alias": "blurred"; "required": false; "isSignal": true; }; }, {}, never, ["*"], true, [{ directive: typeof i1.DaffManageContainerLayoutDirective; inputs: {}; outputs: {}; }]>;
9
19
  }
10
20
 
11
21
  /**
@@ -1,61 +1,19 @@
1
1
  @use '../../scss/theming' as *;
2
2
 
3
- @mixin daff-navbar-theme-variant($color) {
4
- background: $color;
5
- color: daff-text-contrast($color);
6
- }
7
-
8
3
  // stylelint-disable selector-class-pattern
9
4
  @mixin daff-navbar-theme($theme) {
10
- $primary: daff-get-palette($theme, primary);
11
- $secondary: daff-get-palette($theme, secondary);
12
- $tertiary: daff-get-palette($theme, tertiary);
13
- $neutral: daff-get-palette($theme, neutral);
14
5
  $base: daff-get-base-color($theme, base);
15
- $base-contrast: daff-get-base-color($theme, base-contrast);
16
- $white: daff-get-base-color($theme, 'white');
17
6
  $black: daff-get-base-color($theme, 'black');
18
- $mode: daff-get-theme-mode($theme);
19
7
 
20
8
  .daff-navbar {
21
- @include light($mode) {
22
- @include daff-navbar-theme-variant(daff-color($neutral, 10));
23
- }
9
+ background: $base;
24
10
 
25
- @include dark($mode) {
26
- @include daff-navbar-theme-variant(daff-color($neutral, 90));
11
+ &.blurred {
12
+ background: rgba($base, 0.5);
27
13
  }
28
14
 
29
- &.raised {
15
+ &.elevated {
30
16
  box-shadow: 0 4px 10px rgba($black, 0.08);
31
17
  }
32
-
33
- &.daff-primary {
34
- @include daff-navbar-theme-variant(daff-color($primary));
35
- }
36
-
37
- &.daff-secondary {
38
- @include daff-navbar-theme-variant(daff-color($secondary));
39
- }
40
-
41
- &.daff-tertiary {
42
- @include daff-navbar-theme-variant(daff-color($tertiary));
43
- }
44
-
45
- &.daff-black {
46
- @include daff-navbar-theme-variant($black);
47
- }
48
-
49
- &.daff-white {
50
- @include daff-navbar-theme-variant($white);
51
- }
52
-
53
- &.daff-theme {
54
- @include daff-navbar-theme-variant($base);
55
- }
56
-
57
- &.daff-theme-contrast {
58
- @include daff-navbar-theme-variant($base-contrast);
59
- }
60
18
  }
61
19
  }
@@ -6,7 +6,7 @@ Notifications display short messages that are closely associated with nearby con
6
6
 
7
7
  Notifications should not be used to display app-level alerts. For global messages, use the [Toast](/libs/design/toast/README.md) component.
8
8
 
9
- <design-land-example-viewer-container example="default-notification"></design-land-example-viewer-container>
9
+ <daff-docs-example-viewer example="default-notification"></daff-docs-example-viewer>
10
10
 
11
11
  ## Best practices
12
12
 
@@ -93,19 +93,19 @@ Use the `[daffPrefix]` element to add a decorative icon that provides a quick vi
93
93
  ### Status
94
94
  Use the `status` property to visually differentiate between notification types such as `info`, `warn`, `critical`, or `success`.
95
95
 
96
- <design-land-example-viewer-container example="notification-status"></design-land-example-viewer-container>
96
+ <daff-docs-example-viewer example="notification-status"></daff-docs-example-viewer>
97
97
 
98
98
  ### Orientation
99
99
  Use the `orientation` property to stack notification content either `vertical` (default) or `horizontal`.
100
100
 
101
- <design-land-example-viewer-container example="notification-orientations"></design-land-example-viewer-container>
101
+ <daff-docs-example-viewer example="notification-orientations"></daff-docs-example-viewer>
102
102
 
103
103
  ### Dismissing a notification
104
104
  Notifications are persistent by default. To display a close button, set the `dismissible` property to `true`.
105
105
 
106
106
  > Avoid making critical notifications dismissible to ensure users can read or interact with the necessary information.
107
107
 
108
- <design-land-example-viewer-container example="dismissible-notification"></design-land-example-viewer-container>
108
+ <daff-docs-example-viewer example="dismissible-notification"></daff-docs-example-viewer>
109
109
 
110
110
  ## Accessibility
111
111
  **Live region roles:**