@daffodil/design 0.81.1 → 0.83.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 (258) hide show
  1. package/accordion/README.md +44 -29
  2. package/accordion/accordion/accordion/accordion.component.d.ts +3 -0
  3. package/accordion/accordion/accordion-item/accordion-item.component.d.ts +23 -12
  4. package/accordion/accordion/accordion-item-title/accordion-item-title.directive.d.ts +3 -0
  5. package/accordion/accordion.d.ts +5 -0
  6. package/accordion/examples/disabled-accordion/disabled-accordion.component.d.ts +5 -0
  7. package/accordion/examples/initially-expanded-accordion/initially-expanded-accordion.component.d.ts +5 -0
  8. package/accordion/examples/public_api.d.ts +2 -0
  9. package/accordion/src/accordion-theme.scss +28 -6
  10. package/article/README.md +4 -3
  11. package/article/article.d.ts +3 -0
  12. package/article/src/article-theme.scss +128 -51
  13. package/breadcrumb/README.md +38 -28
  14. package/breadcrumb/breadcrumb/breadcrumb.component.d.ts +15 -2
  15. package/breadcrumb/breadcrumb-item/breadcrumb-item.directive.d.ts +18 -4
  16. package/breadcrumb/breadcrumb.d.ts +3 -0
  17. package/breadcrumb/examples/iterated-breadcrumb/iterated-breadcrumb.component.d.ts +6 -0
  18. package/breadcrumb/public_api.d.ts +2 -2
  19. package/button/README.md +43 -23
  20. package/button/button/basic/button.component.d.ts +5 -1
  21. package/button/button/button-base.directive.d.ts +11 -3
  22. package/button/button/button-sizable.directive.d.ts +1 -1
  23. package/button/button/raised/raised.component.d.ts +2 -0
  24. package/button/button/stroked/stroked.component.d.ts +5 -1
  25. package/button/button.d.ts +4 -2
  26. package/button/button.module.d.ts +1 -2
  27. package/button/examples/elevated-button/elevated-button.component.d.ts +6 -0
  28. package/button/examples/examples.d.ts +2 -1
  29. package/button/examples/public_api.d.ts +1 -0
  30. package/button/public_api.d.ts +0 -1
  31. package/button/src/button/basic/button-theme.scss +185 -80
  32. package/button/src/button/button-base.scss +41 -16
  33. package/button/src/button/flat/flat-theme.scss +144 -85
  34. package/button/src/button/icon/icon-theme.scss +183 -79
  35. package/button/src/button/raised/raised-theme.scss +2 -7
  36. package/button/src/button/stroked/stroked-theme.scss +128 -94
  37. package/button/src/button/underline/underline-theme.scss +112 -44
  38. package/callout/README.md +4 -3
  39. package/callout/callout.d.ts +3 -0
  40. package/card/README.md +6 -3
  41. package/card/card/basic/basic.component.d.ts +7 -0
  42. package/card/card/raised/raised.component.d.ts +7 -0
  43. package/card/card/stroked/stroked.component.d.ts +7 -0
  44. package/card/card-base.directive.d.ts +25 -0
  45. package/card/card.d.ts +18 -1
  46. package/card/card.module.d.ts +10 -8
  47. package/card/examples/card-theming/card-theming.component.d.ts +2 -1
  48. package/card/examples/public_api.d.ts +1 -1
  49. package/card/public_api.d.ts +6 -1
  50. package/card/src/card/raised/raised-theme.scss +30 -0
  51. package/card/src/card/stroked/stroked-theme.scss +135 -0
  52. package/card/src/card-base-theme.scss +197 -0
  53. package/card/src/card-base.scss +134 -0
  54. package/container/README.md +5 -3
  55. package/container/container.d.ts +3 -0
  56. package/core/colorable/colorable.d.ts +20 -14
  57. package/core/colorable/colorable.directive.d.ts +9 -6
  58. package/fesm2022/daffodil-design-accordion-examples.mjs +28 -4
  59. package/fesm2022/daffodil-design-accordion-examples.mjs.map +1 -1
  60. package/fesm2022/daffodil-design-accordion.mjs +56 -29
  61. package/fesm2022/daffodil-design-accordion.mjs.map +1 -1
  62. package/fesm2022/daffodil-design-article-examples.mjs +30 -30
  63. package/fesm2022/daffodil-design-article.mjs +14 -11
  64. package/fesm2022/daffodil-design-article.mjs.map +1 -1
  65. package/fesm2022/daffodil-design-breadcrumb-examples.mjs +24 -4
  66. package/fesm2022/daffodil-design-breadcrumb-examples.mjs.map +1 -1
  67. package/fesm2022/daffodil-design-breadcrumb.mjs +78 -40
  68. package/fesm2022/daffodil-design-breadcrumb.mjs.map +1 -1
  69. package/fesm2022/daffodil-design-button-examples.mjs +55 -33
  70. package/fesm2022/daffodil-design-button-examples.mjs.map +1 -1
  71. package/fesm2022/daffodil-design-button.mjs +79 -69
  72. package/fesm2022/daffodil-design-button.mjs.map +1 -1
  73. package/fesm2022/daffodil-design-callout-examples.mjs +12 -12
  74. package/fesm2022/daffodil-design-callout-examples.mjs.map +1 -1
  75. package/fesm2022/daffodil-design-callout.mjs +25 -22
  76. package/fesm2022/daffodil-design-callout.mjs.map +1 -1
  77. package/fesm2022/daffodil-design-card-examples.mjs +35 -31
  78. package/fesm2022/daffodil-design-card-examples.mjs.map +1 -1
  79. package/fesm2022/daffodil-design-card.mjs +140 -86
  80. package/fesm2022/daffodil-design-card.mjs.map +1 -1
  81. package/fesm2022/daffodil-design-checkbox-examples.mjs +6 -6
  82. package/fesm2022/daffodil-design-checkbox-examples.mjs.map +1 -1
  83. package/fesm2022/daffodil-design-container-examples.mjs +3 -3
  84. package/fesm2022/daffodil-design-container.mjs +10 -7
  85. package/fesm2022/daffodil-design-container.mjs.map +1 -1
  86. package/fesm2022/daffodil-design-hero-examples.mjs +12 -12
  87. package/fesm2022/daffodil-design-hero-examples.mjs.map +1 -1
  88. package/fesm2022/daffodil-design-hero.mjs +25 -22
  89. package/fesm2022/daffodil-design-hero.mjs.map +1 -1
  90. package/fesm2022/daffodil-design-image-examples.mjs +9 -9
  91. package/fesm2022/daffodil-design-image.mjs +36 -19
  92. package/fesm2022/daffodil-design-image.mjs.map +1 -1
  93. package/fesm2022/daffodil-design-input-examples.mjs +12 -12
  94. package/fesm2022/daffodil-design-link-set.mjs +19 -16
  95. package/fesm2022/daffodil-design-link-set.mjs.map +1 -1
  96. package/fesm2022/daffodil-design-list-examples.mjs +12 -12
  97. package/fesm2022/daffodil-design-list.mjs +13 -10
  98. package/fesm2022/daffodil-design-list.mjs.map +1 -1
  99. package/fesm2022/daffodil-design-loading-icon-examples.mjs +4 -4
  100. package/fesm2022/daffodil-design-loading-icon-examples.mjs.map +1 -1
  101. package/fesm2022/daffodil-design-loading-icon.mjs +11 -8
  102. package/fesm2022/daffodil-design-loading-icon.mjs.map +1 -1
  103. package/fesm2022/daffodil-design-media-gallery-examples.mjs +62 -13
  104. package/fesm2022/daffodil-design-media-gallery-examples.mjs.map +1 -1
  105. package/fesm2022/daffodil-design-media-gallery.mjs +204 -250
  106. package/fesm2022/daffodil-design-media-gallery.mjs.map +1 -1
  107. package/fesm2022/daffodil-design-menu-examples.mjs +6 -6
  108. package/fesm2022/daffodil-design-menu-examples.mjs.map +1 -1
  109. package/fesm2022/daffodil-design-menu.mjs +16 -16
  110. package/fesm2022/daffodil-design-modal-examples.mjs +7 -7
  111. package/fesm2022/daffodil-design-modal-examples.mjs.map +1 -1
  112. package/fesm2022/daffodil-design-modal.mjs +28 -25
  113. package/fesm2022/daffodil-design-modal.mjs.map +1 -1
  114. package/fesm2022/daffodil-design-navbar-examples.mjs +12 -12
  115. package/fesm2022/daffodil-design-navbar-examples.mjs.map +1 -1
  116. package/fesm2022/daffodil-design-navbar.mjs +10 -7
  117. package/fesm2022/daffodil-design-navbar.mjs.map +1 -1
  118. package/fesm2022/daffodil-design-notification-examples.mjs +17 -16
  119. package/fesm2022/daffodil-design-notification-examples.mjs.map +1 -1
  120. package/fesm2022/daffodil-design-notification.mjs +23 -20
  121. package/fesm2022/daffodil-design-notification.mjs.map +1 -1
  122. package/fesm2022/daffodil-design-paginator-examples.mjs +6 -6
  123. package/fesm2022/daffodil-design-paginator.mjs +13 -7
  124. package/fesm2022/daffodil-design-paginator.mjs.map +1 -1
  125. package/fesm2022/daffodil-design-progress-bar-examples.mjs +10 -10
  126. package/fesm2022/daffodil-design-progress-bar-examples.mjs.map +1 -1
  127. package/fesm2022/daffodil-design-progress-bar.mjs +13 -13
  128. package/fesm2022/daffodil-design-progress-bar.mjs.map +1 -1
  129. package/fesm2022/daffodil-design-quantity-field-examples.mjs +12 -12
  130. package/fesm2022/daffodil-design-radio-examples.mjs +3 -3
  131. package/fesm2022/daffodil-design-sidebar-examples.mjs +14 -14
  132. package/fesm2022/daffodil-design-sidebar-examples.mjs.map +1 -1
  133. package/fesm2022/daffodil-design-sidebar.mjs +150 -61
  134. package/fesm2022/daffodil-design-sidebar.mjs.map +1 -1
  135. package/fesm2022/daffodil-design-switch-examples.mjs +15 -15
  136. package/fesm2022/daffodil-design-switch-examples.mjs.map +1 -1
  137. package/fesm2022/daffodil-design-switch.mjs +38 -10
  138. package/fesm2022/daffodil-design-switch.mjs.map +1 -1
  139. package/fesm2022/daffodil-design-tabs-examples.mjs +23 -17
  140. package/fesm2022/daffodil-design-tabs-examples.mjs.map +1 -1
  141. package/fesm2022/daffodil-design-tabs.mjs +67 -35
  142. package/fesm2022/daffodil-design-tabs.mjs.map +1 -1
  143. package/fesm2022/daffodil-design-text-snippet-examples.mjs +3 -3
  144. package/fesm2022/daffodil-design-text-snippet.mjs +4 -5
  145. package/fesm2022/daffodil-design-text-snippet.mjs.map +1 -1
  146. package/fesm2022/daffodil-design-toast-examples.mjs +40 -15
  147. package/fesm2022/daffodil-design-toast-examples.mjs.map +1 -1
  148. package/fesm2022/daffodil-design-toast.mjs +296 -239
  149. package/fesm2022/daffodil-design-toast.mjs.map +1 -1
  150. package/fesm2022/daffodil-design-tree-examples.mjs +6 -6
  151. package/fesm2022/daffodil-design-tree.mjs +15 -12
  152. package/fesm2022/daffodil-design-tree.mjs.map +1 -1
  153. package/fesm2022/daffodil-design-youtube-player.mjs +104 -0
  154. package/fesm2022/daffodil-design-youtube-player.mjs.map +1 -0
  155. package/fesm2022/daffodil-design.mjs +167 -155
  156. package/fesm2022/daffodil-design.mjs.map +1 -1
  157. package/hero/README.md +4 -3
  158. package/hero/hero.d.ts +3 -0
  159. package/image/README.md +4 -3
  160. package/image/image/image.component.d.ts +22 -1
  161. package/image/image.d.ts +3 -0
  162. package/link-set/README.md +4 -3
  163. package/link-set/link-set.d.ts +3 -0
  164. package/list/README.md +4 -3
  165. package/list/list.d.ts +3 -0
  166. package/loading-icon/README.md +10 -7
  167. package/loading-icon/loading-icon.d.ts +3 -0
  168. package/loading-icon/src/loading-icon-theme.scss +66 -38
  169. package/media-gallery/README.md +19 -10
  170. package/media-gallery/examples/iterated-media-gallery/iterated-media-gallery.component.d.ts +13 -0
  171. package/media-gallery/examples/media-gallery-with-video/media-gallery-with-video.component.d.ts +5 -0
  172. package/media-gallery/examples/public_api.d.ts +2 -0
  173. package/media-gallery/helpers/media-gallery-registration.interface.d.ts +1 -1
  174. package/media-gallery/media-gallery/media-gallery.component.d.ts +89 -11
  175. package/media-gallery/media-gallery.d.ts +4 -2
  176. package/media-gallery/media-gallery.module.d.ts +1 -2
  177. package/media-gallery/public_api.d.ts +3 -4
  178. package/media-gallery/src/media-gallery-theme.scss +30 -4
  179. package/media-gallery/thumbnail/thumbnail.directive.d.ts +45 -22
  180. package/menu/README.md +1 -2
  181. package/modal/README.md +3 -2
  182. package/modal/modal.d.ts +3 -0
  183. package/navbar/README.md +3 -2
  184. package/navbar/navbar.d.ts +3 -0
  185. package/notification/README.md +5 -4
  186. package/notification/notification.d.ts +3 -0
  187. package/notification/src/notification-theme.scss +62 -23
  188. package/package.json +1 -1
  189. package/paginator/README.md +3 -2
  190. package/paginator/paginator/paginator.component.d.ts +3 -0
  191. package/paginator/paginator.d.ts +3 -0
  192. package/progress-bar/README.md +5 -6
  193. package/progress-bar/progress-bar.component.d.ts +0 -3
  194. package/progress-bar/progress-bar.d.ts +3 -0
  195. package/progress-bar/src/progress-bar-theme.scss +17 -8
  196. package/scss/theme.scss +36 -17
  197. package/scss/theming/_configure-theme.scss +2 -0
  198. package/scss/theming/_index.scss +1 -0
  199. package/scss/theming/_light-dark.scss +45 -0
  200. package/sidebar/README.md +20 -21
  201. package/sidebar/helper/sidebar-mode.d.ts +9 -15
  202. package/sidebar/public_api.d.ts +10 -11
  203. package/sidebar/sidebar/sidebar.component.d.ts +22 -7
  204. package/sidebar/sidebar-footer/sidebar-footer.component.d.ts +11 -0
  205. package/sidebar/sidebar-header/sidebar-header-title/sidebar-header-title.directive.d.ts +8 -0
  206. package/sidebar/sidebar-header/sidebar-header.component.d.ts +19 -1
  207. package/sidebar/sidebar-viewport/sidebar-viewport.component.d.ts +36 -15
  208. package/sidebar/sidebar-viewport-backdrop/sidebar-viewport-backdrop.component.d.ts +17 -0
  209. package/sidebar/sidebar.d.ts +4 -2
  210. package/sidebar/sidebar.module.d.ts +1 -2
  211. package/switch/README.md +3 -2
  212. package/switch/src/switch-theme.scss +29 -10
  213. package/switch/switch/switch.component.d.ts +31 -6
  214. package/switch/switch.d.ts +3 -0
  215. package/tabs/README.md +33 -3
  216. package/tabs/src/tabs-theme.scss +31 -13
  217. package/tabs/tabs/tab/tab.component.d.ts +1 -1
  218. package/tabs/tabs/tab-label/tab-label.component.d.ts +6 -0
  219. package/tabs/tabs/tab-panel/tab-panel.component.d.ts +8 -0
  220. package/tabs/tabs/tabs.component.d.ts +21 -4
  221. package/tabs/tabs.d.ts +8 -2
  222. package/text-snippet/README.md +19 -1
  223. package/toast/README.md +21 -151
  224. package/toast/examples/dismissible-toast/dismissible-toast.component.d.ts +11 -0
  225. package/toast/examples/public_api.d.ts +2 -1
  226. package/toast/interfaces/toast-action.d.ts +22 -11
  227. package/toast/interfaces/toast-action.type.d.ts +10 -0
  228. package/toast/interfaces/toast.d.ts +11 -5
  229. package/toast/options/daff-toast-options.d.ts +2 -1
  230. package/toast/public_api.d.ts +2 -6
  231. package/toast/service/position.service.d.ts +9 -1
  232. package/toast/service/toast.service.d.ts +63 -0
  233. package/toast/src/toast-theme.scss +80 -33
  234. package/toast/toast/toast-config.d.ts +24 -1
  235. package/toast/toast/toast-provider.d.ts +16 -0
  236. package/toast/toast/toast.component.d.ts +20 -1
  237. package/toast/toast-actions/toast-actions.directive.d.ts +3 -0
  238. package/toast/toast-message/toast-message.directive.d.ts +3 -0
  239. package/toast/toast-title/toast-title.directive.d.ts +3 -0
  240. package/tree/README.md +6 -10
  241. package/tree/src/tree-theme.scss +39 -13
  242. package/tree/tree.d.ts +3 -0
  243. package/youtube-player/index.d.ts +1 -0
  244. package/youtube-player/public_api.d.ts +3 -0
  245. package/youtube-player/safe-url.pipe.d.ts +10 -0
  246. package/youtube-player/youtube-player.component.d.ts +23 -0
  247. package/youtube-player/youtube-player.d.ts +6 -0
  248. package/card/card/card.component.d.ts +0 -48
  249. package/card/src/card-theme-variants/basic-card.scss +0 -6
  250. package/card/src/card-theme-variants/linkable-card.scss +0 -16
  251. package/card/src/card-theme-variants/stroked-card.scss +0 -3
  252. package/card/src/card-theme.scss +0 -170
  253. package/media-gallery/media-renderer/media-renderer.component.d.ts +0 -29
  254. package/media-gallery/registry/media-gallery.registry.d.ts +0 -34
  255. package/media-gallery/thumbnail/thumbnail-compat.token.d.ts +0 -1
  256. package/media-gallery/thumbnail/thumbnail-registration.interface.d.ts +0 -9
  257. package/scss/theming/prebuilt/internal-theme.scss +0 -13
  258. package/toast/toast.module.d.ts +0 -19
@@ -2,28 +2,26 @@
2
2
  An accordion is a group of vertically stacked headings used to toggle the visibility of a section of content.
3
3
 
4
4
  ## Overview
5
- Accordions are made up of `<daff-accordion-item>`s that can be expanded or collapsed to display large amounts of information. Accordions are helpful to shorten pages and reduce scrolling by hiding content that's not crucial to display at all times.
5
+ Accordions are helpful to shorten pages and reduce scrolling by hiding content that's not crucial to display at all times. The accordion component consists of several pre-styled components and directives.
6
6
 
7
7
  <design-land-example-viewer-container example="basic-accordion"></design-land-example-viewer-container>
8
8
 
9
- ## Supported Content Types
10
- An accordion item can include a `[daffAccordionItemTitle]`, which provides a high level overview of the content. Any other content within an accordion item will be displayed as the primary content.
9
+ ## Formatting
10
+ Accordions are built using `<daff-accordion>`, `<daff-accordion-item>`, and `[daffAccordionItemTitle]`.
11
11
 
12
- By default, the accordion item includes a toggle icon at the end of the header to indicate if it's expanded or collapsed.
12
+ - **`<daff-accordion>`**: A wrapper for grouping accordion items.
13
+ - **`<daff-accordion-item>`**: The wrapper for the title and content. It handles the expansion and collapse of the inner content when clicked.
14
+ - **`[daffAccordionItemTitle]`**: Used to provide a high level overview of the content.
13
15
 
14
- ### Setting an item to be expanded by default
15
- An item content can be visibile on render by setting the `initiallyExpanded` property to `true` on `daff-accordion-item`.
16
+ Any additional content placed inside of an accordion item will be displayed as part of the collapsible content.
16
17
 
17
18
  ## Usage
18
-
19
- ### Within a standalone component
20
- To use accordion in a standalone component, import it directly into your custom component:
21
-
22
19
  ```ts
20
+ import { DAFF_ACCORDION_COMPONENTS } from '@daffodil/design/accordion';
21
+
23
22
  @Component({
24
23
  selector: 'custom-component',
25
24
  templateUrl: './custom-component.component.html',
26
- standalone: true,
27
25
  imports: [
28
26
  DAFF_ACCORDION_COMPONENTS,
29
27
  ],
@@ -31,26 +29,43 @@ To use accordion in a standalone component, import it directly into your custom
31
29
  export class CustomComponent {}
32
30
  ```
33
31
 
34
- ### Within a module (deprecated)
35
- To use accordion in a module, import `DaffAccordionModule` into your custom module:
32
+ ```html
33
+ <daff-accordion>
34
+ <daff-accordion-item>
35
+ <div daffAccordionItemTitle></div>
36
+ <p>Item Content</p>
37
+ </daff-accordion-item>
38
+ <daff-accordion-item>
39
+ <div daffAccordionItemTitle></div>
40
+ <p>Item Content</p>
41
+ </daff-accordion-item>
42
+ </daff-accordion>
43
+ ```
36
44
 
37
- ```ts
38
- import { NgModule } from '@angular/core';
45
+ ## Examples
39
46
 
40
- import { DaffAccordionModule } from '@daffodil/design/accordion';
47
+ ### Expand an item by default
48
+ Use the `initiallyExpanded` property on the accordion item to have it opened by default.
41
49
 
42
- @NgModule({
43
- declarations: [
44
- CustomComponent,
45
- ],
46
- exports: [
47
- CustomComponent,
48
- ],
49
- imports: [
50
- DaffAccordionModule,
51
- ],
52
- })
53
- export class CustomComponentModule { }
50
+ ```html
51
+ <daff-accordion-item [initiallyExpanded]="true"></daff-accordion-item>
54
52
  ```
55
53
 
56
- > This method is deprecated. It's recommended to update all custom components to standalone.
54
+ ### Disable an item
55
+ Use the `disabled` property on the accordion item to prevent it from being expanded or collapsed.
56
+
57
+ ```html
58
+ <daff-accordion-item [disabled]="true"></daff-accordion-item>
59
+ ```
60
+
61
+ ## Accessibility
62
+ Accordion follows the [Accordion WAI-ARIA design pattern](https://www.w3.org/WAI/ARIA/apg/patterns/accordion/).
63
+
64
+ - Titles have an `id`, the `button` role, the `aria-expanded` state, and the `aria-controls` property set to the ID specified by the `contentId` property. It uses an autogenerated value by default but can be customized.
65
+ - Content blocks have an `id`, the `region` role, and the `aria-labelledby` property set to the ID specified by the `itemId` property. It uses an autogenerated value by default but can be customized.
66
+
67
+ ### Keyboard interactions
68
+ | Key | Action |
69
+ | --- | ------ |
70
+ | `Tab` | Moves focus to the next focusable element. |
71
+ | `Space` or `Enter` | When focus is on the accordion item, it collapses or expands the associated content panel. |
@@ -1,5 +1,8 @@
1
1
  import * as i0 from "@angular/core";
2
2
  import * as i1 from "@daffodil/design";
3
+ /**
4
+ * A wrapper for grouping accordion items.
5
+ */
3
6
  export declare class DaffAccordionComponent {
4
7
  static ɵfac: i0.ɵɵFactoryDeclaration<DaffAccordionComponent, never>;
5
8
  static ɵcmp: i0.ɵɵComponentDeclaration<DaffAccordionComponent, "daff-accordion", never, {}, {}, never, ["*"], true, [{ directive: typeof i1.DaffArticleEncapsulatedDirective; inputs: {}; outputs: {}; }]>;
@@ -2,24 +2,32 @@ import { OnInit } from '@angular/core';
2
2
  import { DaffOpenable, DaffOpenableDirective } from '@daffodil/design';
3
3
  import * as i0 from "@angular/core";
4
4
  import * as i1 from "@daffodil/design";
5
+ /**
6
+ * The wrapper for the title and content. It handles the expansion and collapse of the inner content when clicked.
7
+ * All `daff-accordion-item`s should be grouped inside the `daff-accordion` component.
8
+ */
5
9
  export declare class DaffAccordionItemComponent implements OnInit, DaffOpenable {
6
10
  private openDirective;
7
11
  /**
8
12
  * @docs-private
9
13
  */
10
- faChevronDown: import("@fortawesome/fontawesome-common-types").IconDefinition;
14
+ class: boolean;
11
15
  /**
12
- * @docs-private
16
+ * The unique id of an accordion item. Defaults to an autogenerated value.
13
17
  */
14
- faChevronUp: import("@fortawesome/fontawesome-common-types").IconDefinition;
18
+ itemId: string;
15
19
  /**
16
- * @docs-private
20
+ * The unique id of an accordion item content. Defaults to an autogenerated value.
21
+ */
22
+ contentId: string;
23
+ /**
24
+ * Whether or not the item is initially opened by default.
17
25
  */
18
- class: boolean;
19
- _daffAccordionItemId: string;
20
- id: string;
21
- /** Whether or not the item is initiallyExpanded by default. */
22
26
  initiallyExpanded: boolean;
27
+ /**
28
+ * Disables an accordion item and prevents it from being expanded or collapsed.
29
+ */
30
+ disabled: boolean;
23
31
  /**
24
32
  * @docs-private
25
33
  */
@@ -29,19 +37,22 @@ export declare class DaffAccordionItemComponent implements OnInit, DaffOpenable
29
37
  * @docs-private
30
38
  */
31
39
  ngOnInit(): void;
40
+ /**
41
+ * @docs-private
42
+ */
32
43
  get open(): boolean;
33
44
  /**
34
- * Reveals the contents of the accordion item
45
+ * Reveals the contents of the accordion item.
35
46
  */
36
47
  reveal(): void;
37
48
  /**
38
- * Hides the contents of the accordion item
49
+ * Hides the contents of the accordion item.
39
50
  */
40
51
  hide(): void;
41
52
  /**
42
- * Toggles the visibility of the contents of the accordion item
53
+ * Toggles the visibility of the contents of the accordion item.
43
54
  */
44
55
  toggle(): void;
45
56
  static ɵfac: i0.ɵɵFactoryDeclaration<DaffAccordionItemComponent, never>;
46
- static ɵcmp: i0.ɵɵComponentDeclaration<DaffAccordionItemComponent, "daff-accordion-item", never, { "id": { "alias": "id"; "required": false; }; "initiallyExpanded": { "alias": "initiallyExpanded"; "required": false; }; }, {}, never, ["[daffAccordionItemTitle]", "*"], true, [{ directive: typeof i1.DaffOpenableDirective; inputs: { "open": "open"; }; outputs: { "toggled": "toggled"; }; }]>;
57
+ static ɵcmp: i0.ɵɵComponentDeclaration<DaffAccordionItemComponent, "daff-accordion-item", never, { "itemId": { "alias": "itemId"; "required": false; }; "contentId": { "alias": "contentId"; "required": false; }; "initiallyExpanded": { "alias": "initiallyExpanded"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; }, {}, never, ["[daffAccordionItemTitle]", "*"], true, [{ directive: typeof i1.DaffOpenableDirective; inputs: { "open": "open"; }; outputs: { "toggled": "toggled"; }; }]>;
47
58
  }
@@ -1,4 +1,7 @@
1
1
  import * as i0 from "@angular/core";
2
+ /**
3
+ * Used to provide a high level overview of the content. It should be wrapped by a `<daff-accordion-item>`.
4
+ */
2
5
  export declare class DaffAccordionItemTitleDirective {
3
6
  /**
4
7
  * @docs-private
@@ -1,4 +1,9 @@
1
1
  import { DaffAccordionComponent } from './accordion/accordion/accordion.component';
2
2
  import { DaffAccordionItemComponent } from './accordion/accordion-item/accordion-item.component';
3
3
  import { DaffAccordionItemTitleDirective } from './accordion/accordion-item-title/accordion-item-title.directive';
4
+ /**
5
+ * @docs-private
6
+ *
7
+ * `DAFF_ACCORDION_COMPONENTS` imports all the available components and directives related to the component.
8
+ */
4
9
  export declare const DAFF_ACCORDION_COMPONENTS: readonly [typeof DaffAccordionComponent, typeof DaffAccordionItemComponent, typeof DaffAccordionItemTitleDirective];
@@ -0,0 +1,5 @@
1
+ import * as i0 from "@angular/core";
2
+ export declare class DisabledAccordionComponent {
3
+ static ɵfac: i0.ɵɵFactoryDeclaration<DisabledAccordionComponent, never>;
4
+ static ɵcmp: i0.ɵɵComponentDeclaration<DisabledAccordionComponent, "disabled-accordion", never, {}, {}, never, never, true, never>;
5
+ }
@@ -0,0 +1,5 @@
1
+ import * as i0 from "@angular/core";
2
+ export declare class InitiallyExpandedAccordionComponent {
3
+ static ɵfac: i0.ɵɵFactoryDeclaration<InitiallyExpandedAccordionComponent, never>;
4
+ static ɵcmp: i0.ɵɵComponentDeclaration<InitiallyExpandedAccordionComponent, "initially-expanded-accordion", never, {}, {}, never, never, true, never>;
5
+ }
@@ -1,2 +1,4 @@
1
1
  export { BasicAccordionComponent } from './basic-accordion/basic-accordion.component';
2
+ export { InitiallyExpandedAccordionComponent } from './initially-expanded-accordion/initially-expanded-accordion.component';
3
+ export { DisabledAccordionComponent } from './disabled-accordion/disabled-accordion.component';
2
4
  export { ACCORDION_EXAMPLES } from './examples';
@@ -5,17 +5,39 @@
5
5
  @mixin daff-accordion-theme($theme) {
6
6
  $neutral: core.daff-map-get($theme, 'core', 'neutral');
7
7
  $base: core.daff-map-get($theme, 'core', 'base');
8
+ $base-contrast: core.daff-map-get($theme, 'core', 'base-contrast');
9
+ $type: core.daff-map-get($theme, 'core', 'type');
8
10
 
9
11
  .daff-accordion-item {
10
- border-top: 1px solid theming.daff-illuminate($base, $neutral, 2);
12
+ @include theming.light($type) {
13
+ border-top: 1px solid theming.daff-color($neutral, 20);
11
14
 
12
- &:last-child {
13
- border-bottom: 1px solid theming.daff-illuminate($base, $neutral, 2);
15
+ &:last-child {
16
+ border-bottom: 1px solid theming.daff-color($neutral, 20);
17
+ }
18
+
19
+ .daff-accordion-item__header {
20
+ color: $base-contrast;
21
+
22
+ &::after {
23
+ border-color: $base-contrast;
24
+ }
25
+ }
14
26
  }
15
27
 
16
- &__header {
17
- &::after {
18
- border-color: currentColor;
28
+ @include theming.dark($type) {
29
+ border-top: 1px solid theming.daff-color($neutral, 80);
30
+
31
+ &:last-child {
32
+ border-bottom: 1px solid theming.daff-color($neutral, 80);
33
+ }
34
+
35
+ .daff-accordion-item__header {
36
+ color: $base-contrast;
37
+
38
+ &::after {
39
+ border-color: $base-contrast;
40
+ }
19
41
  }
20
42
  }
21
43
  }
package/article/README.md CHANGED
@@ -51,13 +51,14 @@ Articles also support other custom "non-native" components like [accordions](/li
51
51
  ## Usage
52
52
 
53
53
  ### Within a standalone component
54
- To use article in a standalone component, import it directly into your custom component:
54
+ To use article in a standalone component, import `DAFF_ARTICLE_COMPONENTS` directly into your custom component:
55
55
 
56
56
  ```ts
57
+ import { DAFF_ARTICLE_COMPONENTS } from '@daffodil/design/article';
58
+
57
59
  @Component({
58
60
  selector: 'custom-component',
59
61
  templateUrl: './custom-component.component.html',
60
- standalone: true,
61
62
  imports: [
62
63
  DAFF_ARTICLE_COMPONENTS,
63
64
  ],
@@ -70,8 +71,8 @@ To use article in a module, import `DaffArticleModule` into your custom module:
70
71
 
71
72
  ```ts
72
73
  import { NgModule } from '@angular/core';
73
-
74
74
  import { DaffArticleModule } from '@daffodil/design/article';
75
+ import { CustomComponent } from './custom.component';
75
76
 
76
77
  @NgModule({
77
78
  declarations: [
@@ -1,3 +1,6 @@
1
1
  import { DaffArticleComponent } from './article/article.component';
2
2
  import { DaffArticleMetaDirective } from './article-meta/article-meta.directive';
3
+ /**
4
+ * @docs-private
5
+ */
3
6
  export declare const DAFF_ARTICLE_COMPONENTS: readonly [typeof DaffArticleComponent, typeof DaffArticleMetaDirective];
@@ -5,83 +5,160 @@
5
5
 
6
6
  @mixin daff-article-theme($theme) {
7
7
  $primary: core.daff-map-get($theme, primary);
8
- $secondary: core.daff-map-get($theme, secondary);
9
- $tertiary: core.daff-map-get($theme, tertiary);
10
- $base: core.daff-map-get($theme, 'core', 'base');
11
- $base-contrast: core.daff-map-get($theme, 'core', 'base-contrast');
12
- $white: core.daff-map-get($theme, 'core', 'white');
13
- $black: core.daff-map-get($theme, 'core', 'black');
14
8
  $neutral: core.daff-map-get($theme, 'core', 'neutral');
9
+ $type: core.daff-map-get($theme, 'core', 'type');
15
10
 
16
- $text-color: theming.daff-illuminate($base-contrast, $neutral, 2);
17
- $table-border-color: theming.daff-illuminate($base, $neutral, 2);
11
+ $link-color-light: theming.daff-color($primary);
12
+ $link-color-dark: theming.daff-color($primary, 40);
13
+ $text-color-light: theming.daff-color($neutral, 90);
14
+ $text-color-dark: theming.daff-color($neutral, 10);
15
+ $table-border-light: theming.daff-color($neutral, 20);
16
+ $table-border-dark: theming.daff-color($neutral, 80);
18
17
 
19
18
  .daff-article {
20
- color: $text-color;
19
+ @include theming.light($type) {
20
+ color: $text-color-light;
21
21
 
22
- &__meta {
23
- color: theming.daff-illuminate($base-contrast, $neutral, 3);
24
- }
25
-
26
- @include stopsArticleCascade(a) {
27
- color: theming.daff-color($primary);
22
+ @include stopsArticleCascade(a) {
23
+ color: $link-color-light;
24
+ text-decoration-color: $link-color-light;
25
+ }
28
26
 
29
27
  code {
30
- background: theming.daff-illuminate($base, $primary, 1);
31
- color: theming.daff-illuminate($base-contrast, $primary, 4);
28
+ background: rgba(theming.daff-color($neutral, 20), 0.5);
32
29
  }
33
- }
34
30
 
35
- pre {
36
- background: theming.daff-illuminate($base, $neutral, 1);
37
- border: 1px solid theming.daff-illuminate($base, $neutral, 2);
38
- color: $base-contrast;
31
+ pre {
32
+ background: rgba(theming.daff-color($neutral, 20), 0.3);
33
+ border: 1px solid theming.daff-color($neutral, 20);
39
34
 
40
- code {
41
- background: none;
42
- border: none;
35
+ code {
36
+ background: none;
37
+ border: none;
38
+ }
43
39
  }
44
- }
45
40
 
46
- code {
47
- background: rgba(theming.daff-illuminate($base, $neutral, 2), 0.5);
48
- color: $base-contrast;
49
- }
41
+ hr {
42
+ background: theming.daff-color($neutral, 20);
43
+ }
50
44
 
51
- hr {
52
- background: theming.daff-illuminate($base, $neutral, 2);
53
- }
45
+ blockquote {
46
+ background: rgba(theming.daff-color($primary), 0.1);
47
+ border-left: 4px solid theming.daff-color($primary, 50);
48
+ color: theming.daff-color($primary, 100);
54
49
 
55
- blockquote {
56
- background: rgba(theming.daff-color($primary), 0.1);
57
- border-left: 4px solid theming.daff-illuminate($base, $primary, 5);
58
- color: theming.daff-illuminate($base-contrast, $primary, 1);
50
+ code {
51
+ background: rgba(theming.daff-color($primary), 0.12);
52
+ color: theming.daff-color($primary, 100);
59
53
 
60
- code {
61
- background: rgba(theming.daff-color($primary), 0.15);
62
- color: $base-contrast;
54
+ @include stopsArticleCascade(a) {
55
+ color: theming.daff-color($primary, 70);
56
+ text-decoration-color: theming.daff-color($primary, 70);
57
+ }
58
+ }
63
59
  }
64
60
 
65
- @include stopsArticleCascade(a) {
66
- color: theming.daff-illuminate($base, $primary, 7);
61
+ table {
62
+ border: 1px solid $table-border-light;
63
+
64
+ th {
65
+ background: theming.daff-color($neutral, 10);
66
+ }
67
+
68
+ th,
69
+ td {
70
+ &:not(:last-child) {
71
+ border-right: 1px solid $table-border-light;
72
+ }
73
+ }
74
+
75
+ thead {
76
+ th {
77
+ border-bottom: 1px solid $table-border-light;
78
+ }
79
+ }
80
+
81
+ tr {
82
+ &:not(:last-child) {
83
+ th,
84
+ td {
85
+ border-bottom: 1px solid $table-border-light;
86
+ }
87
+ }
88
+ }
67
89
  }
90
+ }
91
+
92
+ @include theming.dark($type) {
93
+ color: $text-color-dark;
68
94
 
69
95
  @include stopsArticleCascade(a) {
96
+ color: $link-color-dark;
97
+ text-decoration-color: $link-color-dark;
98
+ }
99
+
100
+ code {
101
+ background: rgba(theming.daff-color($neutral, 20), 0.15);
102
+ }
103
+
104
+ pre {
105
+ background: rgba(theming.daff-color($neutral, 20), 0.15);
106
+ border: 1px solid rgba(theming.daff-color($neutral, 20), 0.15);
107
+
70
108
  code {
71
- background: rgba(theming.daff-color($primary), 0.15);
72
- color: theming.daff-illuminate($base-contrast, $primary, 4);
109
+ background: none;
110
+ border: none;
73
111
  }
74
112
  }
75
- }
76
113
 
77
- table {
78
- th {
79
- background: theming.daff-illuminate($base, $neutral, 1);
80
- border: 1px solid $table-border-color;
114
+ hr {
115
+ background: theming.daff-color($neutral, 80);
81
116
  }
82
117
 
83
- td {
84
- border: 1px solid $table-border-color;
118
+ blockquote {
119
+ background: rgba(theming.daff-color($primary), 0.12);
120
+ border-left: 4px solid theming.daff-color($primary, 40);
121
+ color: theming.daff-color($primary, 10);
122
+
123
+ code {
124
+ background: rgba(theming.daff-color($primary), 0.18);
125
+ color: theming.daff-color($primary, 10);
126
+
127
+ @include stopsArticleCascade(a) {
128
+ color: theming.daff-color($primary, 40);
129
+ text-decoration-color: theming.daff-color($primary, 40);
130
+ }
131
+ }
132
+ }
133
+
134
+ table {
135
+ border: 1px solid $table-border-dark;
136
+
137
+ th {
138
+ background: theming.daff-color($neutral, 90);
139
+ }
140
+
141
+ th,
142
+ td {
143
+ &:not(:last-child) {
144
+ border-right: 1px solid $table-border-dark;
145
+ }
146
+ }
147
+
148
+ thead {
149
+ th {
150
+ border-bottom: 1px solid $table-border-dark;
151
+ }
152
+ }
153
+
154
+ tr {
155
+ &:not(:last-child) {
156
+ th,
157
+ td {
158
+ border-bottom: 1px solid $table-border-dark;
159
+ }
160
+ }
161
+ }
85
162
  }
86
163
  }
87
164
  }
@@ -2,21 +2,27 @@
2
2
  Breadcrumbs are a secondary navigation that displays a user's location within a website or application.
3
3
 
4
4
  ## Overview
5
- Breadcrumbs are a visual representation of the site's navigational hierarchy. They indicate the current page's location and allows users to easily move up to a parent level. It's required for breadcrumbs to be used with the native HTML `<ol>` element, and for each item to be an `<li>`. This offers additional context for assistive technology.
5
+ Breadcrumbs are a visual representation of the site's navigational hierarchy. They indicate the current page's location and allows users to easily move up to a parent level.
6
6
 
7
- ## Basic Breadcrumb
8
- <design-land-example-viewer-container example="basic-breadcrumb"></design-land-example-viewer-container>
7
+ ## Requirements
8
+ - `[daff-breadcrumb]` is required to be used with the native HTML `<ol>` element.
9
+ - Each `[daffBreadcrumbItem]` needs to be a `<li>` element.
9
10
 
10
- ## Usage
11
+ ## Structure
12
+ Breadcrumbs are built using `[daff-breadcrumb]` and `[daffBreadCrumbItem]`.
11
13
 
12
- ## Within a standalone component
13
- To use breadcrumb in a standalone component, import it directly into your custom component:
14
+ - **`[daff-breadcrumb]`**: a wrapper for grouping breadcrumb items.
15
+ - **`[daffBreacrumbItem]`**: used to display each breadcrumb item.
16
+
17
+ <design-land-example-viewer-container example="basic-breadcrumb"></design-land-example-viewer-container>
14
18
 
19
+ ## Usage
15
20
  ```ts
21
+ import { DAFF_BREADCRUMB_COMPONENTS } from '@daffodil/design/breadcrumb';
22
+
16
23
  @Component({
17
24
  selector: 'custom-component',
18
25
  templateUrl: './custom-component.component.html',
19
- standalone: true,
20
26
  imports: [
21
27
  DAFF_BREADCRUMB_COMPONENTS,
22
28
  ],
@@ -24,29 +30,33 @@ To use breadcrumb in a standalone component, import it directly into your custom
24
30
  export class CustomComponent {}
25
31
  ```
26
32
 
27
- ## Within a module (deprecated)
28
- To use breadcrumb in a module, import `DaffBreadcrumbModule` into your custom module:
33
+ ```html
34
+ <ol daff-breadcrumb>
35
+ <li daffBreadcrumbItem>
36
+ <a routerLink="/link">Link</a>
37
+ </li>
38
+ <li daffBreadcrumbItem>
39
+ <a routerLink="/link">Link</a>
40
+ </li>
41
+ <li daffBreacrumbItem>
42
+ <span>Active Link</span>
43
+ </li>
44
+ </ol>
45
+ ```
29
46
 
30
- ```ts
31
- import { NgModule } from '@angular/core';
47
+ ## Accessibility
48
+ Breadcrumb follows the [Breadcrumb WAI-ARIA design pattern](https://www.w3.org/WAI/ARIA/apg/patterns/breadcrumb/).
32
49
 
33
- import { DaffBreadcrumbModule } from '@daffodil/design/breadcrumb';
50
+ - `aria-current="page"` is automatically applied to the last item to indicate that it represents the current page.
34
51
 
35
- @NgModule({
36
- declarations: [
37
- CustomComponent,
38
- ],
39
- exports: [
40
- CustomComponent,
41
- ],
42
- imports: [
43
- DaffBreadcrumbModule,
44
- ],
45
- })
46
- export class CustomComponentModule { }
47
- ```
52
+ In order to fully comply with the WAI-ARIA design pattern:
48
53
 
49
- > This method is deprecated. It's recommended to update all custom components to standalone.
54
+ - Breadcrumbs should be wrapped in a native HTML `<nav>` element so that assistive technologies can present the breadcrumbs as a navigational element on the page.
55
+ - Use `aria-label="Breadcrumb"` on the `nav` element to provide more context into what kind of navigation it is.
50
56
 
51
- ## Accessibility
52
- Breadcrumbs should be wrapped in a native HTML `<nav>` element so that assistive technologies can present the breadcrumbs as a navigational element on the page. Use `aria-label="Breadcrumbs"` on the `nav` element to provide more context. `aria-current="page"` is added to a breadcrumb item when it's the current page, and `aria-current="false"` on all other items.
57
+ ```html
58
+ <nav aria-label="breadcrumb">
59
+ <ol daff-breadcrumb>
60
+ </ol>
61
+ </nav>
62
+ ```
@@ -1,7 +1,20 @@
1
+ import { QueryList, AfterContentInit, DestroyRef } from '@angular/core';
2
+ import { DaffBreadcrumbItemDirective } from '../breadcrumb-item/breadcrumb-item.directive';
1
3
  import * as i0 from "@angular/core";
2
4
  import * as i1 from "@daffodil/design";
3
- export declare class DaffBreadcrumbComponent {
5
+ export declare class DaffBreadcrumbComponent implements AfterContentInit {
6
+ private destroyRef;
7
+ constructor(destroyRef: DestroyRef);
8
+ /**
9
+ * @docs-private
10
+ */
4
11
  class: boolean;
12
+ /**
13
+ * @docs-private
14
+ */
15
+ breadcrumbItems: QueryList<DaffBreadcrumbItemDirective>;
16
+ ngAfterContentInit(): void;
17
+ private updateActiveState;
5
18
  static ɵfac: i0.ɵɵFactoryDeclaration<DaffBreadcrumbComponent, never>;
6
- static ɵcmp: i0.ɵɵComponentDeclaration<DaffBreadcrumbComponent, "ol[daff-breadcrumb]", never, {}, {}, never, ["[daffBreadcrumbItem]"], true, [{ directive: typeof i1.DaffArticleEncapsulatedDirective; inputs: {}; outputs: {}; }, { directive: typeof i1.DaffSkeletonableDirective; inputs: { "skeleton": "skeleton"; }; outputs: {}; }]>;
19
+ static ɵcmp: i0.ɵɵComponentDeclaration<DaffBreadcrumbComponent, "ol[daff-breadcrumb]", never, {}, {}, ["breadcrumbItems"], ["[daffBreadcrumbItem]"], true, [{ directive: typeof i1.DaffArticleEncapsulatedDirective; inputs: {}; outputs: {}; }, { directive: typeof i1.DaffSkeletonableDirective; inputs: { "skeleton": "skeleton"; }; outputs: {}; }]>;
7
20
  }
@@ -1,9 +1,23 @@
1
+ import { ChangeDetectorRef } from '@angular/core';
1
2
  import * as i0 from "@angular/core";
2
3
  export declare class DaffBreadcrumbItemDirective {
4
+ private cdRef;
5
+ /**
6
+ * @docs-private
7
+ */
3
8
  class: boolean;
4
- get ariaCurrent(): "page" | "false";
5
- /** Whether or not the breadcrumb item is active */
6
- active: boolean;
9
+ /**
10
+ * @docs-private
11
+ */
12
+ get activeClass(): boolean;
13
+ /**
14
+ * @docs-private
15
+ */
16
+ get ariaCurrent(): string;
17
+ private _active;
18
+ constructor(cdRef: ChangeDetectorRef);
19
+ /** Called by the DaffBreadcrumbComponent to set the active state */
20
+ setActive(value: boolean): void;
7
21
  static ɵfac: i0.ɵɵFactoryDeclaration<DaffBreadcrumbItemDirective, never>;
8
- static ɵdir: i0.ɵɵDirectiveDeclaration<DaffBreadcrumbItemDirective, "li[daffBreadcrumbItem]", never, { "active": { "alias": "active"; "required": false; }; }, {}, never, never, true, never>;
22
+ static ɵdir: i0.ɵɵDirectiveDeclaration<DaffBreadcrumbItemDirective, "li[daffBreadcrumbItem]", never, {}, {}, never, never, true, never>;
9
23
  }
@@ -1,3 +1,6 @@
1
1
  import { DaffBreadcrumbComponent } from './breadcrumb/breadcrumb.component';
2
2
  import { DaffBreadcrumbItemDirective } from './breadcrumb-item/breadcrumb-item.directive';
3
+ /**
4
+ * @docs-private
5
+ */
3
6
  export declare const DAFF_BREADCRUMB_COMPONENTS: readonly [typeof DaffBreadcrumbComponent, typeof DaffBreadcrumbItemDirective];