@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
@@ -0,0 +1,170 @@
1
+ import { Overlay } from '@angular/cdk/overlay';
2
+ import { TemplatePortal } from '@angular/cdk/portal';
3
+ import { ChangeDetectorRef, OnInit, ElementRef, OnDestroy } from '@angular/core';
4
+ import { ControlValueAccessor, NgControl } from '@angular/forms';
5
+ import { DaffFormFieldComponent, DaffFormFieldControl, DaffOpenableDirective } from '@daffodil/design';
6
+ import { DaffSelectAnimationState } from '../animation/state.enum';
7
+ import { DaffSelectOptionDirective } from '../option/option.directive';
8
+ import * as i0 from "@angular/core";
9
+ import * as i1 from "@daffodil/design";
10
+ /**
11
+ * DaffSelectComponent is a form control component that presents a list of selectable options,
12
+ * similar to the native `<select>` element we call `<daff-native-select>`.
13
+ *
14
+ */
15
+ export declare class DaffSelectComponent<T = unknown> extends DaffFormFieldControl<string> implements DaffFormFieldControl<string>, OnInit, OnDestroy, ControlValueAccessor {
16
+ private cd;
17
+ private document;
18
+ ngControl: NgControl;
19
+ private overlay;
20
+ private openDirective;
21
+ private formField;
22
+ /** @docs-private */
23
+ controlType: string;
24
+ /**
25
+ * @docs-private
26
+ */
27
+ supportsAutoLabelling: boolean;
28
+ private _destroyed;
29
+ private _overlay;
30
+ private _value;
31
+ private _highlighted;
32
+ private _animationState;
33
+ private _animationFinishCallbackQueue;
34
+ /**
35
+ * @docs-private
36
+ */
37
+ get focused(): boolean;
38
+ /**
39
+ * @docs-private
40
+ */
41
+ get raised(): boolean;
42
+ /** @docs-private */
43
+ focus(): void;
44
+ /** @docs-private */
45
+ blur(): void;
46
+ /**
47
+ * @docs-private
48
+ */
49
+ _disabled: boolean;
50
+ disabled: boolean;
51
+ options: T[];
52
+ /**
53
+ * @docs-private
54
+ */
55
+ get isOpen(): boolean;
56
+ /**
57
+ * @docs-private
58
+ */
59
+ class: boolean;
60
+ /**
61
+ * @docs-private
62
+ */
63
+ get disabledClass(): boolean;
64
+ /**
65
+ * @docs-private
66
+ *
67
+ * `aria-labelledby` for the select.
68
+ */
69
+ ariaLabelledBy: string;
70
+ /**
71
+ * The unique id of the select options. Defaults to an autogenerated value.
72
+ */
73
+ optionsId: string;
74
+ constructor(cd: ChangeDetectorRef, document: Document, ngControl: NgControl, overlay: Overlay, openDirective: DaffOpenableDirective, formField: DaffFormFieldComponent);
75
+ /**
76
+ * @docs-private
77
+ */
78
+ buttonElement: ElementRef<HTMLButtonElement>;
79
+ /**
80
+ * @docs-private
81
+ */
82
+ optionsTemplatePortal: TemplatePortal<unknown>;
83
+ /**
84
+ * @docs-private
85
+ */
86
+ optionsElement: ElementRef<HTMLDivElement>;
87
+ /**
88
+ * @docs-private
89
+ */
90
+ optionTemplate?: DaffSelectOptionDirective;
91
+ /**
92
+ * @docs-private
93
+ */
94
+ get animationState(): DaffSelectAnimationState;
95
+ /**
96
+ * @docs-private
97
+ */
98
+ get value(): any;
99
+ /**
100
+ * @docs-private
101
+ */
102
+ get highlighted(): number;
103
+ set highlighted(val: number);
104
+ private focusOptionsList;
105
+ private focusButton;
106
+ /**
107
+ * @docs-private
108
+ */
109
+ ngOnDestroy(): void;
110
+ private onChange;
111
+ private onTouched;
112
+ /**
113
+ * @docs-private
114
+ */
115
+ writeValue(value: T): void;
116
+ /**
117
+ * @docs-private
118
+ */
119
+ registerOnChange(fn: (value: T) => void): void;
120
+ /**
121
+ * @docs-private
122
+ */
123
+ registerOnTouched(fn: any): void;
124
+ /**
125
+ * @docs-private
126
+ */
127
+ setDisabledState(isDisabled: boolean): void;
128
+ /**
129
+ * @docs-private
130
+ */
131
+ flushValue(): void;
132
+ /**
133
+ * @docs-private
134
+ */
135
+ ngOnInit(): void;
136
+ /**
137
+ * @docs-private
138
+ */
139
+ animationFinished(): void;
140
+ /**
141
+ * Opens the options list.
142
+ */
143
+ open(event?: KeyboardEvent | MouseEvent): void;
144
+ /**
145
+ * Closes the options list.
146
+ */
147
+ close(event?: KeyboardEvent | MouseEvent): void;
148
+ /**
149
+ * Selects the value in a particular position in the options list.
150
+ */
151
+ private selectValueInPosition;
152
+ /**
153
+ * Selects an option.
154
+ */
155
+ selectOption(option: T): void;
156
+ /**
157
+ * Selects the option referenced by the highlighted index.
158
+ */
159
+ selectHighlighted(event?: KeyboardEvent | MouseEvent): void;
160
+ /**
161
+ * Highlights the next option in the list.
162
+ */
163
+ highlightNext(event?: KeyboardEvent | MouseEvent): void;
164
+ /**
165
+ * Highlights the previous option in the list.
166
+ */
167
+ highlightPrevious(event?: KeyboardEvent | MouseEvent): void;
168
+ static ɵfac: i0.ɵɵFactoryDeclaration<DaffSelectComponent<any>, [null, null, { optional: true; self: true; }, null, null, null]>;
169
+ static ɵcmp: i0.ɵɵComponentDeclaration<DaffSelectComponent<any>, "daff-select", never, { "disabled": { "alias": "disabled"; "required": false; }; "options": { "alias": "options"; "required": false; }; "optionsId": { "alias": "optionsId"; "required": false; }; }, {}, ["optionTemplate"], never, true, [{ directive: typeof i1.DaffOpenableDirective; inputs: {}; outputs: {}; }]>;
170
+ }
@@ -0,0 +1,4 @@
1
+ import { DaffErrorMessageComponent, DaffFormLabelDirective } from '@daffodil/design';
2
+ import { DaffSelectOptionDirective } from './option/option.directive';
3
+ import { DaffSelectComponent } from './select/select.component';
4
+ export declare const DAFF_SELECT_COMPONENTS: readonly [typeof DaffSelectComponent, typeof DaffSelectOptionDirective, typeof DaffErrorMessageComponent, typeof DaffFormLabelDirective];
@@ -0,0 +1,75 @@
1
+ @use 'sass:map';
2
+ @use '../../scss/theming' as *;
3
+ @use '../../scss/core';
4
+
5
+ // stylelint-disable selector-class-pattern
6
+ @mixin daff-select-theme($theme) {
7
+ $base: daff-get-base-color($theme, base);
8
+ $base-contrast: daff-get-base-color($theme, base-contrast);
9
+ $neutral: daff-get-palette($theme, neutral);
10
+ $mode: daff-get-theme-mode($theme);
11
+ $border-color-light: daff-color($neutral, 30);
12
+ $border-color-dark: daff-color($neutral, 70);
13
+
14
+ .daff-select {
15
+ $root: '.daff-select';
16
+
17
+ @include light($mode) {
18
+ &.disabled {
19
+ #{$root}__field {
20
+ color: daff-color($neutral, 50);
21
+ }
22
+ }
23
+
24
+ &__option {
25
+ background-color: $base;
26
+ border-bottom: 1px solid $border-color-light;
27
+ border-left: 1px solid $border-color-light;
28
+ border-right: 1px solid $border-color-light;
29
+ color: $base-contrast;
30
+
31
+ &:first-of-type {
32
+ border-top: 1px solid $border-color-light;
33
+ }
34
+
35
+ &:hover,
36
+ &.highlighted {
37
+ background-color: daff-color($neutral, 10);
38
+ }
39
+ }
40
+ }
41
+
42
+ @include dark($mode) {
43
+ &.disabled {
44
+ #{$root}__field {
45
+ color: daff-color($neutral, 70);
46
+ }
47
+ }
48
+
49
+ &__option {
50
+ background-color: $base;
51
+ border-bottom: 1px solid $border-color-dark;
52
+ border-left: 1px solid $border-color-dark;
53
+ border-right: 1px solid $border-color-dark;
54
+ color: $base-contrast;
55
+
56
+ &:first-of-type {
57
+ border-top: 1px solid $border-color-dark;
58
+ }
59
+
60
+ &:hover,
61
+ &.highlighted {
62
+ background-color: daff-color($neutral, 90);
63
+ }
64
+ }
65
+ }
66
+
67
+ &__field {
68
+ color: $base-contrast;
69
+
70
+ &::after {
71
+ border-color: daff-color($neutral);
72
+ }
73
+ }
74
+ }
75
+ }
@@ -10,11 +10,23 @@
10
10
  $neutral: daff-get-palette($theme, neutral);
11
11
  $mode: daff-get-theme-mode($theme);
12
12
 
13
+ // stylelint-disable selector-class-pattern
13
14
  .daff-form-field {
14
15
  @include light($mode) {
15
16
  .daff-form-field__control {
16
17
  border: 1px solid daff-color($neutral);
17
18
  color: daff-color($neutral);
19
+
20
+ * {
21
+ ::-webkit-input-placeholder {
22
+ color: daff-color($neutral);
23
+ }
24
+ }
25
+ }
26
+
27
+ .daff-prefix,
28
+ .daff-suffix {
29
+ color: daff-color($neutral);
18
30
  }
19
31
  }
20
32
 
@@ -22,6 +34,17 @@
22
34
  .daff-form-field__control {
23
35
  border: 1px solid daff-color($neutral, 40);
24
36
  color: daff-color($neutral, 40);
37
+
38
+ * {
39
+ ::-webkit-input-placeholder {
40
+ color: daff-color($neutral, 40);
41
+ }
42
+ }
43
+ }
44
+
45
+ .daff-prefix,
46
+ .daff-suffix {
47
+ color: daff-color($neutral, 40);
25
48
  }
26
49
  }
27
50
 
@@ -29,8 +52,13 @@
29
52
  .daff-form-field__control {
30
53
  border: 1px solid daff-color($primary);
31
54
  }
32
- .daff-form-label {
33
- color: daff-color($primary);
55
+
56
+ &.fluid {
57
+ .daff-form-label,
58
+ label,
59
+ .daff-form-field__label {
60
+ color: daff-color($primary);
61
+ }
34
62
  }
35
63
  }
36
64
 
@@ -39,8 +67,12 @@
39
67
  border: 1px solid daff-color($critical);
40
68
  }
41
69
 
42
- .daff-form-label {
43
- color: daff-color($critical);
70
+ &.fluid {
71
+ .daff-form-label,
72
+ label,
73
+ .daff-form-field__label {
74
+ color: daff-color($critical);
75
+ }
44
76
  }
45
77
  }
46
78
 
@@ -0,0 +1,28 @@
1
+ # Textarea
2
+ Textarea allows a native HTML `<textarea>` element to work with the [Form Field](/libs/design/src/atoms/form/form-field/README.md) component.
3
+
4
+ ## Overview
5
+ The textarea component 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 [DaffFormFieldComponent](/libs/design/src/atoms/form/form-field/README.md).
6
+
7
+ <design-land-example-viewer-container example="basic-textarea"></design-land-example-viewer-container>
8
+
9
+ ## Usage
10
+ To use textarea, import `DaffTextareaComponent` directly into your custom component:
11
+
12
+ ```ts
13
+ import { DaffTextareaComponent } from '@daffodil/design/textarea';
14
+
15
+ @Component({
16
+ selector: 'custom-component',
17
+ templateUrl: './custom-component.component.html',
18
+ imports: [
19
+ DaffTextareaComponent,
20
+ ],
21
+ })
22
+ export class CustomComponent {}
23
+ ```
24
+
25
+ ## Examples
26
+
27
+ ### Disabled textarea
28
+ <design-land-example-viewer-container example="basic-textarea"></design-land-example-viewer-container>
@@ -0,0 +1,5 @@
1
+ import * as i0 from "@angular/core";
2
+ export declare class BasicTextareaComponent {
3
+ static ɵfac: i0.ɵɵFactoryDeclaration<BasicTextareaComponent, never>;
4
+ static ɵcmp: i0.ɵɵComponentDeclaration<BasicTextareaComponent, "basic-textarea", never, {}, {}, never, never, true, never>;
5
+ }
@@ -0,0 +1,2 @@
1
+ import { BasicTextareaComponent } from './basic-textarea/basic-textarea.component';
2
+ export declare const TEXTAREA_EXAMPLES: (typeof BasicTextareaComponent)[];
@@ -0,0 +1 @@
1
+ export * from './public_api';
@@ -0,0 +1 @@
1
+ export { TEXTAREA_EXAMPLES } from './examples';
@@ -0,0 +1,7 @@
1
+ import { UntypedFormControl } from '@angular/forms';
2
+ import * as i0 from "@angular/core";
3
+ export declare class TextareaDisabledComponent {
4
+ disabled: UntypedFormControl;
5
+ static ɵfac: i0.ɵɵFactoryDeclaration<TextareaDisabledComponent, never>;
6
+ static ɵcmp: i0.ɵɵComponentDeclaration<TextareaDisabledComponent, "textarea-disabled", never, {}, {}, never, never, true, never>;
7
+ }
@@ -0,0 +1,7 @@
1
+ import { UntypedFormControl } from '@angular/forms';
2
+ import * as i0 from "@angular/core";
3
+ export declare class TextareaErrorComponent {
4
+ control: UntypedFormControl;
5
+ static ɵfac: i0.ɵɵFactoryDeclaration<TextareaErrorComponent, never>;
6
+ static ɵcmp: i0.ɵɵComponentDeclaration<TextareaErrorComponent, "textarea-error", never, {}, {}, never, never, true, never>;
7
+ }
@@ -0,0 +1 @@
1
+ export * from './public_api';
@@ -0,0 +1 @@
1
+ export { DaffTextareaComponent } from './textarea.component';
@@ -0,0 +1,59 @@
1
+ import { ElementRef, OnInit } from '@angular/core';
2
+ import { NgControl } from '@angular/forms';
3
+ import { DaffFormFieldComponent, DaffFormFieldControl } from '@daffodil/design';
4
+ import * as i0 from "@angular/core";
5
+ /**
6
+ * DaffTextareaComponent provides the same functionality as a native `<textarea>` and contains custom styling and functionality.
7
+ */
8
+ export declare class DaffTextareaComponent extends DaffFormFieldControl<string> implements DaffFormFieldControl<string>, OnInit {
9
+ /**
10
+ * @docs-private
11
+ */
12
+ ngControl: NgControl;
13
+ private _elementRef;
14
+ private formField;
15
+ /** @docs-private */
16
+ controlType: string;
17
+ /**
18
+ * @docs-private
19
+ */
20
+ class: boolean;
21
+ /**
22
+ * @docs-private
23
+ */
24
+ focused: boolean;
25
+ private get _id();
26
+ /**
27
+ * @docs-private
28
+ */
29
+ get internalId(): string;
30
+ /**
31
+ * @docs-private
32
+ */
33
+ focus(): void;
34
+ /**
35
+ * @docs-private
36
+ */
37
+ blur(): void;
38
+ /**
39
+ * @docs-private
40
+ */
41
+ get ariaDescribedBy(): string;
42
+ constructor(
43
+ /**
44
+ * @docs-private
45
+ */
46
+ ngControl: NgControl, _elementRef: ElementRef<HTMLInputElement>, formField: DaffFormFieldComponent);
47
+ /** @docs-private */
48
+ ngOnInit(): void;
49
+ /**
50
+ * @docs-private
51
+ */
52
+ onFocus(): void;
53
+ /**
54
+ * @docs-private
55
+ */
56
+ get value(): string;
57
+ static ɵfac: i0.ɵɵFactoryDeclaration<DaffTextareaComponent, [{ optional: true; self: true; }, null, null]>;
58
+ static ɵcmp: i0.ɵɵComponentDeclaration<DaffTextareaComponent, "textarea[daff-textarea]", never, {}, {}, never, ["*"], true, never>;
59
+ }
package/toast/README.md CHANGED
@@ -8,7 +8,7 @@ Toasts should be used to display temporary messages about actions or events that
8
8
  <design-land-example-viewer-container example="default-toast"></design-land-example-viewer-container>
9
9
 
10
10
  ## Setting up the component
11
- `provideDaffToast()` must be added as a provider in your application's root component for global use or in a specific feature component for the toast functionality to work properly.
11
+ `provideDaffToast()` must be added as a provider in your application's root component for the toast to work properly.
12
12
 
13
13
  ```ts
14
14
  import { provideDaffToast } from '@daffodil/design/toast';
@@ -47,6 +47,26 @@ You can set the status of a toast when opening it with `DaffToastService`, using
47
47
 
48
48
  <design-land-example-viewer-container example="toast-status"></design-land-example-viewer-container>
49
49
 
50
+ ## Positions
51
+ Toasts are displayed in the top-right corner of the screen by default on desktop devices.
52
+
53
+ You can customize the position of toast notifications by configuring the `position` property in the `provideDaffToast` provider.
54
+
55
+ To customize toast positions, configure the `position` property in the `provideDaffToast` provider of your root component:
56
+
57
+ ```ts
58
+ providers: [
59
+ provideDaffToast({
60
+ position: {
61
+ vertical: 'bottom',
62
+ horizontal: 'right',
63
+ },
64
+ }),
65
+ ],
66
+ ```
67
+
68
+ > Note: On mobile devices, toasts will always appear in the bottom-center position, regardless of configuration settings.
69
+
50
70
  ## Accessibility
51
71
  By default, toasts use a `role="status"` to announce messages. It's the equivalent of `aria-live="polite"`, which does not interrupt a user's current activity and waits until they are idle to make the announcement.
52
72
 
@@ -1,6 +1,5 @@
1
1
  import { DefaultToastComponent } from './default-toast/default-toast.component';
2
2
  import { DismissibleToastComponent } from './dismissible-toast/dismissible-toast.component';
3
- import { ToastPositionsComponent } from './toast-positions/toast-positions.component';
4
3
  import { ToastStatusComponent } from './toast-status/toast-status.component';
5
4
  import { ToastWithCustomDurationComponent } from './toast-with-custom-duration/toast-with-custom-duration.component';
6
- export declare const TOAST_EXAMPLES: (typeof DefaultToastComponent | typeof DismissibleToastComponent | typeof ToastPositionsComponent | typeof ToastStatusComponent | typeof ToastWithCustomDurationComponent)[];
5
+ export declare const TOAST_EXAMPLES: (typeof DefaultToastComponent | typeof DismissibleToastComponent | typeof ToastStatusComponent | typeof ToastWithCustomDurationComponent)[];
@@ -0,0 +1,8 @@
1
+ /**
2
+ * The available vertical positions for toasts.
3
+ */
4
+ export type DaffToastVerticalPosition = 'top' | 'bottom';
5
+ /**
6
+ * The available horizontal positions for toasts.
7
+ */
8
+ export type DaffToastHorizontalPosition = 'left' | 'center' | 'right';
@@ -0,0 +1,19 @@
1
+ import { DaffToastHorizontalPosition, DaffToastVerticalPosition } from '../helpers/toast-position';
2
+ export interface DaffToastVerticalPositionInterface {
3
+ vertical: DaffToastVerticalPosition;
4
+ }
5
+ export interface DaffToastHorizontalPositionInterface {
6
+ horizontal: DaffToastHorizontalPosition;
7
+ }
8
+ export type DaffToastPosition = DaffToastVerticalPositionInterface & DaffToastHorizontalPositionInterface;
9
+ export interface DaffToastOptions {
10
+ /**
11
+ * The position of all toasts.
12
+ */
13
+ position: DaffToastPosition;
14
+ /** @docs-private */
15
+ useParent?: boolean;
16
+ }
17
+ export declare const daffToastDefaultOptions: DaffToastOptions;
18
+ export declare const provideDaffToastOptions: <R extends DaffToastOptions = DaffToastOptions>(config: Partial<R> | import("@angular/core").InjectionToken<Partial<R>>) => import("@angular/core").FactoryProvider;
19
+ export declare const DAFF_TOAST_OPTIONS: import("@angular/core").InjectionToken<DaffToastOptions>;
@@ -22,5 +22,5 @@ export interface DaffToast extends DaffToastData {
22
22
  /**
23
23
  * The observable that emits when the toast is closed.
24
24
  */
25
- dismissalStream: Observable<void | number>;
25
+ dismissalStream: Observable<void>;
26
26
  }
@@ -1,8 +1,8 @@
1
- export { DaffToastPositionService } from './service/position.service';
2
1
  export { DaffToastService } from './service/toast.service';
3
2
  export { DaffToastConfiguration } from './toast/toast-config';
4
3
  export { DaffToast, DaffToastData, } from './interfaces/toast';
5
4
  export { DaffToastAction } from './interfaces/toast-action';
6
- export { DAFF_TOAST_OPTIONS, provideDaffToastOptions, } from './options/daff-toast-options';
7
5
  export { provideDaffToast } from './toast/toast-provider';
8
6
  export { DaffToastActionButtonSize, DaffToastActionButtonType, } from './interfaces/toast-action.type';
7
+ export { DaffToastOptions, DaffToastPosition, } from './interfaces/toast-options';
8
+ export { DaffToastVerticalPosition, DaffToastHorizontalPosition, } from './helpers/toast-position';
@@ -1,3 +1,3 @@
1
1
  import { PositionStrategy } from '@angular/cdk/overlay';
2
- import { DaffToastPosition } from '../options/daff-toast-options';
2
+ import { DaffToastPosition } from '../interfaces/toast-options';
3
3
  export declare const createPositionStrategy: (position: DaffToastPosition) => PositionStrategy;
@@ -1,5 +1,5 @@
1
1
  import { BreakpointObserver } from '@angular/cdk/layout';
2
- import { DaffToastOptions, DaffToastPosition } from '../options/daff-toast-options';
2
+ import { DaffToastOptions, DaffToastPosition } from '../interfaces/toast-options';
3
3
  import * as i0 from "@angular/core";
4
4
  export declare class DaffToastPositionService {
5
5
  private options;
@@ -4,7 +4,7 @@ import { Injector, OnDestroy } from '@angular/core';
4
4
  import { DaffFocusStackService } from '@daffodil/design';
5
5
  import { DaffToastPositionService } from './position.service';
6
6
  import { DaffToast, DaffToastData } from '../interfaces/toast';
7
- import { DaffToastOptions } from '../options/daff-toast-options';
7
+ import { DaffToastOptions } from '../interfaces/toast-options';
8
8
  import { DaffToastConfiguration } from '../toast/toast-config';
9
9
  import * as i0 from "@angular/core";
10
10
  /**
@@ -1,6 +1,7 @@
1
1
  import { Provider } from '@angular/core';
2
+ import { DaffToastOptions } from '../interfaces/toast-options';
2
3
  /**
3
- * Registers the `DaffToastService` and `DaffToastPositionService` for displaying a toast. This provider ensures
4
+ * Registers the `DaffToastService` for displaying a toast. This provider ensures
4
5
  * toasts function correctly within your application.
5
6
  *
6
7
  * ```ts
@@ -8,11 +9,22 @@ import { Provider } from '@angular/core';
8
9
  *
9
10
  * @NgModule({
10
11
  * providers: [
11
- * provideDaffToast(),
12
- * ]
12
+ * provideDaffToast({
13
+ * position: {
14
+ * vertical: 'bottom',
15
+ * horizontal: 'left',
16
+ * },
17
+ * }),
18
+ * ]
13
19
  * )}
14
20
  *
15
21
  * export class AppModule {}
16
22
  * ```
23
+ * @param config Sets the configuration for all toasts.
24
+ * Toasts are displayed in the top-right corner of the screen by default on desktop devices.
25
+ *
26
+ * On mobile devices, toasts will always appear in the bottom-center position,
27
+ * regardless of configuration settings.
28
+ *
17
29
  */
18
- export declare const provideDaffToast: () => Provider[];
30
+ export declare const provideDaffToast: (config?: DaffToastOptions) => Provider[];
@@ -1,6 +1,6 @@
1
1
  import { ChangeDetectorRef, EventEmitter } from '@angular/core';
2
2
  import { DaffToast } from '../interfaces/toast';
3
- import { DaffToastOptions } from '../options/daff-toast-options';
3
+ import { DaffToastOptions } from '../interfaces/toast-options';
4
4
  import { DaffToastPositionService } from '../service/position.service';
5
5
  import * as i0 from "@angular/core";
6
6
  export declare class DaffToastTemplateComponent {
@@ -1,6 +0,0 @@
1
- /**
2
- * An interface for giving a component the ability to display a skeleton/loading UI.
3
- */
4
- export interface DaffSkeletonable {
5
- skeleton: boolean;
6
- }
@@ -1,20 +0,0 @@
1
- import { OnInit } from '@angular/core';
2
- import { FormControl } from '@angular/forms';
3
- import { DaffToastService, DaffToastPositionService } from '@daffodil/design/toast';
4
- import * as i0 from "@angular/core";
5
- export declare class ToastPositionsComponent implements OnInit {
6
- private toastService;
7
- private toastPositionService;
8
- private toast;
9
- constructor(toastService: DaffToastService, toastPositionService: DaffToastPositionService);
10
- open(): void;
11
- private count;
12
- horizontalControl: FormControl;
13
- verticalControl: FormControl;
14
- /**
15
- * @docs-private
16
- */
17
- ngOnInit(): void;
18
- static ɵfac: i0.ɵɵFactoryDeclaration<ToastPositionsComponent, never>;
19
- static ɵcmp: i0.ɵɵComponentDeclaration<ToastPositionsComponent, "toast-positions", never, {}, {}, never, never, true, never>;
20
- }
@@ -1,14 +0,0 @@
1
- export interface VerticalPositionTypes {
2
- vertical: 'top' | 'bottom';
3
- }
4
- export interface HorizontalPositionTypes {
5
- horizontal: 'left' | 'center' | 'right';
6
- }
7
- export type DaffToastPosition = VerticalPositionTypes & HorizontalPositionTypes;
8
- export interface DaffToastOptions {
9
- position: DaffToastPosition;
10
- useParent: boolean;
11
- }
12
- export declare const daffToastDefaultOptions: DaffToastOptions;
13
- export declare const provideDaffToastOptions: <R extends DaffToastOptions = DaffToastOptions>(config: Partial<R> | import("@angular/core").InjectionToken<Partial<R>>) => import("@angular/core").FactoryProvider;
14
- export declare const DAFF_TOAST_OPTIONS: import("@angular/core").InjectionToken<DaffToastOptions>;