@daffodil/design 0.91.0 → 0.92.3-rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (142) hide show
  1. package/accordion/README.md +26 -38
  2. package/accordion/index.d.ts +2 -2
  3. package/article/README.md +66 -46
  4. package/article/index.d.ts +22 -1
  5. package/article/src/article-theme.scss +12 -0
  6. package/breadcrumb/README.md +6 -1
  7. package/breadcrumb/index.d.ts +65 -11
  8. package/breadcrumb/src/breadcrumb-theme.scss +1 -1
  9. package/button/README.md +36 -33
  10. package/button/index.d.ts +26 -5
  11. package/button/src/button/basic/button-theme.scss +4 -2
  12. package/button/src/button/button-base.scss +26 -3
  13. package/button/src/button/icon/icon-theme.scss +10 -6
  14. package/button/src/button/raised/raised-theme.scss +4 -2
  15. package/callout/README.md +15 -27
  16. package/card/README.md +36 -61
  17. package/container/README.md +18 -23
  18. package/fesm2022/daffodil-design-accordion.mjs +13 -13
  19. package/fesm2022/daffodil-design-accordion.mjs.map +1 -1
  20. package/fesm2022/daffodil-design-article.mjs +168 -26
  21. package/fesm2022/daffodil-design-article.mjs.map +1 -1
  22. package/fesm2022/daffodil-design-breadcrumb.mjs +180 -28
  23. package/fesm2022/daffodil-design-breadcrumb.mjs.map +1 -1
  24. package/fesm2022/daffodil-design-button.mjs +83 -42
  25. package/fesm2022/daffodil-design-button.mjs.map +1 -1
  26. package/fesm2022/daffodil-design-callout.mjs +23 -23
  27. package/fesm2022/daffodil-design-callout.mjs.map +1 -1
  28. package/fesm2022/daffodil-design-card.mjs +33 -33
  29. package/fesm2022/daffodil-design-card.mjs.map +1 -1
  30. package/fesm2022/daffodil-design-checkbox.mjs +13 -13
  31. package/fesm2022/daffodil-design-checkbox.mjs.map +1 -1
  32. package/fesm2022/daffodil-design-container.mjs +8 -8
  33. package/fesm2022/daffodil-design-container.mjs.map +1 -1
  34. package/fesm2022/daffodil-design-form-field.mjs +26 -26
  35. package/fesm2022/daffodil-design-form-field.mjs.map +1 -1
  36. package/fesm2022/daffodil-design-form.mjs +9 -9
  37. package/fesm2022/daffodil-design-form.mjs.map +1 -1
  38. package/fesm2022/daffodil-design-hero.mjs +23 -23
  39. package/fesm2022/daffodil-design-hero.mjs.map +1 -1
  40. package/fesm2022/daffodil-design-image.mjs +8 -8
  41. package/fesm2022/daffodil-design-image.mjs.map +1 -1
  42. package/fesm2022/daffodil-design-input.mjs +18 -14
  43. package/fesm2022/daffodil-design-input.mjs.map +1 -1
  44. package/fesm2022/daffodil-design-link-set.mjs +25 -17
  45. package/fesm2022/daffodil-design-link-set.mjs.map +1 -1
  46. package/fesm2022/daffodil-design-list.mjs +16 -16
  47. package/fesm2022/daffodil-design-list.mjs.map +1 -1
  48. package/fesm2022/daffodil-design-loading-icon.mjs +8 -8
  49. package/fesm2022/daffodil-design-loading-icon.mjs.map +1 -1
  50. package/fesm2022/daffodil-design-media-gallery.mjs +13 -13
  51. package/fesm2022/daffodil-design-media-gallery.mjs.map +1 -1
  52. package/fesm2022/daffodil-design-menu.mjs +223 -60
  53. package/fesm2022/daffodil-design-menu.mjs.map +1 -1
  54. package/fesm2022/daffodil-design-modal.mjs +33 -29
  55. package/fesm2022/daffodil-design-modal.mjs.map +1 -1
  56. package/fesm2022/daffodil-design-native-select.mjs +47 -41
  57. package/fesm2022/daffodil-design-native-select.mjs.map +1 -1
  58. package/fesm2022/daffodil-design-navbar.mjs +25 -21
  59. package/fesm2022/daffodil-design-navbar.mjs.map +1 -1
  60. package/fesm2022/daffodil-design-notification.mjs +16 -16
  61. package/fesm2022/daffodil-design-notification.mjs.map +1 -1
  62. package/fesm2022/daffodil-design-paginator.mjs +7 -7
  63. package/fesm2022/daffodil-design-paginator.mjs.map +1 -1
  64. package/fesm2022/daffodil-design-progress-bar.mjs +10 -10
  65. package/fesm2022/daffodil-design-progress-bar.mjs.map +1 -1
  66. package/fesm2022/daffodil-design-quantity-field.mjs +17 -14
  67. package/fesm2022/daffodil-design-quantity-field.mjs.map +1 -1
  68. package/fesm2022/daffodil-design-radio.mjs +16 -16
  69. package/fesm2022/daffodil-design-radio.mjs.map +1 -1
  70. package/fesm2022/daffodil-design-select.mjs +6 -6
  71. package/fesm2022/daffodil-design-select.mjs.map +1 -1
  72. package/fesm2022/daffodil-design-sidebar.mjs +25 -25
  73. package/fesm2022/daffodil-design-sidebar.mjs.map +1 -1
  74. package/fesm2022/daffodil-design-spinner.mjs +99 -0
  75. package/fesm2022/daffodil-design-spinner.mjs.map +1 -0
  76. package/fesm2022/daffodil-design-switch.mjs +3 -3
  77. package/fesm2022/daffodil-design-switch.mjs.map +1 -1
  78. package/fesm2022/daffodil-design-tabs.mjs +15 -15
  79. package/fesm2022/daffodil-design-tabs.mjs.map +1 -1
  80. package/fesm2022/daffodil-design-tag.mjs +7 -7
  81. package/fesm2022/daffodil-design-tag.mjs.map +1 -1
  82. package/fesm2022/daffodil-design-text-snippet.mjs +6 -8
  83. package/fesm2022/daffodil-design-text-snippet.mjs.map +1 -1
  84. package/fesm2022/daffodil-design-textarea.mjs +6 -3
  85. package/fesm2022/daffodil-design-textarea.mjs.map +1 -1
  86. package/fesm2022/daffodil-design-toast.mjs +23 -25
  87. package/fesm2022/daffodil-design-toast.mjs.map +1 -1
  88. package/fesm2022/daffodil-design-tree.mjs +152 -103
  89. package/fesm2022/daffodil-design-tree.mjs.map +1 -1
  90. package/fesm2022/daffodil-design-youtube-player.mjs +6 -6
  91. package/fesm2022/daffodil-design-youtube-player.mjs.map +1 -1
  92. package/fesm2022/daffodil-design.mjs +385 -326
  93. package/fesm2022/daffodil-design.mjs.map +1 -1
  94. package/form-field/README.md +50 -85
  95. package/form-field/index.d.ts +11 -9
  96. package/hero/README.md +5 -5
  97. package/image/README.md +2 -2
  98. package/index.d.ts +184 -270
  99. package/input/README.md +4 -4
  100. package/input/index.d.ts +4 -3
  101. package/link-set/index.d.ts +9 -1
  102. package/list/README.md +2 -2
  103. package/loading-icon/README.md +1 -1
  104. package/loading-icon/index.d.ts +1 -1
  105. package/media-gallery/README.md +3 -3
  106. package/menu/README.md +107 -10
  107. package/menu/index.d.ts +143 -11
  108. package/modal/README.md +1 -1
  109. package/modal/index.d.ts +23 -15
  110. package/native-select/README.md +4 -4
  111. package/native-select/index.d.ts +8 -7
  112. package/navbar/README.md +23 -17
  113. package/navbar/index.d.ts +12 -2
  114. package/navbar/src/navbar-theme.scss +4 -46
  115. package/notification/README.md +4 -4
  116. package/package.json +1 -1
  117. package/paginator/README.md +42 -6
  118. package/paginator/index.d.ts +4 -2
  119. package/progress-bar/README.md +3 -3
  120. package/quantity-field/README.md +4 -4
  121. package/quantity-field/index.d.ts +4 -1
  122. package/radio/README.md +1 -1
  123. package/scss/theme.scss +7 -1
  124. package/scss/theming/_color-palettes.scss +0 -6
  125. package/select/README.md +4 -4
  126. package/sidebar/README.md +6 -6
  127. package/spinner/README.md +57 -0
  128. package/spinner/index.d.ts +53 -0
  129. package/spinner/src/spinner-theme.scss +62 -0
  130. package/switch/README.md +4 -4
  131. package/switch/index.d.ts +2 -2
  132. package/tabs/README.md +1 -1
  133. package/tabs/index.d.ts +2 -2
  134. package/tag/README.md +24 -30
  135. package/tag/index.d.ts +1 -1
  136. package/text-snippet/README.md +1 -1
  137. package/text-snippet/src/text-snippet-theme.scss +12 -0
  138. package/textarea/README.md +4 -4
  139. package/textarea/index.d.ts +4 -4
  140. package/toast/README.md +4 -4
  141. package/tree/README.md +39 -22
  142. package/tree/index.d.ts +57 -90
@@ -0,0 +1,53 @@
1
+ import * as i0 from '@angular/core';
2
+ import * as i1 from '@daffodil/design';
3
+ import { DaffSizableDirective, DaffSizeAllType } from '@daffodil/design';
4
+
5
+ /**
6
+ * Labels are used to describe the loading state and provide context for users.
7
+ * They are optional.
8
+ *
9
+ * @usage
10
+ * ```html
11
+ * <daff-spinner-label>Loading</daff-spinner-label>
12
+ * ```
13
+ */
14
+ declare class DaffSpinnerLabelDirective {
15
+ static ɵfac: i0.ɵɵFactoryDeclaration<DaffSpinnerLabelDirective, never>;
16
+ static ɵdir: i0.ɵɵDirectiveDeclaration<DaffSpinnerLabelDirective, "daff-spinner-label", never, {}, {}, never, never, true, never>;
17
+ }
18
+
19
+ /**
20
+ * DaffSpinnerComponent is an animated indicator that lets users know content or action is being loaded.
21
+ */
22
+ declare class DaffSpinnerComponent {
23
+ private sizable;
24
+ /**
25
+ * @docs-private
26
+ */
27
+ _label: DaffSpinnerLabelDirective;
28
+ private static readonly SIZE_MAP;
29
+ /**
30
+ * The `aria-label` for the spinner. Defaults to "loading".
31
+ */
32
+ ariaLabel: i0.InputSignal<string>;
33
+ /**
34
+ * @docs-private
35
+ */
36
+ get _ariaLabel(): string;
37
+ /**
38
+ * @docs-private
39
+ *
40
+ * The dimension (width/height) based on the size.
41
+ */
42
+ get dimension(): number;
43
+ constructor(sizable: DaffSizableDirective<DaffSizeAllType>);
44
+ static ɵfac: i0.ɵɵFactoryDeclaration<DaffSpinnerComponent, never>;
45
+ static ɵcmp: i0.ɵɵComponentDeclaration<DaffSpinnerComponent, "daff-spinner", never, { "ariaLabel": { "alias": "aria-label"; "required": false; "isSignal": true; }; }, {}, ["_label"], ["daff-spinner-label"], true, [{ directive: typeof i1.DaffColorableDirective; inputs: { "color": "color"; }; outputs: {}; }, { directive: typeof i1.DaffSizableDirective; inputs: { "size": "size"; }; outputs: {}; }]>;
46
+ }
47
+
48
+ /**
49
+ * @docs-private
50
+ */
51
+ declare const DAFF_SPINNER_COMPONENTS: readonly [typeof DaffSpinnerComponent, typeof DaffSpinnerLabelDirective];
52
+
53
+ export { DAFF_SPINNER_COMPONENTS, DaffSpinnerComponent, DaffSpinnerLabelDirective };
@@ -0,0 +1,62 @@
1
+ @use '../../scss/theming' as *;
2
+
3
+ @mixin daff-spinner-light-variant($loader-color) {
4
+ .daff-spinner__track,
5
+ .daff-spinner__path {
6
+ stroke: $loader-color;
7
+ }
8
+
9
+ .daff-spinner__path {
10
+ stroke: $loader-color;
11
+ }
12
+ }
13
+
14
+ @mixin daff-spinner-dark-variant($loader-color) {
15
+ .daff-spinner__track {
16
+ stroke: $loader-color;
17
+ }
18
+
19
+ .daff-spinner__path {
20
+ stroke: $loader-color;
21
+ }
22
+ }
23
+
24
+ @mixin daff-spinner-theme($theme) {
25
+ $primary: daff-get-palette($theme, primary);
26
+ $secondary: daff-get-palette($theme, secondary);
27
+ $tertiary: daff-get-palette($theme, tertiary);
28
+ $base: daff-get-base-color($theme, base);
29
+ $base-contrast: daff-get-base-color($theme, base-contrast);
30
+ $white: daff-get-base-color($theme, 'white');
31
+ $black: daff-get-base-color($theme, 'black');
32
+
33
+ .daff-spinner {
34
+ &.daff-primary {
35
+ @include daff-spinner-light-variant(daff-color($primary));
36
+ }
37
+
38
+ &.daff-secondary {
39
+ @include daff-spinner-light-variant(daff-color($secondary));
40
+ }
41
+
42
+ &.daff-tertiary {
43
+ @include daff-spinner-light-variant(daff-color($tertiary));
44
+ }
45
+
46
+ &.daff-theme {
47
+ @include daff-spinner-light-variant($base);
48
+ }
49
+
50
+ &.daff-theme-contrast {
51
+ @include daff-spinner-light-variant($base-contrast);
52
+ }
53
+
54
+ &.daff-dark {
55
+ @include daff-spinner-light-variant($black);
56
+ }
57
+
58
+ &.daff-light {
59
+ @include daff-spinner-light-variant($white);
60
+ }
61
+ }
62
+ }
package/switch/README.md CHANGED
@@ -4,7 +4,7 @@ A switch allows users to toggle the state of a single setting.
4
4
  ## Overview
5
5
  Switches provide a way to toggle between two states with a visual indicator of the current state. A label can be positioned on the left, right, top, or bottom of the switch. The switch can be set to a disabled state, display a loading indicator, or show a custom error message.
6
6
 
7
- <design-land-example-viewer-container example="basic-switch"></design-land-example-viewer-container>
7
+ <daff-docs-example-viewer example="basic-switch"></daff-docs-example-viewer>
8
8
 
9
9
  ## Usage
10
10
 
@@ -27,17 +27,17 @@ export class CustomComponent {}
27
27
  ## Sizes
28
28
  A small switch variant is available for dense layouts. Use the `size="sm"` property to render a more compact version of a switch.
29
29
 
30
- <design-land-example-viewer-container example="switch-sizes"></design-land-example-viewer-container>
30
+ <daff-docs-example-viewer example="switch-sizes"></daff-docs-example-viewer>
31
31
 
32
32
  ## Disable a switch
33
33
  Use the `disabled` property on switch to make it non-interactive.
34
34
 
35
- <design-land-example-viewer-container example="disabled-switch"></design-land-example-viewer-container>
35
+ <daff-docs-example-viewer example="disabled-switch"></daff-docs-example-viewer>
36
36
 
37
37
  ## Label positions
38
38
  Use the `labelPosition` property to control the visual relationship between the switch and its label. By default, labels appear to the left of the switch control.
39
39
 
40
- <design-land-example-viewer-container example="switch-label-positions"></design-land-example-viewer-container>
40
+ <daff-docs-example-viewer example="switch-label-positions"></daff-docs-example-viewer>
41
41
 
42
42
  ## Accessibility
43
43
  Switch follows the [ARIA Switch design pattern](https://www.w3.org/WAI/ARIA/apg/patterns/switch/).
package/switch/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import * as i0 from '@angular/core';
2
2
  import { EventEmitter } from '@angular/core';
3
3
  import * as i1 from '@daffodil/design';
4
- import { DaffSizableDirective, DaffSizeSmallType, DaffDisableableDirective } from '@daffodil/design';
4
+ import { DaffSizableDirective, DaffSizeSmallType, DaffDisableable, DaffDisableableDirective } from '@daffodil/design';
5
5
 
6
6
  type DaffSwitchLabelPosition = 'left' | 'right' | 'top' | 'bottom';
7
7
 
@@ -13,7 +13,7 @@ type DaffSwitchSize = DaffSizeSmallType;
13
13
  * <daff-switch>Label</daff-switch>
14
14
  * ```
15
15
  */
16
- declare class DaffSwitchComponent extends DaffSizableDirective<DaffSwitchSize> {
16
+ declare class DaffSwitchComponent extends DaffSizableDirective<DaffSwitchSize> implements DaffDisableable {
17
17
  private disabledDirective;
18
18
  /**
19
19
  * The position of the label relative to the switch.
package/tabs/README.md CHANGED
@@ -4,7 +4,7 @@ Tabs provide a way to navigate between panels that display related content witho
4
4
  ## Overview
5
5
  Tabs help organize related content into manageable sections, making it easier for users to find and focus on specific information. They're particularly useful for displaying content in compact spaces, such as within [modals](/libs/design/modal/README.md) or [cards](/libs/design/card/README.md), allowing users to switch between sections without navigating away from the current view.
6
6
 
7
- <design-land-example-viewer-container example="basic-tabs"></design-land-example-viewer-container>
7
+ <daff-docs-example-viewer example="basic-tabs"></daff-docs-example-viewer>
8
8
 
9
9
  ## Best practices
10
10
 
package/tabs/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import * as i0 from '@angular/core';
2
2
  import { TemplateRef, ElementRef, AfterContentInit, OnInit, EventEmitter, QueryList, ChangeDetectorRef } from '@angular/core';
3
3
  import * as i1 from '@daffodil/design';
4
- import { DaffDisableableDirective, DaffPrefixDirective, DaffSuffixDirective, DaffSelectableDirective } from '@daffodil/design';
4
+ import { DaffDisableable, DaffDisableableDirective, DaffPrefixDirective, DaffSuffixDirective, DaffSelectableDirective } from '@daffodil/design';
5
5
  import { Location } from '@angular/common';
6
6
  import { Params } from '@angular/router';
7
7
 
@@ -23,7 +23,7 @@ import { Params } from '@angular/router';
23
23
  * </daff-tab>
24
24
  * ```
25
25
  */
26
- declare class DaffTabComponent {
26
+ declare class DaffTabComponent implements DaffDisableable {
27
27
  private disabledDirective;
28
28
  /**
29
29
  * @docs-private
package/tag/README.md CHANGED
@@ -1,20 +1,12 @@
1
1
  # Tag
2
- Tags are compact visual indicators used to display short pieces of information, such as status, categories, or labels. They typically contain an icon, text label, and optionally a delete button for removable items.
2
+ Tags are compact visual indicators used to display short pieces of information such as status, categories, or labels.
3
3
 
4
4
  ## Overview
5
5
  Tag supports flexible content projection to allow for various combinations of icons, labels, and interactive elements within a consistent container.
6
6
 
7
- | Attribute | Description |
8
- | --------- | ----------- |
9
- | `daff-tag` | Flexible tag container that can contain an icon, a label, and a dismiss button |
10
-
11
-
12
- **Basic tag**
13
- <design-land-example-viewer-container example="basic-tag"></design-land-example-viewer-container>
7
+ <daff-docs-example-viewer example="basic-tag"></daff-docs-example-viewer>
14
8
 
15
9
  ## Usage
16
-
17
- ### Within a standalone component
18
10
  To use tag in a standalone component, import `DAFF_TAG_COMPONENTS` directly into your custom component.
19
11
 
20
12
  ```ts
@@ -31,10 +23,10 @@ export class CustomComponent {}
31
23
  ```
32
24
 
33
25
  ## Anatomy
34
- Tags should always have a label, unless you are only using an icon that is universally understood and accessible.
26
+ Tags should always include a text label unless the icon is universally understood and accessible.
35
27
 
36
- ### Icon support
37
- An icon can be rendered within the tag using the `daffPrefix` directive.
28
+ ### Icon
29
+ Use the `[daffPrefix]` element to display a leading visual icon for a tag.
38
30
 
39
31
  ```html
40
32
  <daff-tag>
@@ -43,45 +35,47 @@ An icon can be rendered within the tag using the `daffPrefix` directive.
43
35
  </daff-tag>
44
36
  ```
45
37
 
46
- ### Dismissible support
47
- A tag can be made dismissible by setting the `dismissible` property to `true`. This displays a close button that emits a `closeTag` event when clicked.
38
+ ## Features
39
+
40
+ ### Dismissible tag
41
+ Set `dismissible` to `true` to display a close button. The button emits a `closeTag` event when clicked.
48
42
 
49
43
  ```html
50
- <daff-tag dismissible (closeTag)="onCloseTag()">
44
+ <daff-tag [dismissible]="true" (closeTag)="onCloseTag()">
51
45
  <fa-icon [icon]="faCircleCheck" daffPrefix></fa-icon>
52
46
  <div>Tag label</div>
53
47
  </daff-tag>
54
48
  ```
55
49
 
56
- ### Disabled state
57
- Tags can be disabled by setting the `disabled` property to `true`. Disabled tags cannot be dismissed.
50
+ ### Disabled
51
+ Set `disabled` to `true` to disable the tag. Disabled tags cannot be dismissed.
58
52
 
59
53
  ```html
60
- <daff-tag dismissible disabled>
54
+ <daff-tag [disabled]="true">
61
55
  <fa-icon [icon]="faCircleCheck" daffPrefix></fa-icon>
62
56
  <div>Disabled tag</div>
63
57
  </daff-tag>
64
58
  ```
65
59
 
66
60
  ## Sizes
67
- Use the `size` property to control tag dimensions. The default size is `md`. Supported sizes: `sm`, `md`, `lg`.
61
+ Use the `size` property to control tag dimensions. Supported sizes: `sm`, `md` (default), `lg`.
68
62
 
69
- <design-land-example-viewer-container example="sizeable-tag"></design-land-example-viewer-container>
63
+ <daff-docs-example-viewer example="sizable-tag"></daff-docs-example-viewer>
70
64
 
71
65
  ## Colors
72
66
  Use the `color` property to change the color of a tag. Supported colors: `primary`, `secondary`, `tertiary`, `dark`, `light`, `theme`, `theme-contrast`.
73
67
 
74
- > Note: `dark`, `light`, and `theme` should be used on appropriate backgrounds for sufficient contrast.
75
-
76
- <design-land-example-viewer-container example="colorable-tag"></design-land-example-viewer-container>
68
+ <daff-docs-example-viewer example="colorable-tag"></daff-docs-example-viewer>
77
69
 
78
- ## Status indicators
79
- Status indicators help users understand the type of information a tag represents and its importance relative to other tags in the same context. Use the `status` property to convey different semantic meanings. Supported status: `warn`, `critical`, `info`, `success`.
70
+ ## Status
71
+ Use the `status` property to convey semantic meaning. Supported statuses: `warn`, `critical`, `info`, `success`.
80
72
 
81
- <design-land-example-viewer-container example="statusable-tag"></design-land-example-viewer-container>
73
+ <daff-docs-example-viewer example="statusable-tag"></daff-docs-example-viewer>
82
74
 
83
75
  ## Accessibility
84
- Daffodil uses semantic HTML elements and proper ARIA attributes to ensure an accessible experience by default.
76
+ No additional accessibility annotations are needed.
77
+
78
+ ### Keyboard interactions
79
+ Default tags are not interactive and do not receive focus.
85
80
 
86
- - The close button supports the `disabled` state with appropriate `aria-disabled` attributes
87
- - Use appropriate contrast ratios for text and background colors
81
+ Dismissible tags include a focusable close button that can be activated with `Enter` or `Space`.
package/tag/index.d.ts CHANGED
@@ -18,7 +18,7 @@ declare class DaffTagSizableDirective extends DaffSizableDirective<DaffTagSize>
18
18
  *
19
19
  * @example
20
20
  * ```html
21
- * <daff-tag dismissible (closeTag)="onCloseTag()">
21
+ * <daff-tag [dismissible]="true" (closeTag)="onCloseTag()">
22
22
  * <fa-icon daffPrefix [icon]="faCircleCheck"></fa-icon>
23
23
  * <div>Label</div>
24
24
  * </daff-tag>
@@ -4,7 +4,7 @@ A text snippet is used to display a section of text with the ability to show or
4
4
  ## Overview
5
5
  Text snippets provide a way to show previews of long content while allowing users to expand and read the full text when needed. They help condense screen space by truncating long text blocks such as product descriptions, reviews, or articles. By default, content is displayed in condensed mode with a toggle button to expand or collapse the full text.
6
6
 
7
- <design-land-example-viewer-container example="basic-text-snippet"></design-land-example-viewer-container>
7
+ <daff-docs-example-viewer example="basic-text-snippet"></daff-docs-example-viewer>
8
8
 
9
9
  ## Best practices
10
10
 
@@ -0,0 +1,12 @@
1
+ @use '../../scss/theming' as *;
2
+
3
+ @mixin daff-text-snippet-theme($theme) {
4
+ $base-contrast: daff-get-base-color($theme, base-contrast);
5
+
6
+ .daff-text-snippet {
7
+ &__toggle {
8
+ border-bottom: thin solid $base-contrast;
9
+ color: $base-contrast;
10
+ }
11
+ }
12
+ }
@@ -4,7 +4,7 @@ Textarea works alongside the HTML textarea element, with additional custom styli
4
4
  ## Overview
5
5
  Textarea has the same functionality as a native HTML textarea element, with additional custom styling and functionality. It **cannot** be used by itself and must be contained within a [form field](/libs/design/src/atoms/form/form-field/README.md).
6
6
 
7
- <design-land-example-viewer-container example="basic-textarea"></design-land-example-viewer-container>
7
+ <daff-docs-example-viewer example="basic-textarea"></daff-docs-example-viewer>
8
8
 
9
9
  ## Usage
10
10
  To use textarea, import `DaffTextareaComponent` directly into your custom component:
@@ -38,19 +38,19 @@ Textarea must be used inside `<daff-form-field>` to enable proper state manageme
38
38
  ### Disabled
39
39
  Textarea can be disabled in two ways: using Angular's reactive forms with `FormControl` or with the native HTML `disabled` attribute.
40
40
 
41
- <design-land-example-viewer-container example="textarea-disabled"></design-land-example-viewer-container>
41
+ <daff-docs-example-viewer example="textarea-disabled"></daff-docs-example-viewer>
42
42
 
43
43
  ### Error
44
44
  Textarea 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 textarea is invalid and has been touched or submitted.
45
45
 
46
- <design-land-example-viewer-container example="textarea-error"></design-land-example-viewer-container>
46
+ <daff-docs-example-viewer example="textarea-error"></daff-docs-example-viewer>
47
47
 
48
48
  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.
49
49
 
50
50
  ## Hints
51
51
  Hints provide additional context or instructions to help users complete the textarea field correctly. Use `<daff-hint>` within the form field to display helpful information below the textarea. Unlike error messages, hints are always visible and provide guidance rather than validation feedback.
52
52
 
53
- <design-land-example-viewer-container example="textarea-hint"></design-land-example-viewer-container>
53
+ <daff-docs-example-viewer example="textarea-hint"></daff-docs-example-viewer>
54
54
 
55
55
  ## Accessibility
56
56
  When `<daff-form-label>` is used within `<daff-form-field>`, the label automatically associates with the textarea using the `for` and `id` attributes.
@@ -24,16 +24,16 @@ declare class DaffTextareaComponent extends DaffFormFieldControl<string> impleme
24
24
  * @docs-private
25
25
  */
26
26
  get internalId(): string;
27
- /**
28
- * @docs-private
29
- */
30
- get disabledAttribute(): true;
31
27
  /**
32
28
  * @docs-private
33
29
  *
34
30
  * Implemented as part of DaffFormFieldControl.
35
31
  */
36
32
  disabled: boolean;
33
+ /**
34
+ * @docs-private
35
+ */
36
+ get disabledAttribute(): boolean;
37
37
  private _required;
38
38
  /**
39
39
  * @docs-private
package/toast/README.md CHANGED
@@ -6,7 +6,7 @@ Toasts communicate updates about actions or events that require attention but ar
6
6
 
7
7
  For short messages tied to page-level content or actions, use the [Notification](/libs/design/notification/README.md) component.
8
8
 
9
- <design-land-example-viewer-container example="default-toast"></design-land-example-viewer-container>
9
+ <daff-docs-example-viewer example="default-toast"></daff-docs-example-viewer>
10
10
 
11
11
  ## Usage
12
12
  Add `provideDaffToast()` to the root provider of your application to enable toast functionality:
@@ -58,14 +58,14 @@ By default, toasts without actions dismiss automatically after `5000ms`. Toasts
58
58
 
59
59
  > Actionable toasts should remain persistent. If a duration is required, make sure it is long enough for users to engage with the actions.
60
60
 
61
- <design-land-example-viewer-container example="toast-with-custom-duration"></design-land-example-viewer-container>
61
+ <daff-docs-example-viewer example="toast-with-custom-duration"></daff-docs-example-viewer>
62
62
 
63
63
  ### Close button
64
64
  The close button is hidden by default. When a toast contains actions, the `dismissible` property is ignored.
65
65
 
66
66
  For non-actionable toasts, the close button can be displayed by setting `dismissible: true`.
67
67
 
68
- <design-land-example-viewer-container example="dismissible-toast"></design-land-example-viewer-container>
68
+ <daff-docs-example-viewer example="dismissible-toast"></daff-docs-example-viewer>
69
69
 
70
70
  ## Stacking
71
71
  A maximum of three toasts can be displayed at once. Toasts stack vertically with the most recent toast at the top.
@@ -73,7 +73,7 @@ A maximum of three toasts can be displayed at once. Toasts stack vertically with
73
73
  ## Statuses
74
74
  Toast status can be set when opening a toast through the `DaffToastService` by using a `DaffStatus` value.
75
75
 
76
- <design-land-example-viewer-container example="toast-status"></design-land-example-viewer-container>
76
+ <daff-docs-example-viewer example="toast-status"></daff-docs-example-viewer>
77
77
 
78
78
  ## Positions
79
79
  On desktop, toasts appear in the top-right corner by default.
package/tree/README.md CHANGED
@@ -1,20 +1,15 @@
1
1
  # Tree
2
- Trees are used to visualize hierarchial information. They are often used to display navigational structures like nested lists of links.
2
+ Trees display hierarchical information in a nested, expandable format.
3
3
 
4
4
  ## Overview
5
- The `DaffTreeComponent` renders a tree structure. Typically, this is a structure of `<a>` and `<button>` elements that allow users to either navigate to a page, or explore the tree to find an item inside the tree that they want to navigate to.
5
+ Trees help users navigate complex structures by organizing content into parent and child relationships. They're commonly used for navigation menus, file browsers, and category lists. For flat lists without nested content, use the [navigation list](/libs/design/list/README.md) instead.
6
6
 
7
- Instead of defining a recursive tree structure of components, which is often prohibitively slow when rendering large trees, the `DaffTreeComponent` renders a flattened tree, using padding to indicate the nesting level of the tree elements.
8
-
9
- Generally, tree usage consists of taking existing tree data, converting it to the `DaffTreeData` format, setting the `tree` input on the `DaffTreeComponent`, and providing templates for the cases where the tree element has children or not.
10
-
11
- <design-land-example-viewer-container example="basic-tree">
12
- </design-land-example-viewer-container>
7
+ <daff-docs-example-viewer example="basic-tree"></daff-docs-example-viewer>
13
8
 
14
9
  ## Usage
15
10
 
16
11
  ### Within a standalone component
17
- To use sidebar in a standalone component, import `DAFF_TREE_COMPONENTS` directly into your custom component:
12
+ To use tree in a standalone component, import `DAFF_TREE_COMPONENTS` directly into your custom component:
18
13
 
19
14
  ```ts
20
15
  import { DAFF_TREE_COMPONENTS } from '@daffodil/design/tree';
@@ -30,7 +25,7 @@ export class CustomComponent {}
30
25
  ```
31
26
 
32
27
  ### Within a module (deprecated)
33
- To use sidebar in a module, import `DaffTreeModule` into your custom module:
28
+ To use tree in a module, import `DaffTreeModule` into your custom module:
34
29
 
35
30
  ```ts
36
31
  import { NgModule } from '@angular/core';
@@ -38,7 +33,7 @@ import { DaffTreeModule } from '@daffodil/design/tree';
38
33
  import { CustomComponent } from './custom.component';
39
34
 
40
35
  @NgModule({
41
- declarations: [
36
+ declarations: [
42
37
  CustomComponent,
43
38
  ],
44
39
  exports: [
@@ -51,23 +46,45 @@ import { CustomComponent } from './custom.component';
51
46
  export class CustomComponentModule { }
52
47
  ```
53
48
 
49
+ > **Warning**
50
+ >
54
51
  > This method is deprecated. It's recommended to update all custom components to standalone.
55
52
 
56
- ## Features
57
- The `DaffTreeComponent` controls the rendering of the structure of the tree and provides template slots so that you can control the ultimate UI rendered for each node.
53
+ ## Anatomy
54
+ A tree consists of the following parts:
58
55
 
59
- Currently, we support two kind of templates: `daffTreeItemWithChildrenTpl` and `daffTreeItemTpl`. These templates allow you to control the content of each tree node. In the case of `daffTreeItemWithChildrenTpl`, a `click` handler will be automatically applied (along with an icon indicating the expanded state) to the template to allow users to automatically open and close the node.
56
+ ### Container
57
+ `<daff-tree>`: The main wrapper that holds the tree and accepts your data.
60
58
 
61
- ```html
62
- <ng-template #daffTreeItemWithChildrenTpl let-node>
63
- <button daffTreeItem [node]="node">{{ node.title }} </button>
64
- </ng-template>
59
+ ### Node templates
60
+ Define how each tree item looks:
61
+
62
+ - `#daffTreeItemWithChildrenTpl`: For items that can expand to show children. Click handling and icons are added automatically.
63
+ - `#daffTreeItemTpl`: For items at the end of a branch with no children.
65
64
 
66
- <ng-template #daffTreeItemTpl let-node>
67
- <a daffTreeItem [node]="node" [routerLink]="node.url">{{ node.title }}</a>
68
- </ng-template>
65
+ ### Tree item
66
+ `[daffTreeItem]`: Added to links or buttons inside your templates to connect them to the tree.
67
+
68
+ ### Basic structure
69
+ ```html
70
+ <daff-tree [tree]="treeData">
71
+ <ng-template #daffTreeItemWithChildrenTpl let-node>
72
+ <button daffTreeItem [node]="node">{{ node.title }}</button>
73
+ </ng-template>
74
+
75
+ <ng-template #daffTreeItemTpl let-node>
76
+ <a daffTreeItem [node]="node" [routerLink]="node.url">{{ node.title }}</a>
77
+ </ng-template>
78
+ </daff-tree>
69
79
  ```
70
80
 
71
81
  ## Accessibility
82
+ The tree follows the [disclosure navigation menu](https://www.w3.org/WAI/ARIA/apg/patterns/disclosure/examples/disclosure-navigation/) pattern rather than the [tree view](https://www.w3.org/WAI/ARIA/apg/patterns/treeview/) pattern.
83
+
84
+ ### Daffodil provides
85
+ - Unique `id` automatically assigned to each tree item
86
+ - `aria-expanded` indicating whether a parent item is open or closed
72
87
 
73
- The `DaffTreeComponent` follows the specification for a [disclosure navigation menu](https://www.w3.org/WAI/ARIA/apg/patterns/disclosure/examples/disclosure-navigation/) instead of a [tree view](https://www.w3.org/WAI/ARIA/apg/patterns/treeview/).
88
+ ### Developer responsibilities
89
+ - Use links (`<a>`) for navigation and buttons (`<button>`) for expanding sections
90
+ - Write clear, descriptive text for each tree item