@daffodil/design 0.85.0 → 0.87.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 (122) hide show
  1. package/atoms/form/error-message/error-message.component.d.ts +6 -0
  2. package/atoms/form/form-field/action/action.directive.d.ts +9 -0
  3. package/atoms/form/form-field/form-field/form-field.component.d.ts +115 -13
  4. package/atoms/form/form-field/form-field-control.d.ts +2 -0
  5. package/atoms/form/form-field/form-field.d.ts +3 -1
  6. package/atoms/form/form-field/label/label.directive.d.ts +5 -0
  7. package/atoms/form/form-field/public_api.d.ts +2 -0
  8. package/atoms/form/form-label/form-label.directive.d.ts +3 -0
  9. package/atoms/form/hint/hint.component.d.ts +1 -1
  10. package/button/README.md +60 -44
  11. package/button/button/button-base.directive.d.ts +11 -6
  12. package/button/button.d.ts +22 -1
  13. package/button/public_api.d.ts +1 -1
  14. package/button/src/button/button-base.scss +0 -19
  15. package/button/src/button/raised/raised-theme.scss +3 -3
  16. package/core/compactable/compactable.directive.d.ts +3 -0
  17. package/core/openable/openable.directive.d.ts +1 -1
  18. package/core/selectable/selectable.directive.d.ts +3 -1
  19. package/core/sizable/sizable.directive.d.ts +2 -2
  20. package/core/skeletonable/public_api.d.ts +0 -1
  21. package/core/skeletonable/skeletonable.directive.d.ts +3 -0
  22. package/core/statusable/statusable.directive.d.ts +22 -2
  23. package/core/text-alignable/text-alignable.directive.d.ts +9 -5
  24. package/fesm2022/daffodil-design-article.mjs +2 -2
  25. package/fesm2022/daffodil-design-article.mjs.map +1 -1
  26. package/fesm2022/daffodil-design-breadcrumb.mjs +2 -2
  27. package/fesm2022/daffodil-design-breadcrumb.mjs.map +1 -1
  28. package/fesm2022/daffodil-design-button-examples.mjs +12 -12
  29. package/fesm2022/daffodil-design-button-examples.mjs.map +1 -1
  30. package/fesm2022/daffodil-design-button.mjs +61 -43
  31. package/fesm2022/daffodil-design-button.mjs.map +1 -1
  32. package/fesm2022/daffodil-design-form-field-examples.mjs +95 -0
  33. package/fesm2022/daffodil-design-form-field-examples.mjs.map +1 -0
  34. package/fesm2022/daffodil-design-image.mjs +2 -2
  35. package/fesm2022/daffodil-design-image.mjs.map +1 -1
  36. package/fesm2022/daffodil-design-input-examples.mjs +10 -10
  37. package/fesm2022/daffodil-design-input-examples.mjs.map +1 -1
  38. package/fesm2022/daffodil-design-input.mjs +43 -4
  39. package/fesm2022/daffodil-design-input.mjs.map +1 -1
  40. package/fesm2022/daffodil-design-media-gallery.mjs +2 -2
  41. package/fesm2022/daffodil-design-media-gallery.mjs.map +1 -1
  42. package/fesm2022/daffodil-design-modal-examples.mjs +3 -2
  43. package/fesm2022/daffodil-design-modal-examples.mjs.map +1 -1
  44. package/fesm2022/daffodil-design-modal.mjs +12 -11
  45. package/fesm2022/daffodil-design-modal.mjs.map +1 -1
  46. package/fesm2022/daffodil-design-notification-examples.mjs +3 -3
  47. package/fesm2022/daffodil-design-notification-examples.mjs.map +1 -1
  48. package/fesm2022/daffodil-design-quantity-field-examples.mjs +4 -4
  49. package/fesm2022/daffodil-design-quantity-field-examples.mjs.map +1 -1
  50. package/fesm2022/daffodil-design-select-examples.mjs +117 -0
  51. package/fesm2022/daffodil-design-select-examples.mjs.map +1 -0
  52. package/fesm2022/daffodil-design-select.mjs +431 -0
  53. package/fesm2022/daffodil-design-select.mjs.map +1 -0
  54. package/fesm2022/daffodil-design-textarea-examples.mjs +66 -0
  55. package/fesm2022/daffodil-design-textarea-examples.mjs.map +1 -0
  56. package/fesm2022/daffodil-design-textarea.mjs +124 -0
  57. package/fesm2022/daffodil-design-textarea.mjs.map +1 -0
  58. package/fesm2022/daffodil-design-toast-examples.mjs +0 -59
  59. package/fesm2022/daffodil-design-toast-examples.mjs.map +1 -1
  60. package/fesm2022/daffodil-design-toast.mjs +52 -40
  61. package/fesm2022/daffodil-design-toast.mjs.map +1 -1
  62. package/fesm2022/daffodil-design.mjs +357 -103
  63. package/fesm2022/daffodil-design.mjs.map +1 -1
  64. package/form-field/examples/examples.d.ts +3 -0
  65. package/form-field/examples/form-field-appearances/form-field-appearances.component.d.ts +7 -0
  66. package/form-field/examples/form-field-with-action/form-field-with-action.component.d.ts +9 -0
  67. package/form-field/examples/form-field-with-prefix/form-field-with-prefix.component.d.ts +6 -0
  68. package/form-field/examples/form-field-with-suffix/form-field-with-suffix.component.d.ts +6 -0
  69. package/form-field/examples/index.d.ts +1 -0
  70. package/form-field/examples/public_api.d.ts +1 -0
  71. package/input/input.component.d.ts +15 -3
  72. package/modal/modal/modal.component.d.ts +5 -3
  73. package/notification/src/notification-theme.scss +34 -18
  74. package/package.json +1 -1
  75. package/scss/state/skeleton/_mixins.scss +4 -1
  76. package/scss/theme.scss +8 -0
  77. package/scss/theming/contrast/luminance/luminance.scss +3 -3
  78. package/scss/theming/illuminate/illuminate.scss +2 -0
  79. package/select/README.md +8 -0
  80. package/select/animation/select-animation-state.d.ts +7 -0
  81. package/select/animation/select-animation.d.ts +4 -0
  82. package/select/animation/state.enum.d.ts +4 -0
  83. package/select/examples/default-select/default-select.component.d.ts +8 -0
  84. package/select/examples/disabled-select/disabled-select.component.d.ts +8 -0
  85. package/select/examples/index.d.ts +1 -0
  86. package/select/examples/models/address.type.d.ts +7 -0
  87. package/select/examples/models/addresses.d.ts +2 -0
  88. package/select/examples/public_api.d.ts +3 -0
  89. package/select/examples/select-with-error/select-with-error.component.d.ts +8 -0
  90. package/select/examples/skeleton-select/skeleton-select.component.d.ts +8 -0
  91. package/select/index.d.ts +1 -0
  92. package/select/option/context.type.d.ts +17 -0
  93. package/select/option/option.directive.d.ts +11 -0
  94. package/select/public_api.d.ts +4 -0
  95. package/select/select/select.component.d.ts +170 -0
  96. package/select/select.d.ts +4 -0
  97. package/select/src/select-theme.scss +75 -0
  98. package/src/atoms/form/form-field/form-field/form-field-theme.scss +36 -4
  99. package/textarea/README.md +28 -0
  100. package/textarea/examples/basic-textarea/basic-textarea.component.d.ts +5 -0
  101. package/textarea/examples/examples.d.ts +2 -0
  102. package/textarea/examples/index.d.ts +1 -0
  103. package/textarea/examples/public_api.d.ts +1 -0
  104. package/textarea/examples/textarea-disabled/textarea-disabled.component.d.ts +7 -0
  105. package/textarea/examples/textarea-error/textarea-error.component.d.ts +7 -0
  106. package/textarea/index.d.ts +1 -0
  107. package/textarea/public_api.d.ts +1 -0
  108. package/textarea/textarea.component.d.ts +59 -0
  109. package/toast/README.md +21 -1
  110. package/toast/examples/public_api.d.ts +1 -2
  111. package/toast/helpers/toast-position.d.ts +8 -0
  112. package/toast/interfaces/toast-options.d.ts +19 -0
  113. package/toast/interfaces/toast.d.ts +1 -1
  114. package/toast/public_api.d.ts +2 -2
  115. package/toast/service/position-strategy.d.ts +1 -1
  116. package/toast/service/position.service.d.ts +1 -1
  117. package/toast/service/toast.service.d.ts +1 -1
  118. package/toast/toast/toast-provider.d.ts +16 -4
  119. package/toast/toast/toast-template.component.d.ts +1 -1
  120. package/core/skeletonable/skeletonable.d.ts +0 -6
  121. package/toast/examples/toast-positions/toast-positions.component.d.ts +0 -20
  122. package/toast/options/daff-toast-options.d.ts +0 -14
@@ -4,6 +4,12 @@ export declare class DaffErrorMessageComponent {
4
4
  * @docs-private
5
5
  */
6
6
  class: boolean;
7
+ /**
8
+ * @docs-private
9
+ *
10
+ * Sets the aria-live of an error message to polite.
11
+ */
12
+ ariaLive: string;
7
13
  static ɵfac: i0.ɵɵFactoryDeclaration<DaffErrorMessageComponent, never>;
8
14
  static ɵcmp: i0.ɵɵComponentDeclaration<DaffErrorMessageComponent, "daff-error-message", never, {}, {}, never, ["*"], true, never>;
9
15
  }
@@ -0,0 +1,9 @@
1
+ import * as i0 from "@angular/core";
2
+ export declare class DaffFormFieldActionDirective {
3
+ /**
4
+ * @docs-private
5
+ */
6
+ class: boolean;
7
+ static ɵfac: i0.ɵɵFactoryDeclaration<DaffFormFieldActionDirective, never>;
8
+ static ɵdir: i0.ɵɵDirectiveDeclaration<DaffFormFieldActionDirective, "[daffFormFieldAction]", never, {}, {}, never, never, true, never>;
9
+ }
@@ -1,26 +1,62 @@
1
- import { AfterContentInit, AfterContentChecked, ChangeDetectorRef } from '@angular/core';
1
+ import { AfterContentInit, AfterContentChecked, ChangeDetectorRef, AfterViewInit } from '@angular/core';
2
2
  import { DaffPrefixDirective } from '../../../../core/prefix-suffix/prefix.directive';
3
3
  import { DaffSuffixDirective } from '../../../../core/prefix-suffix/suffix.directive';
4
+ import { DaffFormLabelDirective } from '../../form-label/form-label.directive';
5
+ import { DaffFormFieldActionDirective } from '../action/action.directive';
4
6
  import { DaffFormFieldControl } from '../form-field-control';
7
+ import { DaffFormFieldLabelDirective } from '../label/label.directive';
5
8
  import * as i0 from "@angular/core";
6
9
  import * as i1 from "../../../../core/skeletonable/skeletonable.directive";
7
- export declare class DaffFormFieldComponent implements AfterContentInit, AfterContentChecked {
10
+ export type DaffFormFieldApperanace = 'fluid' | 'fixed';
11
+ export declare class DaffFormFieldComponent implements AfterContentInit, AfterContentChecked, AfterViewInit {
8
12
  private cd;
9
13
  /** @docs-private */
10
14
  class: boolean;
11
15
  /** @docs-private */
12
16
  get isSelectField(): boolean;
17
+ constructor(cd: ChangeDetectorRef);
13
18
  /** @docs-private */
14
19
  _prefix: DaffPrefixDirective;
20
+ /**
21
+ * @docs-private
22
+ */
23
+ get hasPrefixClass(): DaffPrefixDirective;
15
24
  /** @docs-private */
16
25
  _suffix: DaffSuffixDirective;
17
26
  /**
18
- * The child form control that the form field manages.
19
- *
20
27
  * @docs-private
21
28
  */
29
+ get hasSuffixClass(): DaffSuffixDirective | DaffFormFieldActionDirective;
30
+ /**
31
+ * @docs-private
32
+ *
33
+ * The child form control that the form field manages.
34
+ */
22
35
  _control: DaffFormFieldControl<unknown>;
23
36
  /**
37
+ * @docs-private
38
+ * @deprecated Should be removed in v1.0.0 Deprecated in version 0.86.0. Will be removed in version 0.89.0.
39
+ */
40
+ _formLabelDirective: DaffFormLabelDirective;
41
+ /**
42
+ * @docs-private
43
+ */
44
+ _formFieldLabelDirective: DaffFormFieldLabelDirective;
45
+ /**
46
+ * @docs-private
47
+ */
48
+ _action: DaffFormFieldActionDirective;
49
+ /**
50
+ * @docs-private
51
+ */
52
+ private _hint;
53
+ /**
54
+ * @docs-private
55
+ */
56
+ private _error;
57
+ /**
58
+ * @docs-private
59
+ *
24
60
  * Tracking property to keep a record of whether or not the
25
61
  * form field should be marked as error.
26
62
  */
@@ -30,16 +66,26 @@ export declare class DaffFormFieldComponent implements AfterContentInit, AfterCo
30
66
  */
31
67
  get errorClass(): boolean;
32
68
  /**
69
+ * @docs-private
70
+ *
33
71
  * Tracking property to keep a record of whether or not the
34
72
  * form field contains any user input.
35
73
  */
36
74
  isFilled: boolean;
75
+ /**
76
+ * @docs-private
77
+ *
78
+ * Tracking property to keep a record of whether or not the
79
+ * form field should be marked as disabled.
80
+ */
37
81
  isDisabled: boolean;
38
82
  /**
39
83
  * @docs-private
40
84
  */
41
85
  get disabledClass(): boolean;
42
86
  /**
87
+ * @docs-private
88
+ *
43
89
  * Tracking property to keep a record of whether or not the
44
90
  * form field should be marked as valid.
45
91
  */
@@ -48,8 +94,9 @@ export declare class DaffFormFieldComponent implements AfterContentInit, AfterCo
48
94
  * @docs-private
49
95
  */
50
96
  get validClass(): boolean;
51
- constructor(cd: ChangeDetectorRef);
52
97
  /**
98
+ * @docs-private
99
+ *
53
100
  * Determines whether or not the form field should display its focused state.
54
101
  */
55
102
  get isFocused(): boolean;
@@ -61,26 +108,81 @@ export declare class DaffFormFieldComponent implements AfterContentInit, AfterCo
61
108
  * @docs-private
62
109
  */
63
110
  get raisedClass(): boolean;
111
+ private _appearance;
112
+ /**
113
+ * The appearance style of a form field, whether the label is fluid or fixed.
114
+ */
115
+ get appearance(): DaffFormFieldApperanace;
116
+ set appearance(value: DaffFormFieldApperanace);
64
117
  /**
65
- * Validate whether or not the FormField is in a "usable" state.
118
+ * @docs-private
119
+ */
120
+ get fluidClass(): boolean;
121
+ /**
122
+ * @docs-private
123
+ */
124
+ get fixedClass(): boolean;
125
+ /**
126
+ * @docs-private
127
+ */
128
+ get isFixed(): boolean;
129
+ /**
130
+ * The unique id of the form field. Defaults to an autogenerated value. When using this,
131
+ * it's your responsibility to ensure that the id for each form field is unique.
132
+ *
133
+ * It gets assigned to the `for` attribute on the `<label>` inside of the form field.
134
+ */
135
+ id: string;
136
+ /**
137
+ * @docs-private
138
+ */
139
+ hasHint(): boolean;
140
+ /**
141
+ * @docs-private
142
+ */
143
+ hintId: string;
144
+ /**
145
+ * @docs-private
146
+ */
147
+ hasErrorMessage(): boolean;
148
+ /**
149
+ * @docs-private
150
+ */
151
+ errorMessageId: string;
152
+ /**
153
+ * @docs-private
154
+ */
155
+ get autoLabelId(): string;
156
+ /**
157
+ * @docs-private
158
+ */
159
+ get customId(): string;
160
+ /**
161
+ * @docs-private
162
+ *
163
+ * Displays a console warning if the `DaffFormFieldLabelDirective` is not used on controls (native HTML control elements) that support auto-labelling.
164
+ */
165
+ ngAfterViewInit(): void;
166
+ /**
167
+ * Validates whether or not the form field is in a "usable" state.
66
168
  */
67
169
  private _validateFormControl;
68
170
  /**
69
- * Life cycle hook to verify that the form field has an acceptable
171
+ * @docs-private
172
+ *
173
+ * Lifecycle hook to verify that the form field has an acceptable
70
174
  * child control instance. Mostly useful for development-time
71
175
  * validation of usage.
72
- *
73
- * @docs-private
74
176
  */
75
177
  ngAfterContentInit(): void;
76
178
  /**
77
- * Life cycle hook to verify that the form field has an acceptable
179
+ * @docs-private
180
+ *
181
+ * Lifecycle hook to verify that the form field has an acceptable
78
182
  * child control instance. Mostly useful for development-time
79
183
  * validation of usage.
80
- *
81
- * @docs-private
82
184
  */
83
185
  ngAfterContentChecked(): void;
84
186
  static ɵfac: i0.ɵɵFactoryDeclaration<DaffFormFieldComponent, never>;
85
- static ɵcmp: i0.ɵɵComponentDeclaration<DaffFormFieldComponent, "daff-form-field", never, {}, {}, ["_prefix", "_suffix", "_control"], ["[daffPrefix]", "label[daffFormLabel]", "*", "[daffSuffix]", "daff-hint", "daff-error-message"], true, [{ directive: typeof i1.DaffSkeletonableDirective; inputs: { "skeleton": "skeleton"; }; outputs: {}; }]>;
187
+ static ɵcmp: i0.ɵɵComponentDeclaration<DaffFormFieldComponent, "daff-form-field", never, { "appearance": { "alias": "appearance"; "required": false; }; "id": { "alias": "id"; "required": false; }; }, {}, ["_prefix", "_suffix", "_control", "_formLabelDirective", "_formFieldLabelDirective", "_action", "_hint", "_error"], ["*", "[daffPrefix]", "*", "[daffSuffix]", "daff-hint", "daff-error-message", "[daffFormFieldAction]", "label[daffFormLabel]", "daff-form-label", "label"], true, [{ directive: typeof i1.DaffSkeletonableDirective; inputs: { "skeleton": "skeleton"; }; outputs: {}; }]>;
86
188
  }
@@ -15,7 +15,9 @@ import { DaffFormFieldState } from './form-field-state';
15
15
  export declare abstract class DaffFormFieldControl<T> {
16
16
  ngControl: NgControl | null;
17
17
  abstract readonly controlType?: any;
18
+ readonly supportsAutoLabelling?: boolean;
18
19
  abstract readonly focused: boolean;
20
+ readonly id?: string;
19
21
  get raised(): boolean;
20
22
  abstract focus(event?: Event): void;
21
23
  abstract readonly value: T;
@@ -4,7 +4,9 @@ import { DaffSuffixDirective } from '../../../core/prefix-suffix/suffix.directiv
4
4
  import { DaffErrorMessageComponent } from '../error-message/error-message.component';
5
5
  import { DaffFormLabelDirective } from '../form-label/form-label.directive';
6
6
  import { DaffHintComponent } from '../hint/hint.component';
7
+ import { DaffFormFieldActionDirective } from './action/action.directive';
8
+ import { DaffFormFieldLabelDirective } from './label/label.directive';
7
9
  /**
8
10
  * @docs-private
9
11
  */
10
- export declare const DAFF_FORM_FIELD_COMPONENTS: readonly [typeof DaffFormFieldComponent, typeof DaffErrorMessageComponent, typeof DaffFormLabelDirective, typeof DaffHintComponent, typeof DaffPrefixDirective, typeof DaffSuffixDirective];
12
+ export declare const DAFF_FORM_FIELD_COMPONENTS: readonly [typeof DaffFormFieldComponent, typeof DaffErrorMessageComponent, typeof DaffFormLabelDirective, typeof DaffHintComponent, typeof DaffPrefixDirective, typeof DaffSuffixDirective, typeof DaffFormFieldLabelDirective, typeof DaffFormFieldActionDirective];
@@ -0,0 +1,5 @@
1
+ import * as i0 from "@angular/core";
2
+ export declare class DaffFormFieldLabelDirective {
3
+ static ɵfac: i0.ɵɵFactoryDeclaration<DaffFormFieldLabelDirective, never>;
4
+ static ɵdir: i0.ɵɵDirectiveDeclaration<DaffFormFieldLabelDirective, "daff-form-label", never, {}, {}, never, never, true, never>;
5
+ }
@@ -2,3 +2,5 @@ export { DaffFormFieldModule } from './form-field.module';
2
2
  export { DaffFormFieldComponent } from './form-field/form-field.component';
3
3
  export { DaffFormFieldControl } from './form-field-control';
4
4
  export { DAFF_FORM_FIELD_COMPONENTS } from './form-field';
5
+ export { DaffFormFieldLabelDirective } from './label/label.directive';
6
+ export { DaffFormFieldActionDirective } from './action/action.directive';
@@ -1,4 +1,7 @@
1
1
  import * as i0 from "@angular/core";
2
+ /**
3
+ * @deprecated in favor of the {@link DaffFormFieldLabelDirective}. It will be removed in v1.0.0. Deprecated in version 0.86.0. Will be removed in version 0.89.0.
4
+ */
2
5
  export declare class DaffFormLabelDirective {
3
6
  /**
4
7
  * @docs-private
@@ -5,7 +5,7 @@ export declare class DaffHintComponent {
5
5
  */
6
6
  class: boolean;
7
7
  /**
8
- * Whether or not the hint has been validated
8
+ * Displays a validated hint UI.
9
9
  * */
10
10
  validated: boolean;
11
11
  static ɵfac: i0.ɵɵFactoryDeclaration<DaffHintComponent, never>;
package/button/README.md CHANGED
@@ -1,55 +1,63 @@
1
1
  # Button
2
- Buttons are used to make actions apparent to the end user. It can be used to navigate users to a different page or to perform an action. Buttons can contain text, icons, or both.
2
+ Buttons make actions apparent to users and can navigate to different pages or perform actions. They can display text, icons, or both.
3
3
 
4
4
  ## Overview
5
- Native `<button>` or `<a>` elements are always used in order to provide an easy, accessible experience for users.
5
+ Button supports five variants that change its visual style, each applied as an attribute:
6
6
 
7
- - `<a>` should be used for interactions that will navigate users to a new page or to a different target on the same page.
8
- - `<button>` should be used when a clickable action is performed within the same page.
7
+ | Attribute | Description |
8
+ | --------- | ----------- |
9
+ | `daff-button` | Rectangular button with background color |
10
+ | `daff-flat-button`| Rectangular button with no outline or background color |
11
+ | `daff-icon-button` | Icon only button used with icon fonts |
12
+ | `daff-stroked-button` | Rectangular button with oultline, no background color |
13
+ | `daff-underline-button` | Text button with underline styling |
9
14
 
10
- ## Types
11
- Button supports five types that change its visual style.
12
-
13
- - `daff-button` - Rectangular contained button with background color
14
- - `daff-flat-button` - Rectangular contained button with no outline or background color
15
- - `daff-icon-button` - Icon button used with icon fonts
16
- - `daff-stroked-button` - Rectangular outlined button with no background color
17
-
18
- ### Basic Button
15
+ **Basic button**
19
16
  <design-land-example-viewer-container example="basic-button"></design-land-example-viewer-container>
20
17
 
21
- ### Flat Button
18
+ **Flat button**
22
19
  <design-land-example-viewer-container example="flat-button"></design-land-example-viewer-container>
23
20
 
24
- ### Stroked button
21
+ **Stroked button**
25
22
  <design-land-example-viewer-container example="stroked-button"></design-land-example-viewer-container>
26
23
 
27
- > `black`, `white`, and `theme` should be used with caution to ensure that there is sufficient contrast.
24
+ > `dark`, `light`, and `theme` should be used with caution to ensure that there is sufficient contrast.
28
25
 
29
- ### Icon button
26
+ **Icon button**
30
27
  <design-land-example-viewer-container example="icon-button"></design-land-example-viewer-container>
31
28
 
32
- > `black`, `white`, and `theme` should be used with caution to ensure that there is sufficient contrast.
29
+ > `dark`, `light`, and `theme` should be used with caution to ensure that there is sufficient contrast.
33
30
 
34
- ### Underline button
31
+ **Underline button**
35
32
  <design-land-example-viewer-container example="underline-button"></design-land-example-viewer-container>
36
33
 
37
- ### Raised button (deprecated)
38
- <design-land-example-viewer-container example="raised-button"></design-land-example-viewer-container>
34
+ ## When to use
35
+ Native `<button>` or `<a>` elements should always be used in order to provide an easy, accessible experience for users.
36
+
37
+ - Use `<a>` for navigation to new pages or different sections.
38
+ - Use `<button>` for actions performed within the same page.
39
39
 
40
40
  ## Usage
41
41
 
42
42
  ### Within a standalone component
43
- To use button in a standalone component, import each button type directly into your custom component. Buttons can be imported individually or all together by using `DAFF_BUTTON_COMPONENTS`:
43
+ To use button in a standalone component, import each button type directly into your custom component.
44
+
45
+ Available imports:
46
+ - `DAFF_BASIC_BUTTON_COMPONENTS`
47
+ - `DAFF_FLAT_BUTTON_COMPONENTS`
48
+ - `DAFF_ICON_BUTTON_COMPONENTS`
49
+ - `DAFF_STROKED_BUTTON_COMPONENTS`
50
+ - `DAFF_UNDERLINE_BUTTON_COMPONENTS`
51
+ - `DAFF_BUTTON_COMPONENTS` (all types)
44
52
 
45
53
  ```ts
46
- import { DaffButtonComponent } from '@daffodil/design/button';
54
+ import { DAFF_BASIC_BUTTON_COMPONENTS } from '@daffodil/design/button';
47
55
 
48
56
  @Component({
49
57
  selector: 'custom-component',
50
58
  templateUrl: './custom-component.component.html',
51
59
  imports: [
52
- DaffButtonComponent,
60
+ DAFF_BASIC_BUTTON_COMPONENTS,
53
61
  ],
54
62
  })
55
63
  export class CustomComponent {}
@@ -79,41 +87,49 @@ export class CustomComponentModule { }
79
87
 
80
88
  > This method is deprecated. It's recommended to update all custom components to standalone.
81
89
 
90
+ ## Anatomy
91
+ Buttons should always have a label, unless you are only using an icon that is universally understood and accessible.
92
+
93
+ ### Icon support
94
+ An icon can be rendered on either side of the button text content with the `daffPrefix` and `daffSuffix` selectors. Avoid using both simultaneously.
95
+
96
+ ```html
97
+ <button daff-button>
98
+ <fa-icon [faIcon]="faUser" daffPrefix></fa-icon>
99
+ Button label
100
+ </button>
101
+
102
+ <button daff-button>
103
+ Button label
104
+ <fa-icon [faIcon]="faArrowRight" daffPrefix></fa-icon>
105
+ </button>
106
+ ```
107
+
82
108
  ## Sizes
83
- Use the `size` property to specify a button size. Setting this property will change the height and padding of a button. The size of all variants will default to `md` if none is defined.
109
+ Use the `size` property to control button dimensions. The default size is `md`.
84
110
 
85
111
  <design-land-example-viewer-container example="sizeable-button"></design-land-example-viewer-container>
86
112
 
87
113
  ## Colors
88
- Use the `color` property to change the color of a button. The default color is light gray.
114
+ Use the `color` property to change the color of a button.
89
115
 
90
- > For select button types, `black` and `white` should be used on a darker background in order to have sufficient contrast.
116
+ > Note: `dark`, `light`, and `theme` should be used on appropriate backgrounds for sufficient contrast.
91
117
 
92
118
  ## Status indicators
93
- Buttons with status indicators can be used to distinguish what type of action it performs and its importance compared to other buttons in the same context. Use the `status` property to change the status.
119
+ Status indicators help users understand the type of action a button performs and its importance relative to other buttons in the same context. Use the `status` property to convey different semantic meanings.
94
120
 
95
121
  <design-land-example-viewer-container example="statusable-button"></design-land-example-viewer-container>
96
122
 
97
123
  ## Elevation
98
- Use the `elevated` property to add a shadow to buttons. Note that the `elevated` property is not supported for flat, icon, and underline buttons.
124
+ Add shadows to buttons with the `elevated` property.
99
125
 
100
- <design-land-example-viewer-container example="elevated-button"></design-land-example-viewer-container>
101
-
102
- ## Icon support
103
- An icon can be rendered on either side of the button text content with the `daffPrefix` and `daffSuffix` selectors.
126
+ > Note: The `elevated` property is not supported for flat, icon, and underline buttons.
104
127
 
105
- ```html
106
- <button daff-button>
107
- <fa-icon [faIcon]="faUser" daffPrefix></fa-icon>
108
- Button Content
109
- <fa-icon [faIcon]="faUser" daffSuffix></fa-icon>
110
- </button>
111
- ```
128
+ <design-land-example-viewer-container example="elevated-button"></design-land-example-viewer-container>
112
129
 
113
130
  ## Accessbility
114
131
  Daffodil uses native `<a>` and `<button>` HTML elements to ensure an accessible experience by default.
115
132
 
116
- - The `<button>` element should be used when a clickable action is performed within the same page.
117
- - The `<a>` element should be used to navigate users to a new page or to a different target on the same page.
118
-
119
- Buttons and links containing only icons (`<daff-icon-button>`) need to be given meaningful labels using `aria-label` or `aria-labelledby`.
133
+ - Use `<a>` for navigation to new pages or different sections.
134
+ - Use `<button>` for actions performed within the same page.
135
+ - Icon only buttons (`<daff-icon-button>`) need to be given meaningful labels using `aria-label` or `aria-labelledby`.
@@ -5,19 +5,24 @@ import * as i1 from "@daffodil/design";
5
5
  import * as i2 from "./button-sizable.directive";
6
6
  export declare class DaffButtonBaseDirective {
7
7
  private size;
8
+ /**
9
+ * @docs-private
10
+ */
8
11
  _prefix: DaffPrefixDirective;
9
- _suffix: DaffSuffixDirective;
10
- constructor(size: DaffButtonSizableDirective);
11
12
  /**
12
13
  * @docs-private
13
14
  */
14
- get disabledClass(): any;
15
- loading: boolean;
15
+ _suffix: DaffSuffixDirective;
16
+ constructor(size: DaffButtonSizableDirective);
16
17
  /**
17
- * Sets the tabindex. Defaults to 0.
18
+ * Sets the tabindex.
18
19
  */
19
20
  tabindex: number;
20
21
  private _disabled;
22
+ /**
23
+ * @docs-private
24
+ */
25
+ get disabledClass(): any;
21
26
  /**
22
27
  * The disabled state of the button.
23
28
  */
@@ -38,5 +43,5 @@ export declare class DaffButtonBaseDirective {
38
43
  */
39
44
  get tabIndexAttribute(): number;
40
45
  static ɵfac: i0.ɵɵFactoryDeclaration<DaffButtonBaseDirective, never>;
41
- static ɵdir: i0.ɵɵDirectiveDeclaration<DaffButtonBaseDirective, "[daffButtonBase]", never, { "loading": { "alias": "loading"; "required": false; }; "tabindex": { "alias": "tabindex"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; }, {}, ["_prefix", "_suffix"], never, true, [{ directive: typeof i1.DaffArticleEncapsulatedDirective; inputs: {}; outputs: {}; }, { directive: typeof i2.DaffButtonSizableDirective; inputs: { "size": "size"; }; outputs: {}; }, { directive: typeof i1.DaffStatusableDirective; inputs: { "status": "status"; }; outputs: {}; }, { directive: typeof i1.DaffColorableDirective; inputs: { "color": "color"; }; outputs: {}; }]>;
46
+ static ɵdir: i0.ɵɵDirectiveDeclaration<DaffButtonBaseDirective, "[daffButtonBase]", never, { "tabindex": { "alias": "tabindex"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; }, {}, ["_prefix", "_suffix"], never, true, [{ directive: typeof i1.DaffArticleEncapsulatedDirective; inputs: {}; outputs: {}; }, { directive: typeof i2.DaffButtonSizableDirective; inputs: { "size": "size"; }; outputs: {}; }, { directive: typeof i1.DaffStatusableDirective; inputs: { "status": "status"; }; outputs: {}; }, { directive: typeof i1.DaffColorableDirective; inputs: { "color": "color"; }; outputs: {}; }]>;
42
47
  }
@@ -1,3 +1,4 @@
1
+ import { DaffPrefixDirective, DaffSuffixDirective } from '@daffodil/design';
1
2
  import { DaffButtonComponent } from './button/basic/button.component';
2
3
  import { DaffFlatButtonComponent } from './button/flat/flat.component';
3
4
  import { DaffIconButtonComponent } from './button/icon/icon.component';
@@ -7,4 +8,24 @@ import { DaffUnderlineButtonComponent } from './button/underline/underline.compo
7
8
  /**
8
9
  * @docs-private
9
10
  */
10
- export declare const DAFF_BUTTON_COMPONENTS: readonly [typeof DaffButtonComponent, typeof DaffFlatButtonComponent, typeof DaffIconButtonComponent, typeof DaffRaisedButtonComponent, typeof DaffStrokedButtonComponent, typeof DaffUnderlineButtonComponent];
11
+ export declare const DAFF_BUTTON_COMPONENTS: readonly [typeof DaffButtonComponent, typeof DaffFlatButtonComponent, typeof DaffIconButtonComponent, typeof DaffRaisedButtonComponent, typeof DaffStrokedButtonComponent, typeof DaffUnderlineButtonComponent, typeof DaffPrefixDirective, typeof DaffSuffixDirective];
12
+ /**
13
+ * @docs-private
14
+ */
15
+ export declare const DAFF_BASIC_BUTTON_COMPONENTS: readonly [typeof DaffButtonComponent, typeof DaffPrefixDirective, typeof DaffSuffixDirective];
16
+ /**
17
+ * @docs-private
18
+ */
19
+ export declare const DAFF_FLAT_BUTTON_COMPONENTS: readonly [typeof DaffFlatButtonComponent, typeof DaffPrefixDirective, typeof DaffSuffixDirective];
20
+ /**
21
+ * @docs-private
22
+ */
23
+ export declare const DAFF_ICON_BUTTON_COMPONENTS: readonly [typeof DaffIconButtonComponent, typeof DaffPrefixDirective, typeof DaffSuffixDirective];
24
+ /**
25
+ * @docs-private
26
+ */
27
+ export declare const DAFF_STROKED_BUTTON_COMPONENTS: readonly [typeof DaffStrokedButtonComponent, typeof DaffPrefixDirective, typeof DaffSuffixDirective];
28
+ /**
29
+ * @docs-private
30
+ */
31
+ export declare const DAFF_UNDERLINE_BUTTON_COMPONENTS: readonly [typeof DaffUnderlineButtonComponent, typeof DaffPrefixDirective, typeof DaffSuffixDirective];
@@ -1,5 +1,5 @@
1
1
  export { DaffButtonModule } from './button.module';
2
- export { DAFF_BUTTON_COMPONENTS } from './button';
2
+ export { DAFF_BUTTON_COMPONENTS, DAFF_BASIC_BUTTON_COMPONENTS, DAFF_FLAT_BUTTON_COMPONENTS, DAFF_ICON_BUTTON_COMPONENTS, DAFF_STROKED_BUTTON_COMPONENTS, DAFF_UNDERLINE_BUTTON_COMPONENTS, } from './button';
3
3
  export { DaffButtonComponent } from './button/basic/button.component';
4
4
  export { DaffFlatButtonComponent } from './button/flat/flat.component';
5
5
  export { DaffRaisedButtonComponent } from './button/raised/raised.component';
@@ -23,7 +23,6 @@
23
23
 
24
24
  @mixin daff-button-base {
25
25
  @include interactions.clickable();
26
- @include t.text-truncate();
27
26
  display: inline-flex;
28
27
  justify-content: center;
29
28
  align-items: center;
@@ -47,12 +46,6 @@
47
46
  z-index: 1;
48
47
  }
49
48
 
50
- .daff-button__loading {
51
- > * {
52
- width: 100%;
53
- }
54
- }
55
-
56
49
  .daff-button__content {
57
50
  @include t.text-truncate();
58
51
  }
@@ -87,10 +80,6 @@
87
80
  line-height: 2rem;
88
81
  height: 2rem;
89
82
  padding: 0 1rem;
90
-
91
- .daff-button__loading {
92
- width: 1rem;
93
- }
94
83
  }
95
84
 
96
85
  &.daff-md {
@@ -98,10 +87,6 @@
98
87
  line-height: 3rem;
99
88
  height: 3rem;
100
89
  padding: 0 1.5rem;
101
-
102
- .daff-button__loading {
103
- width: 1.5rem;
104
- }
105
90
  }
106
91
 
107
92
  &.daff-lg {
@@ -109,9 +94,5 @@
109
94
  line-height: 3.5rem;
110
95
  height: 3.5rem;
111
96
  padding: 0 1.5rem;
112
-
113
- .daff-button__loading {
114
- width: 2rem;
115
- }
116
97
  }
117
98
  }
@@ -42,7 +42,7 @@
42
42
 
43
43
  .daff-raised-button {
44
44
  @include daff-raised-button-theme-variant(
45
- daff-illuminate($base, $neutral, 2)
45
+ daff-color($neutral, 20)
46
46
  );
47
47
 
48
48
  &.daff-primary {
@@ -76,9 +76,9 @@
76
76
  &[disabled],
77
77
  &.disabled {
78
78
  @include daff-raised-button-theme-variant(
79
- daff-illuminate($base, $neutral, 3)
79
+ daff-color($neutral, 30)
80
80
  );
81
- color: daff-illuminate($base, $neutral, 5);
81
+ color: daff-color($neutral, 50);
82
82
 
83
83
  &::after {
84
84
  box-shadow: none;
@@ -44,6 +44,9 @@ import * as i0 from "@angular/core";
44
44
  * ```
45
45
  */
46
46
  export declare class DaffCompactableDirective {
47
+ /**
48
+ * Controls whether the component is compact.
49
+ */
47
50
  compact: boolean;
48
51
  static ɵfac: i0.ɵɵFactoryDeclaration<DaffCompactableDirective, never>;
49
52
  static ɵdir: i0.ɵɵDirectiveDeclaration<DaffCompactableDirective, "[daffCompactable]", never, { "compact": { "alias": "compact"; "required": false; }; }, {}, never, never, true, never>;
@@ -47,7 +47,7 @@ import * as i0 from "@angular/core";
47
47
  * ```
48
48
  */
49
49
  export declare class DaffOpenableDirective implements DaffOpenable, OnChanges {
50
- /** Whether or not a component implementing the directive is open */
50
+ /** Controls whether the component is open. */
51
51
  open: boolean;
52
52
  private _setOpen;
53
53
  /** Whether or not a component should handle state
@@ -3,7 +3,9 @@ import { DaffSelectable } from '../selectable/selectable';
3
3
  import * as i0 from "@angular/core";
4
4
  export declare class DaffSelectableDirective implements DaffSelectable {
5
5
  private cd;
6
- /** Whether or not a component implementing the directive is selected */
6
+ /**
7
+ * Controls whether the component is selected.
8
+ */
7
9
  selected: boolean;
8
10
  /**
9
11
  * An event that fires after the media element becomes selected.
@@ -63,9 +63,9 @@ export declare class DaffSizableDirective<T extends DaffSizeAllType> implements
63
63
  'daff-xl': boolean;
64
64
  };
65
65
  /**
66
- * The size of a component.
66
+ * The size of the component.
67
67
  *
68
- * Default options are: `xs`, `sm`, `md`, `lg`, and `xl`.
68
+ * Options are: `xs`, `sm`, `md`, `lg`, and `xl`.
69
69
  */
70
70
  size: T;
71
71
  /**
@@ -1,2 +1 @@
1
- export { DaffSkeletonable } from './skeletonable';
2
1
  export { DaffSkeletonableDirective } from './skeletonable.directive';
@@ -42,6 +42,9 @@ import * as i0 from "@angular/core";
42
42
  * state as desired. It can be used in conjuction with the `skeleton-screen` mixin, which provides predefined loading styles.
43
43
  */
44
44
  export declare class DaffSkeletonableDirective {
45
+ /**
46
+ * Controls whether the component displays a skeleton loading state.
47
+ */
45
48
  skeleton: boolean;
46
49
  static ɵfac: i0.ɵɵFactoryDeclaration<DaffSkeletonableDirective, never>;
47
50
  static ɵdir: i0.ɵɵDirectiveDeclaration<DaffSkeletonableDirective, "[daffSkeletonable]", never, { "skeleton": { "alias": "skeleton"; "required": false; }; }, {}, never, never, true, never>;