@daffodil/design 0.92.3 → 0.93.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 (153) hide show
  1. package/accordion/README.md +4 -4
  2. package/breadcrumb/README.md +13 -35
  3. package/button/README.md +28 -50
  4. package/card/README.md +8 -22
  5. package/card/src/card/stroked/stroked-theme.scss +8 -1
  6. package/card/src/card-base-theme.scss +12 -1
  7. package/container/README.md +4 -26
  8. package/fesm2022/daffodil-design-accordion.mjs +15 -15
  9. package/fesm2022/daffodil-design-accordion.mjs.map +1 -1
  10. package/fesm2022/daffodil-design-article.mjs +30 -30
  11. package/fesm2022/daffodil-design-article.mjs.map +1 -1
  12. package/fesm2022/daffodil-design-breadcrumb.mjs +20 -20
  13. package/fesm2022/daffodil-design-breadcrumb.mjs.map +1 -1
  14. package/fesm2022/daffodil-design-button.mjs +37 -49
  15. package/fesm2022/daffodil-design-button.mjs.map +1 -1
  16. package/fesm2022/daffodil-design-callout.mjs +22 -22
  17. package/fesm2022/daffodil-design-callout.mjs.map +1 -1
  18. package/fesm2022/daffodil-design-card.mjs +31 -31
  19. package/fesm2022/daffodil-design-card.mjs.map +1 -1
  20. package/fesm2022/daffodil-design-checkbox.mjs +13 -13
  21. package/fesm2022/daffodil-design-checkbox.mjs.map +1 -1
  22. package/fesm2022/daffodil-design-container.mjs +7 -7
  23. package/fesm2022/daffodil-design-container.mjs.map +1 -1
  24. package/fesm2022/daffodil-design-form-field.mjs +13 -12
  25. package/fesm2022/daffodil-design-form-field.mjs.map +1 -1
  26. package/fesm2022/daffodil-design-form.mjs +9 -9
  27. package/fesm2022/daffodil-design-form.mjs.map +1 -1
  28. package/fesm2022/daffodil-design-hero.mjs +22 -22
  29. package/fesm2022/daffodil-design-hero.mjs.map +1 -1
  30. package/fesm2022/daffodil-design-image.mjs +8 -8
  31. package/fesm2022/daffodil-design-image.mjs.map +1 -1
  32. package/fesm2022/daffodil-design-input.mjs +12 -11
  33. package/fesm2022/daffodil-design-input.mjs.map +1 -1
  34. package/fesm2022/daffodil-design-link-set.mjs +16 -16
  35. package/fesm2022/daffodil-design-link-set.mjs.map +1 -1
  36. package/fesm2022/daffodil-design-list.mjs +20 -17
  37. package/fesm2022/daffodil-design-list.mjs.map +1 -1
  38. package/fesm2022/daffodil-design-loading-icon.mjs +7 -7
  39. package/fesm2022/daffodil-design-loading-icon.mjs.map +1 -1
  40. package/fesm2022/daffodil-design-media-gallery.mjs +13 -13
  41. package/fesm2022/daffodil-design-media-gallery.mjs.map +1 -1
  42. package/fesm2022/daffodil-design-menu.mjs +20 -20
  43. package/fesm2022/daffodil-design-menu.mjs.map +1 -1
  44. package/fesm2022/daffodil-design-modal.mjs +32 -26
  45. package/fesm2022/daffodil-design-modal.mjs.map +1 -1
  46. package/fesm2022/daffodil-design-native-select.mjs +5 -3
  47. package/fesm2022/daffodil-design-native-select.mjs.map +1 -1
  48. package/fesm2022/daffodil-design-navbar.mjs +9 -9
  49. package/fesm2022/daffodil-design-navbar.mjs.map +1 -1
  50. package/fesm2022/daffodil-design-notification.mjs +16 -16
  51. package/fesm2022/daffodil-design-notification.mjs.map +1 -1
  52. package/fesm2022/daffodil-design-paginator.mjs +8 -8
  53. package/fesm2022/daffodil-design-paginator.mjs.map +1 -1
  54. package/fesm2022/daffodil-design-progress-bar.mjs +10 -10
  55. package/fesm2022/daffodil-design-progress-bar.mjs.map +1 -1
  56. package/fesm2022/daffodil-design-quantity-field.mjs +13 -13
  57. package/fesm2022/daffodil-design-quantity-field.mjs.map +1 -1
  58. package/fesm2022/daffodil-design-radio.mjs +16 -16
  59. package/fesm2022/daffodil-design-radio.mjs.map +1 -1
  60. package/fesm2022/daffodil-design-select.mjs +11 -11
  61. package/fesm2022/daffodil-design-select.mjs.map +1 -1
  62. package/fesm2022/daffodil-design-sidebar.mjs +35 -29
  63. package/fesm2022/daffodil-design-sidebar.mjs.map +1 -1
  64. package/fesm2022/daffodil-design-spinner.mjs +7 -7
  65. package/fesm2022/daffodil-design-spinner.mjs.map +1 -1
  66. package/fesm2022/daffodil-design-switch.mjs +3 -3
  67. package/fesm2022/daffodil-design-switch.mjs.map +1 -1
  68. package/fesm2022/daffodil-design-tabs.mjs +17 -25
  69. package/fesm2022/daffodil-design-tabs.mjs.map +1 -1
  70. package/fesm2022/daffodil-design-tag.mjs +20 -20
  71. package/fesm2022/daffodil-design-tag.mjs.map +1 -1
  72. package/fesm2022/daffodil-design-testing.mjs +19 -0
  73. package/fesm2022/daffodil-design-testing.mjs.map +1 -0
  74. package/fesm2022/daffodil-design-text-snippet.mjs +3 -3
  75. package/fesm2022/daffodil-design-text-snippet.mjs.map +1 -1
  76. package/fesm2022/daffodil-design-textarea.mjs +3 -3
  77. package/fesm2022/daffodil-design-textarea.mjs.map +1 -1
  78. package/fesm2022/daffodil-design-toast.mjs +21 -21
  79. package/fesm2022/daffodil-design-toast.mjs.map +1 -1
  80. package/fesm2022/daffodil-design-tree.mjs +27 -25
  81. package/fesm2022/daffodil-design-tree.mjs.map +1 -1
  82. package/fesm2022/daffodil-design-youtube-player.mjs +22 -11
  83. package/fesm2022/daffodil-design-youtube-player.mjs.map +1 -1
  84. package/fesm2022/daffodil-design.mjs +110 -149
  85. package/fesm2022/daffodil-design.mjs.map +1 -1
  86. package/form/README.md +15 -6
  87. package/hero/README.md +14 -49
  88. package/image/README.md +6 -29
  89. package/input/README.md +8 -34
  90. package/list/README.md +29 -55
  91. package/list/src/list-theme.scss +16 -2
  92. package/media-gallery/README.md +36 -43
  93. package/menu/README.md +24 -55
  94. package/menu/src/menu-theme.scss +12 -2
  95. package/modal/README.md +15 -45
  96. package/native-select/README.md +8 -6
  97. package/navbar/README.md +18 -27
  98. package/notification/README.md +14 -49
  99. package/package.json +1 -1
  100. package/paginator/README.md +11 -31
  101. package/paginator/src/paginator-theme.scss +16 -2
  102. package/progress-bar/README.md +14 -41
  103. package/scss/global.scss +21 -2
  104. package/select/README.md +5 -6
  105. package/select/src/select-theme.scss +10 -2
  106. package/sidebar/README.md +1 -1
  107. package/spinner/README.md +15 -9
  108. package/switch/README.md +17 -6
  109. package/tabs/README.md +39 -39
  110. package/tag/README.md +24 -28
  111. package/textarea/README.md +9 -7
  112. package/toast/README.md +55 -52
  113. package/tree/README.md +12 -43
  114. package/tree/src/tree-theme.scss +8 -4
  115. package/{accordion/index.d.ts → types/daffodil-design-accordion.d.ts} +1 -1
  116. package/{button/index.d.ts → types/daffodil-design-button.d.ts} +7 -8
  117. package/{input/index.d.ts → types/daffodil-design-input.d.ts} +4 -1
  118. package/{list/index.d.ts → types/daffodil-design-list.d.ts} +4 -1
  119. package/{menu/index.d.ts → types/daffodil-design-menu.d.ts} +3 -3
  120. package/{modal/index.d.ts → types/daffodil-design-modal.d.ts} +11 -5
  121. package/{native-select/index.d.ts → types/daffodil-design-native-select.d.ts} +3 -1
  122. package/{sidebar/index.d.ts → types/daffodil-design-sidebar.d.ts} +9 -3
  123. package/{tabs/index.d.ts → types/daffodil-design-tabs.d.ts} +0 -6
  124. package/{tag/index.d.ts → types/daffodil-design-tag.d.ts} +9 -8
  125. package/types/daffodil-design-testing.d.ts +11 -0
  126. package/{tree/index.d.ts → types/daffodil-design-tree.d.ts} +2 -0
  127. package/{youtube-player/index.d.ts → types/daffodil-design-youtube-player.d.ts} +15 -0
  128. package/{index.d.ts → types/daffodil-design.d.ts} +17 -64
  129. /package/{article/index.d.ts → types/daffodil-design-article.d.ts} +0 -0
  130. /package/{breadcrumb/index.d.ts → types/daffodil-design-breadcrumb.d.ts} +0 -0
  131. /package/{callout/index.d.ts → types/daffodil-design-callout.d.ts} +0 -0
  132. /package/{card/index.d.ts → types/daffodil-design-card.d.ts} +0 -0
  133. /package/{checkbox/index.d.ts → types/daffodil-design-checkbox.d.ts} +0 -0
  134. /package/{container/index.d.ts → types/daffodil-design-container.d.ts} +0 -0
  135. /package/{form-field/index.d.ts → types/daffodil-design-form-field.d.ts} +0 -0
  136. /package/{form/index.d.ts → types/daffodil-design-form.d.ts} +0 -0
  137. /package/{hero/index.d.ts → types/daffodil-design-hero.d.ts} +0 -0
  138. /package/{image/index.d.ts → types/daffodil-design-image.d.ts} +0 -0
  139. /package/{link-set/index.d.ts → types/daffodil-design-link-set.d.ts} +0 -0
  140. /package/{loading-icon/index.d.ts → types/daffodil-design-loading-icon.d.ts} +0 -0
  141. /package/{media-gallery/index.d.ts → types/daffodil-design-media-gallery.d.ts} +0 -0
  142. /package/{navbar/index.d.ts → types/daffodil-design-navbar.d.ts} +0 -0
  143. /package/{notification/index.d.ts → types/daffodil-design-notification.d.ts} +0 -0
  144. /package/{paginator/index.d.ts → types/daffodil-design-paginator.d.ts} +0 -0
  145. /package/{progress-bar/index.d.ts → types/daffodil-design-progress-bar.d.ts} +0 -0
  146. /package/{quantity-field/index.d.ts → types/daffodil-design-quantity-field.d.ts} +0 -0
  147. /package/{radio/index.d.ts → types/daffodil-design-radio.d.ts} +0 -0
  148. /package/{select/index.d.ts → types/daffodil-design-select.d.ts} +0 -0
  149. /package/{spinner/index.d.ts → types/daffodil-design-spinner.d.ts} +0 -0
  150. /package/{switch/index.d.ts → types/daffodil-design-switch.d.ts} +0 -0
  151. /package/{text-snippet/index.d.ts → types/daffodil-design-text-snippet.d.ts} +0 -0
  152. /package/{textarea/index.d.ts → types/daffodil-design-textarea.d.ts} +0 -0
  153. /package/{toast/index.d.ts → types/daffodil-design-toast.d.ts} +0 -0
@@ -32,7 +32,12 @@
32
32
  border-top: 1px solid $border-color-light;
33
33
  }
34
34
 
35
- &:hover,
35
+ @media (hover: hover) {
36
+ &:hover {
37
+ background-color: daff-color($neutral, 10);
38
+ }
39
+ }
40
+
36
41
  &.highlighted {
37
42
  background-color: daff-color($neutral, 10);
38
43
  }
@@ -57,7 +62,10 @@
57
62
  border-top: 1px solid $border-color-dark;
58
63
  }
59
64
 
60
- &:hover,
65
+ @media (hover: hover) {
66
+ background-color: daff-color($neutral, 90);
67
+ }
68
+
61
69
  &.highlighted {
62
70
  background-color: daff-color($neutral, 90);
63
71
  }
package/sidebar/README.md CHANGED
@@ -206,7 +206,7 @@ body {
206
206
 
207
207
  ## Accessibility
208
208
 
209
- ### Daffodil provides
209
+ ### Built-in
210
210
  - Automatic focus trapping for `over` and `under` modes (disabled for `side` and `side-fixed` modes)
211
211
  - Focus moves to the first tabbable element when sidebar opens
212
212
  - Focus returns to the previously focused element when sidebar closes
package/spinner/README.md CHANGED
@@ -2,10 +2,13 @@
2
2
  A spinner is an animated indicator that lets users know content or action is being loaded.
3
3
 
4
4
  ## Overview
5
- Use a spinner to indicate a short, indeterminate loading state. It can appear on its own or paired with a loading message. For longer processes with measurable progress, use the [progress bar](/libs/design/progress-bar/README.md) component.
5
+ Use a spinner to indicate a short, indeterminate loading state. It can appear on its own or paired with a loading message. For longer processes with measurable progress, use the [Progress Bar](/libs/design/progress-bar/README.md) component.
6
+
7
+ <daff-docs-example-viewer example="basic-spinner"></daff-docs-example-viewer>
6
8
 
7
9
  ## Usage
8
- To use spinner, import `DAFF_SPINNER_COMPONENTS` directly into your custom component:
10
+
11
+ Import `DAFF_SPINNER_COMPONENTS` into your component:
9
12
 
10
13
  ```ts
11
14
  import { DAFF_SPINNER_COMPONENTS } from '@daffodil/design/spinner';
@@ -21,9 +24,7 @@ export class CustomComponent {}
21
24
  ```
22
25
 
23
26
  ## Anatomy
24
-
25
- ### Label
26
- Labels are used to describe the loading state and provide context for users. They are optional.
27
+ A spinner is composed of an animated indicator with an optional label:
27
28
 
28
29
  ```html
29
30
  <daff-spinner>
@@ -31,7 +32,8 @@ Labels are used to describe the loading state and provide context for users. The
31
32
  </daff-spinner>
32
33
  ```
33
34
 
34
- <daff-docs-example-viewer example="spinner-with-label"></daff-docs-example-viewer>
35
+ - **`<daff-spinner>`**: The animated loading indicator.
36
+ - **`<daff-spinner-label>`**: An optional label that describes the loading state and provides context for users.
35
37
 
36
38
  ## Features
37
39
 
@@ -43,14 +45,18 @@ Use the `color` property to change the color of a spinner.
43
45
  <daff-docs-example-viewer example="spinner-colors"></daff-docs-example-viewer>
44
46
 
45
47
  ### Sizes
46
- Use the `size` proeprty to change the size of a spinner. The default size is `md`.
48
+ Use the `size` property to change the size of a spinner. The default size is `md`.
47
49
 
48
50
  <daff-docs-example-viewer example="spinner-sizes"></daff-docs-example-viewer>
49
51
 
50
52
  ## Accessibility
51
- The spinner has `role="status"` which announces content changes to assistive technologies.
52
53
 
53
- When using `<daff-spinner-label>`, the visible text serves as the accessible name. When no label is provided, the spinner defaults to `aria-label="loading"`. You can customize this with the `aria-label` input:
54
+ ### Built-in behavior
55
+ - `role="status"` on the spinner announces content changes to assistive technologies.
56
+ - When `<daff-spinner-label>` is used, its visible text serves as the accessible name. When no label is provided, the spinner defaults to `aria-label="loading"`.
57
+
58
+ ### Developer responsibilities
59
+ - When no label is shown, customize the accessible name with the `aria-label` input to describe the loading state:
54
60
 
55
61
  ```html
56
62
  <daff-spinner aria-label="Saving changes"></daff-spinner>
package/switch/README.md CHANGED
@@ -2,14 +2,13 @@
2
2
  A switch allows users to toggle the state of a single setting.
3
3
 
4
4
  ## Overview
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.
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.
6
6
 
7
7
  <daff-docs-example-viewer example="basic-switch"></daff-docs-example-viewer>
8
8
 
9
9
  ## Usage
10
10
 
11
- ### Within a standalone component
12
- To use switch, import `DAFF_SWITCH_COMPONENTS` directly into your custom component:
11
+ Import `DAFF_SWITCH_COMPONENTS` into your component:
13
12
 
14
13
  ```ts
15
14
  import { DAFF_SWITCH_COMPONENTS } from '@daffodil/design/switch';
@@ -24,17 +23,28 @@ import { DAFF_SWITCH_COMPONENTS } from '@daffodil/design/switch';
24
23
  export class CustomComponent {}
25
24
  ```
26
25
 
27
- ## Sizes
26
+ ## Anatomy
27
+ A switch consists of a toggle control with a label projected as content:
28
+
29
+ ```html
30
+ <daff-switch>Wi-Fi</daff-switch>
31
+ ```
32
+
33
+ - **`<daff-switch>`**: The switch control. The label is provided as projected content and is automatically associated with the toggle.
34
+
35
+ ## Features
36
+
37
+ ### Sizes
28
38
  A small switch variant is available for dense layouts. Use the `size="sm"` property to render a more compact version of a switch.
29
39
 
30
40
  <daff-docs-example-viewer example="switch-sizes"></daff-docs-example-viewer>
31
41
 
32
- ## Disable a switch
42
+ ### Disabled switch
33
43
  Use the `disabled` property on switch to make it non-interactive.
34
44
 
35
45
  <daff-docs-example-viewer example="disabled-switch"></daff-docs-example-viewer>
36
46
 
37
- ## Label positions
47
+ ### Label positions
38
48
  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
49
 
40
50
  <daff-docs-example-viewer example="switch-label-positions"></daff-docs-example-viewer>
@@ -42,6 +52,7 @@ Use the `labelPosition` property to control the visual relationship between the
42
52
  ## Accessibility
43
53
  Switch follows the [ARIA Switch design pattern](https://www.w3.org/WAI/ARIA/apg/patterns/switch/).
44
54
 
55
+ ### Built-in behavior
45
56
  - The switch control is implemented as a `<button>` element with a role of `switch`.
46
57
  - `aria-checked` is used to indicate the switch's on/off state.
47
58
  - Links the switch to its label `id` using `aria-labelledby`.
package/tabs/README.md CHANGED
@@ -13,15 +13,13 @@ Tabs help organize related content into manageable sections, making it easier fo
13
13
  - Working within limited screen space
14
14
  - Allowing users to switch between content views without page navigation
15
15
 
16
- ## When not to use
17
- Avoid tabs when:
16
+ **When not to use**
18
17
  - Content needs to be compared or viewed simultaneously
19
- - Users need to see all content in a sequential sequence
18
+ - Users need to see all content in a sequential order
20
19
 
21
20
  ## Usage
22
21
 
23
- ### Within a standalone component
24
- To use tabs in a standalone component, import `DAFF_TABS_COMPONENTS` directly into your custom component:
22
+ Import `DAFF_TABS_COMPONENTS` into your component:
25
23
 
26
24
  ```ts
27
25
  import { DAFF_TABS_COMPONENTS } from '@daffodil/design/tabs';
@@ -37,24 +35,8 @@ export class CustomComponent {}
37
35
  ```
38
36
 
39
37
  ## Anatomy
40
- A tabs component consists of the following components:
38
+ A tabs component is composed of a container, tabs, labels, and panels:
41
39
 
42
- ### Container
43
- **`<daff-tabs>`**: The wrapper component that contains all tabs.
44
-
45
- ### Tab
46
- **`<daff-tab>`**: Represents a single tab that groups a label and its corresponding panel together.
47
-
48
- ### Tab Label
49
- **`<daff-tab-label>`**: The clickable label that activates its corresponding tab panel. Labels can contain text, icons, or both.
50
-
51
- ### Icon
52
- Use the `[daffPrefix]` or `[daffSuffix]` element to add a decorative icon before or after the label text. This provides quick visual cues about the tab's purpose.
53
-
54
- ### Tab Panel
55
- **`<daff-tab-panel>`**: The content area displayed when a tab is active.
56
-
57
- ### Basic structure
58
40
  ```html
59
41
  <daff-tabs>
60
42
  <daff-tab>
@@ -70,35 +52,45 @@ Use the `[daffPrefix]` or `[daffSuffix]` element to add a decorative icon before
70
52
  </daff-tabs>
71
53
  ```
72
54
 
55
+ - **`<daff-tabs>`**: The wrapper component that contains all tabs.
56
+ - **`<daff-tab>`**: A single tab that groups a label and its corresponding panel together.
57
+ - **`<daff-tab-label>`**: The clickable label that activates its corresponding tab panel. Labels can contain text, icons, or both.
58
+ - **`<daff-tab-panel>`**: The content area displayed when a tab is active.
59
+ - Add the `[daffPrefix]` or `[daffSuffix]` directive to an icon to place it before or after the label text. This provides a quick visual cue about the tab's purpose.
60
+
73
61
  ## Features
74
62
 
75
63
  ### Link mode
76
- Tabs in link mode replace the tab buttons with anchors, allowing the selected tab to be connected to a URL.
64
+ Set `linkMode` to `true` to replace the tab buttons with anchors, connecting the selected tab to a URL.
77
65
 
78
- By default, the current URL and `tab` query param will be used. These can be overriden with the `url` and `queryParam` inputs, respectively.
66
+ By default, the current URL and `tab` query param are used. Override these with the `url` and `queryParam` inputs, respectively.
79
67
 
80
- ```html
81
- <daff-tabs [linkMode]="true">
82
- </daff-tabs>
83
- ```
68
+ <daff-docs-example-viewer example="link-tabs"></daff-docs-example-viewer>
69
+
70
+ ### Initially selected tab
71
+ Set the `initiallySelected` input to a tab's `id` to select that tab on load. Without it, the first tab is selected by default.
72
+
73
+ <daff-docs-example-viewer example="initially-select-tab"></daff-docs-example-viewer>
74
+
75
+ ### Disabled tab
76
+ Set the `disabled` property on a `<daff-tab>` to make it non-interactive.
77
+
78
+ <daff-docs-example-viewer example="disabled-tabs"></daff-docs-example-viewer>
79
+
80
+ ### Programmatic selection
81
+ Call the `select` method with a tab's `id` to change the active tab from your own code.
82
+
83
+ <daff-docs-example-viewer example="custom-select-tabs"></daff-docs-example-viewer>
84
84
 
85
85
  ## Accessibility
86
86
  Tabs follow the [Tabs WAI-ARIA design pattern](https://www.w3.org/WAI/ARIA/apg/patterns/tabs/).
87
87
 
88
- ### Daffodil provides
89
- - `role="tablist"`, `role="tab"`, and `role="tabpanel"` on appropriate elements
90
- - Unique IDs automatically assigned to each tab (customizable via `id` attribute)
88
+ ### Built-in behavior
89
+ - `role="tablist"`, `role="tab"`, and `role="tabpanel"` on the appropriate elements
90
+ - Unique IDs automatically assigned to each tab (customizable via the `id` attribute)
91
91
  - `aria-labelledby` linking tab panels to their corresponding tab labels
92
92
  - `aria-selected` indicating the active tab
93
93
 
94
- #### Keyboard interactions
95
- | Key | Action |
96
- | --- | ------ |
97
- | `Left Arrow` | Moves focus and activates the previous tab. If focus is on the first tab, focus moves to the last tab. |
98
- | `Right Arrow` | Moves focus and activates the next tab. If focus is on the last tab, focus moves to the first tab. |
99
- | `Home` | Moves focus and activates the first tab. |
100
- | `End` | Moves focus and activates the last tab. |
101
-
102
94
  ### Developer responsibilities
103
95
  - Provide a meaningful `aria-label` on `<daff-tabs>` to describe the tab group
104
96
  - Keep tab labels concise and descriptive
@@ -111,3 +103,11 @@ Tabs follow the [Tabs WAI-ARIA design pattern](https://www.w3.org/WAI/ARIA/apg/p
111
103
  </daff-tab>
112
104
  </daff-tabs>
113
105
  ```
106
+
107
+ ### Keyboard interactions
108
+ | Key | Action |
109
+ | --- | ------ |
110
+ | `Left Arrow` | Moves focus and activates the previous tab. If focus is on the first tab, focus moves to the last tab. |
111
+ | `Right Arrow` | Moves focus and activates the next tab. If focus is on the last tab, focus moves to the first tab. |
112
+ | `Home` | Moves focus and activates the first tab. |
113
+ | `End` | Moves focus and activates the last tab. |
package/tag/README.md CHANGED
@@ -7,7 +7,8 @@ Tag supports flexible content projection to allow for various combinations of ic
7
7
  <daff-docs-example-viewer example="basic-tag"></daff-docs-example-viewer>
8
8
 
9
9
  ## Usage
10
- To use tag in a standalone component, import `DAFF_TAG_COMPONENTS` directly into your custom component.
10
+
11
+ Import `DAFF_TAG_COMPONENTS` into your component:
11
12
 
12
13
  ```ts
13
14
  import { DAFF_TAG_COMPONENTS } from '@daffodil/design/tag';
@@ -23,59 +24,54 @@ export class CustomComponent {}
23
24
  ```
24
25
 
25
26
  ## Anatomy
26
- Tags should always include a text label unless the icon is universally understood and accessible.
27
-
28
- ### Icon
29
- Use the `[daffPrefix]` element to display a leading visual icon for a tag.
27
+ A tag is composed of a wrapper, an optional prefix, a label, and an optional close button:
30
28
 
31
29
  ```html
32
- <daff-tag>
30
+ <daff-tag [dismissible]="true" (closeTag)="onCloseTag()">
33
31
  <fa-icon [icon]="faCircleCheck" daffPrefix></fa-icon>
34
- <div>Tag label</div>
32
+ Tag label
35
33
  </daff-tag>
36
34
  ```
37
35
 
36
+ - **`<daff-tag>`**: The wrapper component that holds all tag content.
37
+ - **`[daffPrefix]`**: A leading visual, typically an icon, displayed before the label.
38
+ - **Label**: The text content of the tag, projected as a child element.
39
+ - **Close button**: A trailing dismiss button, displayed when `dismissible` is `true`.
40
+
38
41
  ## Features
39
42
 
40
- ### Dismissible tag
43
+ ### Dismissible tags
41
44
  Set `dismissible` to `true` to display a close button. The button emits a `closeTag` event when clicked.
42
45
 
43
- ```html
44
- <daff-tag [dismissible]="true" (closeTag)="onCloseTag()">
45
- <fa-icon [icon]="faCircleCheck" daffPrefix></fa-icon>
46
- <div>Tag label</div>
47
- </daff-tag>
48
- ```
46
+ <daff-docs-example-viewer example="dismissible-tag"></daff-docs-example-viewer>
49
47
 
50
- ### Disabled
48
+ ### Disabled tags
51
49
  Set `disabled` to `true` to disable the tag. Disabled tags cannot be dismissed.
52
50
 
53
- ```html
54
- <daff-tag [disabled]="true">
55
- <fa-icon [icon]="faCircleCheck" daffPrefix></fa-icon>
56
- <div>Disabled tag</div>
57
- </daff-tag>
58
- ```
51
+ <daff-docs-example-viewer example="disabled-tag"></daff-docs-example-viewer>
59
52
 
60
- ## Sizes
53
+ ### Sizes
61
54
  Use the `size` property to control tag dimensions. Supported sizes: `sm`, `md` (default), `lg`.
62
55
 
63
56
  <daff-docs-example-viewer example="sizable-tag"></daff-docs-example-viewer>
64
57
 
65
- ## Colors
58
+ ### Colors
66
59
  Use the `color` property to change the color of a tag. Supported colors: `primary`, `secondary`, `tertiary`, `dark`, `light`, `theme`, `theme-contrast`.
67
60
 
68
61
  <daff-docs-example-viewer example="colorable-tag"></daff-docs-example-viewer>
69
62
 
70
- ## Status
63
+ ### Statuses
71
64
  Use the `status` property to convey semantic meaning. Supported statuses: `warn`, `critical`, `info`, `success`.
72
65
 
73
66
  <daff-docs-example-viewer example="statusable-tag"></daff-docs-example-viewer>
74
67
 
75
68
  ## Accessibility
76
- No additional accessibility annotations are needed.
77
69
 
78
- ### Keyboard interactions
79
- Default tags are not interactive and do not receive focus.
70
+ ### Built-in behavior
71
+ - Default tags are not interactive and do not receive focus.
72
+ - Dismissible tags include a focusable close button that can be activated with `Enter` or `Space`.
73
+ - Disabled tags expose `aria-disabled="true"` and ignore close button activation.
80
74
 
81
- Dismissible tags include a focusable close button that can be activated with `Enter` or `Space`.
75
+ ### Developer responsibilities
76
+ - Always provide a text label unless the icon is universally understood and accessible.
77
+ - Use the `status` property to communicate semantic meaning, rather than relying on color alone.
@@ -2,12 +2,12 @@
2
2
  Textarea works alongside the HTML textarea element, with additional custom styling and functionality.
3
3
 
4
4
  ## Overview
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).
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/form-field/README.md).
6
6
 
7
7
  <daff-docs-example-viewer example="basic-textarea"></daff-docs-example-viewer>
8
8
 
9
9
  ## Usage
10
- To use textarea, import `DaffTextareaComponent` directly into your custom component:
10
+ Import `DaffTextareaComponent` into your component:
11
11
 
12
12
  ```ts
13
13
  import { DaffTextareaComponent } from '@daffodil/design/textarea';
@@ -25,7 +25,6 @@ export class CustomComponent {}
25
25
  ## Anatomy
26
26
  Textarea must be used inside `<daff-form-field>` to enable proper state management and provide enhanced UI features such as hints, error messages, prefixes, and suffixes. The form field component also ensures accessibility compliance. For more details, see the [form field documentation](/libs/design/form-field/README.md).
27
27
 
28
- ### Basic structure
29
28
  ```html
30
29
  <daff-form-field>
31
30
  <daff-form-label>Comments</daff-form-label>
@@ -33,7 +32,7 @@ Textarea must be used inside `<daff-form-field>` to enable proper state manageme
33
32
  </daff-form-field>
34
33
  ```
35
34
 
36
- ## States
35
+ ## Features
37
36
 
38
37
  ### Disabled
39
38
  Textarea can be disabled in two ways: using Angular's reactive forms with `FormControl` or with the native HTML `disabled` attribute.
@@ -47,12 +46,15 @@ Textarea supports validation and error messages through Angular's form validatio
47
46
 
48
47
  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
48
 
50
- ## Hints
49
+ ### Hints
51
50
  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
51
 
53
52
  <daff-docs-example-viewer example="textarea-hint"></daff-docs-example-viewer>
54
53
 
55
54
  ## Accessibility
56
- When `<daff-form-label>` is used within `<daff-form-field>`, the label automatically associates with the textarea using the `for` and `id` attributes.
57
55
 
58
- If a `<daff-form-label>` is not specified, use the `<label>` element to associate text with form elements explicitly. The `for` attribute of the label must exactly match the `id` of the form control.
56
+ ### Built-in behavior
57
+ - When `<daff-form-label>` is used within `<daff-form-field>`, the label automatically associates with the textarea using the `for` and `id` attributes.
58
+
59
+ ### Developer responsibilities
60
+ - If a `<daff-form-label>` is not specified, use the `<label>` element to associate text with form elements explicitly. The `for` attribute of the label must exactly match the `id` of the form control.
package/toast/README.md CHANGED
@@ -4,81 +4,79 @@ Toasts are notifications that provide application-level information. They are de
4
4
  ## Overview
5
5
  Toasts communicate updates about actions or events that require attention but are not directly tied to specific page content.
6
6
 
7
- For short messages tied to page-level content or actions, use the [Notification](/libs/design/notification/README.md) component.
7
+ For short messages tied to page-level content or actions, use the [notification](/libs/design/notification/README.md) component.
8
8
 
9
9
  <daff-docs-example-viewer example="default-toast"></daff-docs-example-viewer>
10
10
 
11
11
  ## Usage
12
- Add `provideDaffToast()` to the root provider of your application to enable toast functionality:
12
+ Add `provideDaffToast()` to your application's root providers:
13
13
 
14
14
  ```ts
15
+ import { ApplicationConfig } from '@angular/core';
15
16
  import { provideDaffToast } from '@daffodil/design/toast';
16
17
 
17
- @NgModule({
18
+ export const appConfig: ApplicationConfig = {
18
19
  providers: [
19
20
  provideDaffToast(),
20
- ]
21
- )}
22
-
23
- export class AppModule {}
21
+ ],
22
+ };
24
23
  ```
25
24
 
26
- ## Anatomy
27
- When opening a toast with the `DaffToastService`, you can provide a `title`, `message`, and `actions` to define its content.
28
-
29
- **Title**\
30
- The primary text that summarizes the purpose of the toast.
31
-
32
- **Message**\
33
- Provides additional details or context about the toast. Keep this brief—ideally one to two short sentences.
34
-
35
- **Actions**\
36
- Include actionable buttons related to the toast. **A maximum of two buttons is recommended** to keep the toast concise.
25
+ Then inject `DaffToastService` to open toasts from your component:
37
26
 
38
27
  ```ts
39
- open() {
40
- this.toast = this.toastService.open({
41
- title: 'Update Available' + ' ' + this.count++,
42
- message: 'A new version of this page is available.',
43
- actions: [
44
- { content: 'Update', color: 'theme-contrast', size: 'sm', eventEmitter: this.update },
45
- { content: 'Remind me later', type: 'flat', size: 'sm', eventEmitter: this.closeToast },
46
- ],
47
- });
28
+ import { DaffToastService } from '@daffodil/design/toast';
29
+
30
+ @Component({
31
+ selector: 'custom-component',
32
+ templateUrl: './custom-component.component.html',
33
+ })
34
+ export class CustomComponent {
35
+ constructor(private toastService: DaffToastService) {}
48
36
  }
49
37
  ```
50
38
 
51
- ## Dismissal
52
- Toasts can be dismissed automatically via a timed duration or manually with a close button.
39
+ ## Anatomy
40
+ A toast is composed of a title, message, and optional actions:
53
41
 
54
- `duration` and `dismissible` can be configured when opening a toast with the `DaffToastService`.
42
+ ```ts
43
+ this.toastService.open({
44
+ title: 'Update available',
45
+ message: 'A new version of this page is available.',
46
+ actions: [
47
+ { content: 'Update', color: 'theme-contrast', size: 'sm' },
48
+ { content: 'Remind me later', type: 'flat', size: 'sm' },
49
+ ],
50
+ });
51
+ ```
55
52
 
56
- ### Timed duration
57
- By default, toasts without actions dismiss automatically after `5000ms`. Toasts with actions remain visible until dismissed manually or until an action is taken.
53
+ - **`title`**: The primary text that summarizes the purpose of the toast.
54
+ - **`message`**: Additional details or context about the toast. Keep this brief ideally one to two short sentences.
55
+ - **`actions`**: Actionable buttons related to the toast. A maximum of two buttons is recommended to keep the toast concise.
56
+
57
+ ## Features
58
58
 
59
- > Actionable toasts should remain persistent. If a duration is required, make sure it is long enough for users to engage with the actions.
59
+ ### Dismissal
60
+ Toasts can be dismissed automatically via a timed duration or manually with a close button. Both `duration` and `dismissible` can be configured when opening a toast with the `DaffToastService`.
60
61
 
61
- <daff-docs-example-viewer example="toast-with-custom-duration"></daff-docs-example-viewer>
62
+ By default, toasts without actions dismiss automatically after `5000ms`. Toasts with actions remain visible until dismissed manually or until an action is taken.
62
63
 
63
- ### Close button
64
- The close button is hidden by default. When a toast contains actions, the `dismissible` property is ignored.
64
+ <daff-docs-example-viewer example="custom-duration-toast"></daff-docs-example-viewer>
65
65
 
66
- For non-actionable toasts, the close button can be displayed by setting `dismissible: true`.
66
+ For non-actionable toasts, set `dismissible: true` to display a close button. When a toast contains actions, the `dismissible` property is ignored.
67
67
 
68
68
  <daff-docs-example-viewer example="dismissible-toast"></daff-docs-example-viewer>
69
69
 
70
- ## Stacking
70
+ ### Stack limit
71
71
  A maximum of three toasts can be displayed at once. Toasts stack vertically with the most recent toast at the top.
72
72
 
73
- ## Statuses
73
+ ### Statuses
74
74
  Toast status can be set when opening a toast through the `DaffToastService` by using a `DaffStatus` value.
75
75
 
76
76
  <daff-docs-example-viewer example="toast-status"></daff-docs-example-viewer>
77
77
 
78
- ## Positions
79
- On desktop, toasts appear in the top-right corner by default.
80
-
81
- You can customize their position using the `position` property in `provideDaffToast()`:
78
+ ### Positions
79
+ On desktop, toasts appear in the top-right corner by default. Customize their position using the `position` property in `provideDaffToast()`:
82
80
 
83
81
  ```ts
84
82
  providers: [
@@ -91,16 +89,21 @@ providers: [
91
89
  ],
92
90
  ```
93
91
 
94
- > Note: On mobile, toasts always appear in the bottom-center position, regardless of configuration settings.
92
+ > **Note**
93
+ >
94
+ > On mobile, toasts always appear in the bottom-center position, regardless of configuration settings.
95
+
96
+ ## Best practices
97
+ - Keep messages brief — toasts are temporary and easy to miss.
98
+ - Limit actions to two buttons so the toast stays scannable.
99
+ - Avoid setting a duration on actionable toasts, as they may disappear before the user can interact with them.
95
100
 
96
101
  ## Accessibility
97
- Toasts announce their messages using appropriate ARIA roles:
98
- - `role="status"` (default): Equivalent to `aria-live="polite"`, announcing messages without interrupting the user.
99
- - role="alertdialog": Used when a toast contains actions. The toast will be focus trapped, and focus immediately moves to the actions.
100
102
 
101
- Avoid setting a duration on actionable toasts, as they may disappear before the user can interact with them.
103
+ ### Built-in behavior
104
+ - Toasts without actions use `role="status"` (equivalent to `aria-live="polite"`), announcing messages without interrupting the user.
105
+ - Toasts with actions use `role="alertdialog"`, are focus trapped, and focus moves immediately to the actions.
106
+ - `ESC` dismisses a focus trapped actionable toast.
102
107
 
103
- ### Keyboard Interactions
104
- | Key | Action |
105
- | ----- | ------ |
106
- | `ESC` | Dismisses a toast if it has actions and is focus trapped. |
108
+ ### Developer responsibilities
109
+ - Avoid setting a duration on actionable toasts so users have time to interact with them.
package/tree/README.md CHANGED
@@ -2,14 +2,13 @@
2
2
  Trees display hierarchical information in a nested, expandable format.
3
3
 
4
4
  ## Overview
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.
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
7
  <daff-docs-example-viewer example="basic-tree"></daff-docs-example-viewer>
8
8
 
9
9
  ## Usage
10
10
 
11
- ### Within a standalone component
12
- To use tree in a standalone component, import `DAFF_TREE_COMPONENTS` directly into your custom component:
11
+ Import `DAFF_TREE_COMPONENTS` into your component:
13
12
 
14
13
  ```ts
15
14
  import { DAFF_TREE_COMPONENTS } from '@daffodil/design/tree';
@@ -24,48 +23,13 @@ import { DAFF_TREE_COMPONENTS } from '@daffodil/design/tree';
24
23
  export class CustomComponent {}
25
24
  ```
26
25
 
27
- ### Within a module (deprecated)
28
- To use tree in a module, import `DaffTreeModule` into your custom module:
29
-
30
- ```ts
31
- import { NgModule } from '@angular/core';
32
- import { DaffTreeModule } from '@daffodil/design/tree';
33
- import { CustomComponent } from './custom.component';
34
-
35
- @NgModule({
36
- declarations: [
37
- CustomComponent,
38
- ],
39
- exports: [
40
- CustomComponent,
41
- ],
42
- imports: [
43
- DaffTreeModule,
44
- ],
45
- })
46
- export class CustomComponentModule { }
47
- ```
48
-
49
- > **Warning**
50
- >
51
- > This method is deprecated. It's recommended to update all custom components to standalone.
26
+ > **Deprecation notice:**
27
+ >
28
+ > `DaffTreeModule` is deprecated. Use the standalone component imports instead.
52
29
 
53
30
  ## Anatomy
54
- A tree consists of the following parts:
55
-
56
- ### Container
57
- `<daff-tree>`: The main wrapper that holds the tree and accepts your data.
58
-
59
- ### Node templates
60
- Define how each tree item looks:
31
+ A tree is composed of a container, node templates, and tree items:
61
32
 
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.
64
-
65
- ### Tree item
66
- `[daffTreeItem]`: Added to links or buttons inside your templates to connect them to the tree.
67
-
68
- ### Basic structure
69
33
  ```html
70
34
  <daff-tree [tree]="treeData">
71
35
  <ng-template #daffTreeItemWithChildrenTpl let-node>
@@ -78,10 +42,15 @@ Define how each tree item looks:
78
42
  </daff-tree>
79
43
  ```
80
44
 
45
+ - **`<daff-tree>`**: The main wrapper that holds the tree and accepts your data.
46
+ - **`#daffTreeItemWithChildrenTpl`**: The template for items that can expand to show children. Click handling and icons are added automatically.
47
+ - **`#daffTreeItemTpl`**: The template for items at the end of a branch with no children.
48
+ - **`[daffTreeItem]`**: Added to links or buttons inside your templates to connect them to the tree.
49
+
81
50
  ## Accessibility
82
51
  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
52
 
84
- ### Daffodil provides
53
+ ### Built-in behavior
85
54
  - Unique `id` automatically assigned to each tree item
86
55
  - `aria-expanded` indicating whether a parent item is open or closed
87
56