@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
@@ -7,12 +7,11 @@ import * as i5 from "./sidebar-header/sidebar-header.component";
7
7
  import * as i6 from "./sidebar-footer/sidebar-footer.component";
8
8
  import * as i7 from "./sidebar-header/sidebar-header-title/sidebar-header-title.directive";
9
9
  import * as i8 from "./sidebar-header/sidebar-header-action/sidebar-header-action.directive";
10
- import * as i9 from "./sidebar-viewport-backdrop/sidebar-viewport-backdrop.component";
11
10
  /**
12
11
  * @deprecated in favor of {@link DAFF_SIDEBAR_COMPONENTS}. Deprecated in version 0.78.0. Will be removed in version 1.0.0.
13
12
  */
14
13
  export declare class DaffSidebarModule {
15
14
  static ɵfac: i0.ɵɵFactoryDeclaration<DaffSidebarModule, never>;
16
- static ɵmod: i0.ɵɵNgModuleDeclaration<DaffSidebarModule, never, [typeof i1.CommonModule, typeof i2.A11yModule, typeof i3.DaffSidebarComponent, typeof i4.DaffSidebarViewportComponent, typeof i5.DaffSidebarHeaderComponent, typeof i6.DaffSidebarFooterComponent, typeof i7.DaffSidebarHeaderTitleDirective, typeof i8.DaffSidebarHeaderActionDirective, typeof i9.DaffSidebarViewportBackdropComponent], [typeof i3.DaffSidebarComponent, typeof i4.DaffSidebarViewportComponent, typeof i5.DaffSidebarHeaderComponent, typeof i6.DaffSidebarFooterComponent, typeof i7.DaffSidebarHeaderTitleDirective, typeof i8.DaffSidebarHeaderActionDirective, typeof i9.DaffSidebarViewportBackdropComponent]>;
15
+ static ɵmod: i0.ɵɵNgModuleDeclaration<DaffSidebarModule, never, [typeof i1.CommonModule, typeof i2.A11yModule, typeof i3.DaffSidebarComponent, typeof i4.DaffSidebarViewportComponent, typeof i5.DaffSidebarHeaderComponent, typeof i6.DaffSidebarFooterComponent, typeof i7.DaffSidebarHeaderTitleDirective, typeof i8.DaffSidebarHeaderActionDirective], [typeof i3.DaffSidebarComponent, typeof i4.DaffSidebarViewportComponent, typeof i5.DaffSidebarHeaderComponent, typeof i6.DaffSidebarFooterComponent, typeof i7.DaffSidebarHeaderTitleDirective, typeof i8.DaffSidebarHeaderActionDirective]>;
17
16
  static ɵinj: i0.ɵɵInjectorDeclaration<DaffSidebarModule>;
18
17
  }
package/switch/README.md CHANGED
@@ -7,13 +7,14 @@ Switches provide a way to toggle between two states with a visual indicator of t
7
7
  ## Usage
8
8
 
9
9
  ### Within a standalone component
10
- To use a switch in a standalone component, import it directly into your custom component:
10
+ To use a switch in a standalone component, import `DAFF_SWITCH_COMPONENTS` directly into your custom component:
11
11
 
12
12
  ```ts
13
+ import { DAFF_SWITCH_COMPONENTS } from '@daffodil/design/switch';
14
+
13
15
  @Component({
14
16
  selector: 'custom-component',
15
17
  templateUrl: './custom-component.component.html',
16
- standalone: true,
17
18
  imports: [
18
19
  DAFF_SWITCH_COMPONENTS,
19
20
  ],
@@ -4,27 +4,46 @@
4
4
 
5
5
  @mixin daff-switch-theme($theme) {
6
6
  $primary: core.daff-map-get($theme, primary);
7
- $base: core.daff-map-get($theme, 'core', 'base');
8
- $base-contrast: core.daff-map-get($theme, 'core', 'base-contrast');
9
7
  $white: core.daff-map-get($theme, 'core', 'white');
10
- $black: core.daff-map-get($theme, 'core', 'black');
11
8
  $neutral: core.daff-map-get($theme, 'core', 'neutral');
9
+ $type: core.daff-map-get($theme, 'core', 'type');
12
10
 
13
11
  .daff-switch {
14
12
  &__toggle {
15
- background-color: theming.daff-illuminate($base, $neutral, 3);
16
13
  border: 2px solid transparent;
17
14
 
18
- &:focus-within {
19
- border: 2px solid theming.daff-illuminate($base, $neutral, 2);
20
- }
21
-
22
15
  &.daff-checked {
23
16
  background-color: theming.daff-color($primary);
24
17
  }
25
18
 
26
- &::before {
27
- background-color: $base;
19
+ @include theming.light($type) {
20
+ background-color: theming.daff-color($neutral, 30);
21
+
22
+ &:focus-within {
23
+ border: 2px solid theming.daff-color($neutral, 20);
24
+ }
25
+
26
+ &::before {
27
+ background-color: $white;
28
+ }
29
+ }
30
+
31
+ @include theming.dark($type) {
32
+ background-color: theming.daff-color($neutral, 80);
33
+
34
+ &:focus-within {
35
+ border: 2px solid theming.daff-color($neutral, 90);
36
+ }
37
+
38
+ &::before {
39
+ background-color: theming.daff-color($neutral, 40);
40
+ }
41
+
42
+ &.daff-checked {
43
+ &::before {
44
+ background-color: $white;
45
+ }
46
+ }
28
47
  }
29
48
  }
30
49
  }
@@ -4,12 +4,9 @@ import * as i0 from "@angular/core";
4
4
  /**
5
5
  * The switch component provides a way to toggle between two settings.
6
6
  *
7
- * @example
8
- *
9
7
  * ```html
10
- * <daff-switch [checked]="checked" loading="loading" [error]="true" [labelPosition]="top">
11
- * Label
12
- * <daff-error-message>Error message</daff-error-message>
8
+ * <daff-switch>
9
+ * Label
13
10
  * </daff-switch>
14
11
  * ```
15
12
  */
@@ -19,8 +16,17 @@ export declare class DaffSwitchComponent {
19
16
  */
20
17
  get disabled(): any;
21
18
  set disabled(value: any);
19
+ /**
20
+ * @docs-private
21
+ */
22
22
  get disabledAttribute(): boolean;
23
+ /**
24
+ * @docs-private
25
+ */
23
26
  get ariaDisabled(): boolean;
27
+ /**
28
+ * @docs-private
29
+ */
24
30
  get classes(): string;
25
31
  /**
26
32
  * Whether the switch is loading.
@@ -31,13 +37,16 @@ export declare class DaffSwitchComponent {
31
37
  */
32
38
  checked: boolean;
33
39
  /**
34
- * The position of the label relative to the switch. Defaults to 'daff-left'.
40
+ * The position of the label relative to the switch.
35
41
  */
36
42
  labelPosition: DaffLabelPosition;
37
43
  /**
38
44
  * Whether the switch shows an error.
39
45
  */
40
46
  error: boolean;
47
+ /**
48
+ * @docs-private
49
+ */
41
50
  _disabled: boolean;
42
51
  handleKeydown(event: KeyboardEvent): void;
43
52
  /**
@@ -48,8 +57,24 @@ export declare class DaffSwitchComponent {
48
57
  * aria-label for the switch.
49
58
  */
50
59
  ariaLabel: string;
60
+ /**
61
+ * A unique id for the switch.
62
+ *
63
+ * The `id` is automatically generated by linking the prefix 'daff-switch-' with an incrementing number. This value can be customized by passing a different `id` value via the component's `id` input.
64
+ *
65
+ * @example Using the `id` property
66
+ * ```html
67
+ * <daff-switch [id]="'custom-id'"></daff-switch>
68
+ * ```
69
+ */
51
70
  id: string;
71
+ /**
72
+ * Output event triggered when the switch has been toggled.
73
+ */
52
74
  toggled: EventEmitter<boolean>;
75
+ /**
76
+ * @docs-private
77
+ */
53
78
  onToggle(): void;
54
79
  static ɵfac: i0.ɵɵFactoryDeclaration<DaffSwitchComponent, never>;
55
80
  static ɵcmp: i0.ɵɵComponentDeclaration<DaffSwitchComponent, "daff-switch", never, { "disabled": { "alias": "disabled"; "required": false; }; "loading": { "alias": "loading"; "required": false; }; "checked": { "alias": "checked"; "required": false; }; "labelPosition": { "alias": "labelPosition"; "required": false; }; "error": { "alias": "error"; "required": false; }; "ariaLabel": { "alias": "aria-label"; "required": false; }; "id": { "alias": "id"; "required": false; }; }, { "toggled": "toggled"; }, never, ["*", "daff-error-message"], true, never>;
@@ -1,3 +1,6 @@
1
1
  import { DaffErrorMessageModule } from '@daffodil/design';
2
2
  import { DaffSwitchComponent } from './switch/switch.component';
3
+ /**
4
+ * @docs-private
5
+ */
3
6
  export declare const DAFF_SWITCH_COMPONENTS: readonly [typeof DaffSwitchComponent, typeof DaffErrorMessageModule];
package/tabs/README.md CHANGED
@@ -4,12 +4,45 @@ Tabs provide a way to navigate between panels that display related content.
4
4
  ## Overview
5
5
  Tabs allow for users to navigate between related content without having to leave the page. They can be used within components like modals or cards.
6
6
 
7
+ ## Usage
8
+
9
+ ### Within a standalone component
10
+ To use a tabs in a standalone component, import `DAFF_TABS_COMPONENTS` directly into your custom component:
11
+
12
+ ```ts
13
+ import { DAFF_TABS_COMPONENTS } from '@daffodil/design/tabs';
14
+
15
+ @Component({
16
+ selector: 'custom-component',
17
+ templateUrl: './custom-component.component.html',
18
+ imports: [
19
+ DAFF_TABS_COMPONENTS,
20
+ ],
21
+ })
22
+ export class CustomComponent {}
23
+ ```
24
+
25
+ ## Properties
26
+
27
+ ### Link Mode
28
+ Tabs in link mode replaces the tab buttons with anchors. This allows the selected tab to be connected to a URL. By default, the current URL and `tab` query param will be used. These can be overriden with the `url` and `queryParam` inputs respectively.
29
+
30
+ ```html
31
+ <daff-tabs [linkMode]="true">
32
+ </daff-tabs>
33
+ ```
34
+
7
35
  ## Accessbility
8
36
  Tabs follow the [ARIA Tabs design pattern](https://www.w3.org/WAI/ARIA/apg/patterns/tabs/). Tabs compose of `tablist`, `tab`, and `tabpanel` elements, each with its appropriate role and integrated keyboard interactions.
9
37
 
10
38
  ### Label
11
39
  A meaningful `aria-label` should be set on `<daff-tabs>` by using the `aria-label` property. This will set the `aria-label` on the `tablist` element.
12
40
 
41
+ ```html
42
+ <daff-tabs aria-label="Custom aria label">
43
+ </daff-tabs>
44
+ ```
45
+
13
46
  ### Keyboard Interactions
14
47
  | Key | Action |
15
48
  | --- | ------ |
@@ -17,6 +50,3 @@ A meaningful `aria-label` should be set on `<daff-tabs>` by using the `aria-labe
17
50
  | Right Arrow | Moves focus and activates next tab. If focus is on the last tab, moves focus to the first tab. |
18
51
  | Home | Moves focus and activates first tab. |
19
52
  | End | Moves focus and activates last tab. |
20
-
21
- ### Link Mode
22
- Tabs can operate in "link mode" which replaces the tab buttons with anchors. This allows the selected tab to be connected to the URL. To use this mode, set `linkMode` to `true` on the tabs component. By default, the current URL and `tab` query param will be used. These can be overriden with the `url` and `queryParam` inputs respectively.
@@ -4,27 +4,45 @@
4
4
 
5
5
  @mixin daff-tabs-theme($theme) {
6
6
  $primary: core.daff-map-get($theme, primary);
7
- $secondary: core.daff-map-get($theme, secondary);
8
- $tertiary: core.daff-map-get($theme, tertiary);
9
7
  $neutral: core.daff-map-get($theme, 'core', 'neutral');
10
- $base: core.daff-map-get($theme, 'core', 'base');
11
8
  $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');
9
+ $type: core.daff-map-get($theme, 'core', 'type');
14
10
 
15
- .daff-tabs {
16
- &__tab-list {
17
- &::after {
18
- background: theming.daff-illuminate($base, $neutral, 2);
11
+ @include theming.light($type) {
12
+ .daff-tabs {
13
+ &__tab-list {
14
+ &::after {
15
+ background: theming.daff-color($neutral, 20);
16
+ }
17
+ }
18
+ }
19
+
20
+ .daff-tab-activator {
21
+ border-bottom: 2px solid theming.daff-color($neutral, 20);
22
+ color: $base-contrast;
23
+
24
+ &.daff-selected {
25
+ border-bottom: 2px solid theming.daff-color($primary);
19
26
  }
20
27
  }
21
28
  }
22
29
 
23
- .daff-tab-activator {
24
- border-bottom: 2px solid theming.daff-illuminate($base, $neutral, 2);
30
+ @include theming.dark($type) {
31
+ .daff-tabs {
32
+ &__tab-list {
33
+ &::after {
34
+ background: theming.daff-color($neutral, 80);
35
+ }
36
+ }
37
+ }
25
38
 
26
- &.daff-selected {
27
- border-bottom: 2px solid theming.daff-color($primary);
39
+ .daff-tab-activator {
40
+ border-bottom: 2px solid theming.daff-color($neutral, 80);
41
+ color: $base-contrast;
42
+
43
+ &.daff-selected {
44
+ border-bottom: 2px solid theming.daff-color($primary);
45
+ }
28
46
  }
29
47
  }
30
48
  }
@@ -3,7 +3,7 @@ import * as i0 from "@angular/core";
3
3
  /**
4
4
  * `DaffTabComponet` is an element in the tab list that is used as a content container to group the label of a tab panel and the tab panel together.
5
5
  *
6
- * A `<daff-tab>` should include the {@link DaffTabLabelComponent} and {@link DaffTabPanelComponent} components in order to properly structure the UI.
6
+ * A `<daff-tab>` should include the DaffTabLabelComponent and DaffTabPanelComponent components in order to properly structure the UI.
7
7
  *
8
8
  * @example Basic structure of tab
9
9
  * ```html
@@ -13,7 +13,13 @@ import * as i0 from "@angular/core";
13
13
  * ```
14
14
  */
15
15
  export declare class DaffTabLabelComponent implements DaffPrefixable, DaffSuffixable {
16
+ /**
17
+ * @docs-private
18
+ */
16
19
  _prefix: DaffPrefixDirective;
20
+ /**
21
+ * @docs-private
22
+ */
17
23
  _suffix: DaffSuffixDirective;
18
24
  static ɵfac: i0.ɵɵFactoryDeclaration<DaffTabLabelComponent, never>;
19
25
  static ɵcmp: i0.ɵɵComponentDeclaration<DaffTabLabelComponent, "daff-tab-label", never, {}, {}, ["_prefix", "_suffix"], ["[daffPrefix]", "*", "[daffSuffix]"], true, never>;
@@ -17,19 +17,27 @@ export declare class DaffTabPanelComponent {
17
17
  */
18
18
  private class;
19
19
  /**
20
+ * @docs-private
21
+ *
20
22
  * Sets the `role` to tabpanel.
21
23
  */
22
24
  role: string;
23
25
  /**
26
+ * @docs-private
27
+ *
24
28
  * `aria-labelledby` for the tab.
25
29
  */
26
30
  ariaLabelledBy: string;
27
31
  /**
32
+ * @docs-private
33
+ *
28
34
  * Sets the `tabindex` to 0.
29
35
  */
30
36
  tabIndex: string;
31
37
  private _id;
32
38
  /**
39
+ * @docs-private
40
+ *
33
41
  * Dynamically binds the tab panel's id to a unique value generated from the associated tab's panelId.
34
42
  */
35
43
  get tabPanelId(): string;
@@ -40,23 +40,26 @@ export declare class DaffTabsComponent implements AfterContentInit, OnInit {
40
40
  */
41
41
  private class;
42
42
  /**
43
+ * @docs-private
44
+ *
43
45
  * The currently selected tab. This property is dynamically updated when a user selects a tab.
44
46
  */
45
47
  selectedTab: string;
46
48
  /**
47
- * The tab that is initially selected on initial load. If it's not used, the first tab in the tablist will be selected by default.
49
+ * The tab that is selected on initial load. If it's not used, the first tab in the tablist will be selected by default.
48
50
  */
49
51
  initiallySelected: string;
50
52
  /**
51
- * @docs-private
53
+ * aria-label for the tab.
52
54
  */
53
55
  private externalAriaLabel;
54
56
  /**
55
- * aria-label for the tab.
57
+ * @docs-private
58
+ *
56
59
  */
57
60
  ariaLabel: string;
58
61
  /**
59
- * Replace the tab buttons with links.
62
+ * Replace the tab buttons as links.
60
63
  */
61
64
  linkMode: boolean;
62
65
  /**
@@ -84,8 +87,12 @@ export declare class DaffTabsComponent implements AfterContentInit, OnInit {
84
87
  * @docs-private
85
88
  */
86
89
  _tabActivators: QueryList<DaffTabActivatorComponent>;
90
+ /**
91
+ * @docs-private
92
+ */
87
93
  get currentPath(): string;
88
94
  constructor(cdRef: ChangeDetectorRef, location: Location);
95
+ private reset;
89
96
  /**
90
97
  * @docs-private
91
98
  */
@@ -95,6 +102,8 @@ export declare class DaffTabsComponent implements AfterContentInit, OnInit {
95
102
  */
96
103
  ngAfterContentInit(): void;
97
104
  /**
105
+ * @docs-private
106
+ *
98
107
  * Selects a tab and sets focus on the selected tab.
99
108
  */
100
109
  select(tabId: string): void;
@@ -108,18 +117,26 @@ export declare class DaffTabsComponent implements AfterContentInit, OnInit {
108
117
  */
109
118
  _buildQueryParams(tab: string): Params;
110
119
  /**
120
+ * @docs-private
121
+ *
111
122
  * Selects the previous tab and wraps around to the last tab if the first tab is currently selected.
112
123
  */
113
124
  previous(): void;
114
125
  /**
126
+ * @docs-private
127
+ *
115
128
  * Selects the next tab and wraps around to the first tab if the last tab is currently selected.
116
129
  */
117
130
  next(): void;
118
131
  /**
132
+ * @docs-private
133
+ *
119
134
  * Selects the first tab.
120
135
  */
121
136
  selectFirst(event: KeyboardEvent | null): void;
122
137
  /**
138
+ * @docs-private
139
+ *
123
140
  * Selects the last tab.
124
141
  */
125
142
  selectLast(event: KeyboardEvent | null): void;
package/tabs/tabs.d.ts CHANGED
@@ -1,6 +1,12 @@
1
- import { DaffPrefixSuffixModule } from '@daffodil/design';
2
1
  import { DaffTabComponent } from './tabs/tab/tab.component';
3
2
  import { DaffTabLabelComponent } from './tabs/tab-label/tab-label.component';
4
3
  import { DaffTabPanelComponent } from './tabs/tab-panel/tab-panel.component';
5
4
  import { DaffTabsComponent } from './tabs/tabs.component';
6
- export declare const DAFF_TABS_COMPONENTS: readonly [typeof DaffTabsComponent, typeof DaffTabLabelComponent, typeof DaffTabPanelComponent, typeof DaffPrefixSuffixModule, typeof DaffTabComponent];
5
+ /**
6
+ * @docs-private
7
+ *
8
+ * ```ts
9
+ * import { DAFF_TABS_COMPONENTS } from '@daffodil/design/tabs';
10
+ * ```
11
+ */
12
+ export declare const DAFF_TABS_COMPONENTS: readonly [typeof DaffTabsComponent, typeof DaffTabLabelComponent, typeof DaffTabPanelComponent, typeof DaffTabComponent];
@@ -1,2 +1,20 @@
1
1
  # Text Snippet
2
- The text snippet component shows a snippet of text, with the ability to show or hide content beyond one line of text.
2
+ The text snippet component shows a snippet of text, with the ability to show or hide content beyond one line of text.
3
+
4
+ ## Usage
5
+
6
+ ### Within a standalone component
7
+ To use a text snippet in a standalone component, import `DaffTextSnippetComponent` directly into your custom component:
8
+
9
+ ```ts
10
+ import { DaffTextSnippetComponent } from '@daffodil/design/text-snippet';
11
+
12
+ @Component({
13
+ selector: 'custom-component',
14
+ templateUrl: './custom-component.component.html',
15
+ imports: [
16
+ DaffTextSnippetComponent,
17
+ ],
18
+ })
19
+ export class CustomComponent {}
20
+ ```
package/toast/README.md CHANGED
@@ -4,187 +4,57 @@ Toasts are small messages designed to mimic push notifications. They are used to
4
4
  ## Overview
5
5
  Toasts should be used to display temporary messages about actions or events that occured or in need of attention, with no relation to content on a page. For messaging that provide context in close promixity to a piece of content within a page, use the [Notification](/libs/design/notification/README.md) component.
6
6
 
7
- ## Basic Toast
7
+ ## Basic toast
8
8
  <design-land-example-viewer-container example="default-toast"></design-land-example-viewer-container>
9
9
 
10
10
  ## Setting up the component
11
- `provideDaffToast()` should be added as a provider either in your application's root component for global use or in a specific feature component.
11
+ `provideDaffToast()` must be added as a provider in your application's root component for global use or in a specific feature component for the toast functionality to work properly.
12
12
 
13
13
  ```ts
14
14
  import { provideDaffToast } from '@daffodil/design/toast';
15
15
 
16
16
  @NgModule({
17
- providers: [
18
- provideDaffToast(),
19
- ]
17
+ providers: [
18
+ provideDaffToast(),
19
+ ]
20
20
  )}
21
21
 
22
22
  export class AppModule {}
23
23
  ```
24
24
 
25
- ### Configurations
26
- Toast can be configured by using the `DaffToastService`.
27
-
28
- The following is an example of a toast with a duration:
29
-
30
- ```ts
31
- import {
32
- ChangeDetectionStrategy,
33
- Component,
34
- } from '@angular/core';
35
-
36
- import {
37
- DaffToast
38
- DaffToastService,
39
- } from '@daffodil/design/toast';
40
-
41
- @Component({
42
- selector: 'custom-toast',
43
- templateUrl: './custom-toast.component.html',
44
- changeDetection: ChangeDetectionStrategy.OnPush,
45
- standalone: true,
46
- })
47
- export class CustomToastComponent {
48
- private toast: DaffToast;
49
-
50
- constructor(private toastService: DaffToastService) {}
51
-
52
- open() {
53
- this.toast = this.toastService.open({
54
- title: 'Update Complete',
55
- message: 'This page has been updated to the newest version.',
56
- },
57
- {
58
- duration: 5000,
59
- });
60
- }
61
- }
62
- ```
63
-
64
- The following is an example of a toast with actions:
65
-
66
- ```ts
67
- import {
68
- ChangeDetectionStrategy,
69
- Component,
70
- EventEmitter,
71
- OnInit,
72
- } from '@angular/core';
73
-
74
- import { DAFF_BUTTON_COMPONENTS } from '@daffodil/design/button';
75
- import {
76
- DaffToast,
77
- DaffToastAction,
78
- DaffToastService,
79
- } from '@daffodil/design/toast';
80
-
81
- @Component({
82
- selector: 'action-toast',
83
- templateUrl: './action-toast.component.html',
84
- changeDetection: ChangeDetectionStrategy.OnPush,
85
- standalone: true,
86
- imports: [
87
- DAFF_BUTTON_COMPONENTS,
88
- ],
89
- })
90
- export class ActionToastComponent implements OnInit {
91
- private toast: DaffToast;
92
-
93
- constructor(private toastService: DaffToastService) {}
94
-
95
- update = new EventEmitter<DaffToastAction>();
96
-
97
- closeToast = new EventEmitter<DaffToastAction>();
98
-
99
- open() {
100
- this.toast = this.toastService.open({
101
- title: 'Update Available',
102
- message: 'A new version of this page is available.',
103
- actions: [
104
- { content: 'Update', color: 'theme-contrast', size: 'sm', eventEmitter: this.update },
105
- { content: 'Remind me later', type: 'flat', size: 'sm', eventEmitter: this.closeToast },
106
- ]
107
- });
108
- }
109
-
110
- ngOnInit() {
111
- this.update.subscribe(() => {
112
- });
113
-
114
- this.closeToast.subscribe(() => {
115
- this.toastService.close(this.toast);
116
- });
117
- }
118
- }
119
- ```
120
-
121
- The following configurations are available in the `DaffToastService`:
122
-
123
- | Property | Type | Description | Default |
124
- | -------- | ------ | ------------------------------- | ------- |
125
- | title | string | A quick overview of the toast | -- |
126
- | message | string | Additional details about the message that should be limited to one or two sentences | -- |
127
- | actions | `DaffToastAction` | Adds a `daff-button` that allow users to perform an action related to the message. Actions should be limited to two buttons. | -- |
128
- | dismissible | boolean | Allows a toast to be dismissible via a close button | true |
129
- | duration | number | The duration in milliseconds that a toast is visible before it's dismissed | 5000 |
130
-
131
- The `actions` configurations are based on the properties of the `DaffButtonComponent` (view [Button Documentation](/libs/design/button/README.md)) with the addition of `data` and `eventEmitter`.
132
-
133
25
  ## Dismissal
134
- A toast can be dismissed via a timed duration, a close button, or the `ESC` key.
26
+ A toast can be dismissed via a timed duration or a close button.
27
+
28
+ The `duration` and `dismissible` properties can be updated when you open it with the `DaffToastService`.
135
29
 
136
30
  ### Timed duration
137
- A toast with actions will persist until one of the actions have been interacted with, or is dismissed by the close button or the `ESC` key. Actionable toasts should be persistent, but a duration is allowed to be set. If duration must be set, make sure it's long enough for users to engage with the actions.
31
+ A toast with actions will persist until one of the actions have been interacted with or dismissed by the close button. By default, a toast without actions will be dismissed after `5000ms`.
138
32
 
139
- By default, a toast without actions will be dismissed after `5000ms`. This can be updated by setting `duration` through the `DaffToastService`.
33
+ > Actionable toasts should be persistent, but a duration is allowed to be set. If duration must be set, make sure it's long enough for users to engage with the actions.
140
34
 
141
- #### Toast with custom duration
142
35
  <design-land-example-viewer-container example="toast-with-custom-duration"></design-land-example-viewer-container>
143
36
 
144
37
  ### Close button
145
- The close button is shown by default but can be hidden by setting `dismissible: false` through the `DaffToastService`.
38
+ The close button is hidden by default, and dismissible is ignored when there are actions in a toast. You can change the visibility of the close button via the `dismissible` property.
146
39
 
147
- ### Escape Key
148
- A toast can be dismissed by using the `ESC` key if it has actions and is focus trapped.
40
+ <design-land-example-viewer-container example="dismissible-toast"></design-land-example-viewer-container>
149
41
 
150
42
  ## Stacking
151
43
  A maximum of three toasts can be shown at a time. Toasts are stacked vertically, with the most recent toast displayed on top.
152
44
 
153
45
  ## Statuses
154
- The status color of a toast can be updated by using the `status` property.
155
-
156
- Supported statuses: `warn | critical | success`
46
+ You can set the status of a toast when opening it with `DaffToastService`, using values defined by `DaffStatus`.
157
47
 
158
- ### Toast with statuses
159
48
  <design-land-example-viewer-container example="toast-status"></design-land-example-viewer-container>
160
49
 
161
- ## Positions
162
-
163
- | Property | Value | Default |
164
- | ------------ | ------------------------ | ------- |
165
- | `vertical` | `top | bottom` | top |
166
- | `horizontal` | `left | center | right ` | right |
167
-
168
- To change the horizontal and vertical position of a toast, add the `provideDaffToastOptions` dependency key to the `providers` key in the module as shown below:
169
-
170
- ```ts
171
- providers: [
172
- provideDaffToastOptions({
173
- position: {
174
- vertical: 'bottom',
175
- horizontal: 'center',
176
- }
177
- useParent: false,
178
- })
179
- ]
180
- ```
181
-
182
- The position of a toast on a mobile device will always be on the bottom center.
50
+ ## Accessibility
51
+ By default, toasts use a `role="status"` to announce messages. It's the equivalent of `aria-live="polite"`, which does not interrupt a user's current activity and waits until they are idle to make the announcement.
183
52
 
184
- ### Toast with configurable positions
185
- <design-land-example-viewer-container example="toast-positions"></design-land-example-viewer-container>
53
+ `role="alertdialog"` is used when a toast has action. The toast will be focus trapped and focus immediately moves to the actions.
186
54
 
187
- ## Accessibility
188
- By default, toasts use a `role="status"` to announce messages. It's the equivalent of `aria-live="polite"`, which does not interrupt a user's current activity and waits until they are idle to make the announcement. When a toast has actions, a `role="alertdialog"` is used. The toast will be focus trapped and focus immediately moves to the actions.
55
+ Avoid setting a duration on toasts with actions because they will disappear automatically, making it difficult for users to interact with the actions.
189
56
 
190
- Avoid setting a duration on toasts with actions because they will disappear automatically, making it difficult for users to interact with the actions.
57
+ ### Keyboard Interactions
58
+ | Key | Action |
59
+ | ----- | ------ |
60
+ | `ESC` | Dismisses a toast if it has actions and is focus trapped. |