@daffodil/design 0.91.0 → 0.92.3-rc.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.
- package/accordion/README.md +26 -38
- package/accordion/index.d.ts +2 -2
- package/article/README.md +66 -46
- package/article/index.d.ts +22 -1
- package/article/src/article-theme.scss +12 -0
- package/breadcrumb/README.md +6 -1
- package/breadcrumb/index.d.ts +65 -11
- package/breadcrumb/src/breadcrumb-theme.scss +1 -1
- package/button/README.md +36 -33
- package/button/index.d.ts +26 -5
- package/button/src/button/basic/button-theme.scss +4 -2
- package/button/src/button/button-base.scss +26 -3
- package/button/src/button/icon/icon-theme.scss +10 -6
- package/button/src/button/raised/raised-theme.scss +4 -2
- package/callout/README.md +15 -27
- package/card/README.md +36 -61
- package/container/README.md +18 -23
- package/fesm2022/daffodil-design-accordion.mjs +13 -13
- package/fesm2022/daffodil-design-accordion.mjs.map +1 -1
- package/fesm2022/daffodil-design-article.mjs +168 -26
- package/fesm2022/daffodil-design-article.mjs.map +1 -1
- package/fesm2022/daffodil-design-breadcrumb.mjs +180 -28
- package/fesm2022/daffodil-design-breadcrumb.mjs.map +1 -1
- package/fesm2022/daffodil-design-button.mjs +83 -42
- package/fesm2022/daffodil-design-button.mjs.map +1 -1
- package/fesm2022/daffodil-design-callout.mjs +23 -23
- package/fesm2022/daffodil-design-callout.mjs.map +1 -1
- package/fesm2022/daffodil-design-card.mjs +33 -33
- package/fesm2022/daffodil-design-card.mjs.map +1 -1
- package/fesm2022/daffodil-design-checkbox.mjs +13 -13
- package/fesm2022/daffodil-design-checkbox.mjs.map +1 -1
- package/fesm2022/daffodil-design-container.mjs +8 -8
- package/fesm2022/daffodil-design-container.mjs.map +1 -1
- package/fesm2022/daffodil-design-form-field.mjs +26 -26
- package/fesm2022/daffodil-design-form-field.mjs.map +1 -1
- package/fesm2022/daffodil-design-form.mjs +9 -9
- package/fesm2022/daffodil-design-form.mjs.map +1 -1
- package/fesm2022/daffodil-design-hero.mjs +23 -23
- package/fesm2022/daffodil-design-hero.mjs.map +1 -1
- package/fesm2022/daffodil-design-image.mjs +8 -8
- package/fesm2022/daffodil-design-image.mjs.map +1 -1
- package/fesm2022/daffodil-design-input.mjs +18 -14
- package/fesm2022/daffodil-design-input.mjs.map +1 -1
- package/fesm2022/daffodil-design-link-set.mjs +25 -17
- package/fesm2022/daffodil-design-link-set.mjs.map +1 -1
- package/fesm2022/daffodil-design-list.mjs +16 -16
- package/fesm2022/daffodil-design-list.mjs.map +1 -1
- package/fesm2022/daffodil-design-loading-icon.mjs +8 -8
- package/fesm2022/daffodil-design-loading-icon.mjs.map +1 -1
- package/fesm2022/daffodil-design-media-gallery.mjs +13 -13
- package/fesm2022/daffodil-design-media-gallery.mjs.map +1 -1
- package/fesm2022/daffodil-design-menu.mjs +223 -60
- package/fesm2022/daffodil-design-menu.mjs.map +1 -1
- package/fesm2022/daffodil-design-modal.mjs +33 -29
- package/fesm2022/daffodil-design-modal.mjs.map +1 -1
- package/fesm2022/daffodil-design-native-select.mjs +47 -41
- package/fesm2022/daffodil-design-native-select.mjs.map +1 -1
- package/fesm2022/daffodil-design-navbar.mjs +25 -21
- package/fesm2022/daffodil-design-navbar.mjs.map +1 -1
- package/fesm2022/daffodil-design-notification.mjs +16 -16
- package/fesm2022/daffodil-design-notification.mjs.map +1 -1
- package/fesm2022/daffodil-design-paginator.mjs +7 -7
- package/fesm2022/daffodil-design-paginator.mjs.map +1 -1
- package/fesm2022/daffodil-design-progress-bar.mjs +10 -10
- package/fesm2022/daffodil-design-progress-bar.mjs.map +1 -1
- package/fesm2022/daffodil-design-quantity-field.mjs +17 -14
- package/fesm2022/daffodil-design-quantity-field.mjs.map +1 -1
- package/fesm2022/daffodil-design-radio.mjs +16 -16
- package/fesm2022/daffodil-design-radio.mjs.map +1 -1
- package/fesm2022/daffodil-design-select.mjs +6 -6
- package/fesm2022/daffodil-design-select.mjs.map +1 -1
- package/fesm2022/daffodil-design-sidebar.mjs +25 -25
- package/fesm2022/daffodil-design-sidebar.mjs.map +1 -1
- package/fesm2022/daffodil-design-spinner.mjs +99 -0
- package/fesm2022/daffodil-design-spinner.mjs.map +1 -0
- package/fesm2022/daffodil-design-switch.mjs +3 -3
- package/fesm2022/daffodil-design-switch.mjs.map +1 -1
- package/fesm2022/daffodil-design-tabs.mjs +15 -15
- package/fesm2022/daffodil-design-tabs.mjs.map +1 -1
- package/fesm2022/daffodil-design-tag.mjs +7 -7
- package/fesm2022/daffodil-design-tag.mjs.map +1 -1
- package/fesm2022/daffodil-design-text-snippet.mjs +6 -8
- package/fesm2022/daffodil-design-text-snippet.mjs.map +1 -1
- package/fesm2022/daffodil-design-textarea.mjs +6 -3
- package/fesm2022/daffodil-design-textarea.mjs.map +1 -1
- package/fesm2022/daffodil-design-toast.mjs +23 -25
- package/fesm2022/daffodil-design-toast.mjs.map +1 -1
- package/fesm2022/daffodil-design-tree.mjs +152 -103
- package/fesm2022/daffodil-design-tree.mjs.map +1 -1
- package/fesm2022/daffodil-design-youtube-player.mjs +6 -6
- package/fesm2022/daffodil-design-youtube-player.mjs.map +1 -1
- package/fesm2022/daffodil-design.mjs +385 -326
- package/fesm2022/daffodil-design.mjs.map +1 -1
- package/form-field/README.md +50 -85
- package/form-field/index.d.ts +11 -9
- package/hero/README.md +5 -5
- package/image/README.md +2 -2
- package/index.d.ts +184 -270
- package/input/README.md +4 -4
- package/input/index.d.ts +4 -3
- package/link-set/index.d.ts +9 -1
- package/list/README.md +2 -2
- package/loading-icon/README.md +1 -1
- package/loading-icon/index.d.ts +1 -1
- package/media-gallery/README.md +3 -3
- package/menu/README.md +107 -10
- package/menu/index.d.ts +143 -11
- package/modal/README.md +1 -1
- package/modal/index.d.ts +23 -15
- package/native-select/README.md +4 -4
- package/native-select/index.d.ts +8 -7
- package/navbar/README.md +23 -17
- package/navbar/index.d.ts +12 -2
- package/navbar/src/navbar-theme.scss +4 -46
- package/notification/README.md +4 -4
- package/package.json +1 -1
- package/paginator/README.md +42 -6
- package/paginator/index.d.ts +4 -2
- package/progress-bar/README.md +3 -3
- package/quantity-field/README.md +4 -4
- package/quantity-field/index.d.ts +4 -1
- package/radio/README.md +1 -1
- package/scss/theme.scss +7 -1
- package/scss/theming/_color-palettes.scss +0 -6
- package/select/README.md +4 -4
- package/sidebar/README.md +6 -6
- package/spinner/README.md +57 -0
- package/spinner/index.d.ts +53 -0
- package/spinner/src/spinner-theme.scss +62 -0
- package/switch/README.md +4 -4
- package/switch/index.d.ts +2 -2
- package/tabs/README.md +1 -1
- package/tabs/index.d.ts +2 -2
- package/tag/README.md +24 -30
- package/tag/index.d.ts +1 -1
- package/text-snippet/README.md +1 -1
- package/text-snippet/src/text-snippet-theme.scss +12 -0
- package/textarea/README.md +4 -4
- package/textarea/index.d.ts +4 -4
- package/toast/README.md +4 -4
- package/tree/README.md +39 -22
- package/tree/index.d.ts +57 -90
package/form-field/README.md
CHANGED
|
@@ -2,19 +2,20 @@
|
|
|
2
2
|
Form field is a wrapping component that provides consistent styling and behavior for form control elements.
|
|
3
3
|
|
|
4
4
|
## Overview
|
|
5
|
-
|
|
5
|
+
Form field is used to style certain controls that would otherwise be impossible to style with normal CSS and organize labels, hints, and error messages alongside their associated form controls.
|
|
6
6
|
|
|
7
|
+
## Supported controls
|
|
7
8
|
The following Daffodil Design components are designed to work inside a form field:
|
|
8
9
|
|
|
9
10
|
- [Native Input](/libs/design/input/README.md)
|
|
10
11
|
- [Native Select](/libs/design/native-select/README.md)
|
|
11
12
|
- [Native Textarea](/libs/design/textarea/README.md)
|
|
12
13
|
- [Custom Select](/libs/design/select/README.md)
|
|
14
|
+
- [Quantity Field](/libs/storefront/quantity-field/README.md)
|
|
13
15
|
|
|
14
16
|
## Usage
|
|
15
17
|
|
|
16
|
-
|
|
17
|
-
To use form field in a standalone component, import `DAFF_FORM_FIELD_COMPONENTS` directly into your custom component:
|
|
18
|
+
Import `DAFF_FORM_FIELD_COMPONENTS` into your component:
|
|
18
19
|
|
|
19
20
|
```ts
|
|
20
21
|
import { DAFF_FORM_FIELD_COMPONENTS } from '@daffodil/design/form-field';
|
|
@@ -29,110 +30,64 @@ import { DAFF_FORM_FIELD_COMPONENTS } from '@daffodil/design/form-field';
|
|
|
29
30
|
export class CustomComponent {}
|
|
30
31
|
```
|
|
31
32
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
```ts
|
|
36
|
-
import { NgModule } from '@angular/core';
|
|
37
|
-
import { DaffFormFieldModule } from '@daffodil/design/form-field';
|
|
38
|
-
import { CustomComponent } from './custom.component';
|
|
39
|
-
|
|
40
|
-
@NgModule({
|
|
41
|
-
declarations: [
|
|
42
|
-
CustomComponent,
|
|
43
|
-
],
|
|
44
|
-
exports: [
|
|
45
|
-
CustomComponent,
|
|
46
|
-
],
|
|
47
|
-
imports: [
|
|
48
|
-
DaffFormFieldModule,
|
|
49
|
-
],
|
|
50
|
-
})
|
|
51
|
-
export class CustomComponentModule { }
|
|
52
|
-
```
|
|
53
|
-
|
|
54
|
-
> **Warning**
|
|
55
|
-
>
|
|
56
|
-
> This method is deprecated. It's recommended to update all custom components to standalone.
|
|
33
|
+
> **Deprecation notice:**
|
|
34
|
+
>
|
|
35
|
+
> `DaffFormFieldModule` is deprecated. Use the standalone component imports instead.
|
|
57
36
|
|
|
58
37
|
## Anatomy
|
|
59
|
-
|
|
60
|
-
### Labels
|
|
61
|
-
Use `<daff-form-label>` to help users understand what information to enter into a form control. Form fields should always have labels. If a form control is marked as required, an asterisk will be attached to the label to indicate that it's a required field.
|
|
38
|
+
A form field is composed of a wrapper, label, form control, prefix, suffix, action, hint, and error message:
|
|
62
39
|
|
|
63
40
|
```html
|
|
64
41
|
<daff-form-field>
|
|
65
|
-
<daff-form-label>
|
|
66
|
-
<
|
|
42
|
+
<daff-form-label>Email</daff-form-label>
|
|
43
|
+
<fa-icon daffPrefix [icon]="faEnvelope"></fa-icon>
|
|
44
|
+
<input daff-input type="email" name="email" required />
|
|
45
|
+
<fa-icon daffSuffix [icon]="faCheck"></fa-icon>
|
|
46
|
+
<button daffFormFieldAction>Clear</button>
|
|
47
|
+
<daff-hint>We'll never share your email.</daff-hint>
|
|
48
|
+
<daff-error-message>Email is a required field.</daff-error-message>
|
|
67
49
|
</daff-form-field>
|
|
68
50
|
```
|
|
69
51
|
|
|
52
|
+
- **`<daff-form-field>`**: The wrapper component that holds all form field content.
|
|
53
|
+
- **`<daff-form-label>`**: The label for the form control. An asterisk is appended automatically when the control is required.
|
|
54
|
+
- **Form control**: Any element implementing `DaffFormFieldControl` (See [supported controls](/libs/design/form-field/README.md#supported-controls))
|
|
55
|
+
- **`[daffPrefix]`**: A leading visual, typically an icon, displayed before the form control.
|
|
56
|
+
- **`[daffSuffix]`**: A trailing visual, typically an icon, displayed after the form control.
|
|
57
|
+
- **`[daffFormFieldAction]`**: An action element, typically a button, attached to the form control.
|
|
58
|
+
- **`<daff-hint>`**: Helpful information displayed below the form field.
|
|
59
|
+
- **`<daff-error-message>`**: A validation error displayed below the form field, positioned after any hints.
|
|
60
|
+
|
|
70
61
|
> **Warning**
|
|
71
62
|
>
|
|
72
63
|
> The `DaffFormLabelDirective` (using `daffFormLabel` on `<label>`) is deprecated and will be removed in `v1.0.0`. Use `<daff-form-label>` instead for new implementations.
|
|
73
64
|
|
|
74
|
-
|
|
75
|
-
Hints are shown below the form field and are used to provide helpful information that assists users in correctly completing a field.
|
|
65
|
+
## Features
|
|
76
66
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
<daff-form-label>Password</daff-form-label>
|
|
80
|
-
<input daff-input type="text" name="password" />
|
|
81
|
-
<daff-hint>Password must have 8 characters.</daff-hint>
|
|
82
|
-
</daff-form-field>
|
|
83
|
-
```
|
|
84
|
-
|
|
85
|
-
Use the `validated` property to show hints with validation styling:
|
|
86
|
-
|
|
87
|
-
```html
|
|
88
|
-
<daff-form-field>
|
|
89
|
-
<daff-form-label>Password</daff-form-label>
|
|
90
|
-
<input daff-input type="text" name="password" />
|
|
91
|
-
<daff-hint [validated]="isControlValid">Password must have 8 characters.</daff-hint>
|
|
92
|
-
</daff-form-field>
|
|
93
|
-
```
|
|
67
|
+
### Appearances
|
|
68
|
+
Form field supports two `appearances`: `fluid` and `fixed`. It will default to `fluid` if an `appearance` is not specified.
|
|
94
69
|
|
|
95
|
-
|
|
96
|
-
|
|
70
|
+
- `fluid`: alternate, stylized UI where the label is placed inside of the form control.
|
|
71
|
+
- `fixed`: corresponds with a traditional style where the label is positioned outside and above the form control.
|
|
97
72
|
|
|
98
|
-
|
|
99
|
-
<daff-form-field>
|
|
100
|
-
<daff-form-label>Email*</daff-form-label>
|
|
101
|
-
<input daff-input type="text" name="email" />
|
|
102
|
-
@if (control.errors?.required) {
|
|
103
|
-
<daff-error-message>Email is a required field.</daff-error-message>
|
|
104
|
-
}
|
|
105
|
-
</daff-form-field>
|
|
106
|
-
```
|
|
73
|
+
<daff-docs-example-viewer example="form-field-appearances"></daff-docs-example-viewer>
|
|
107
74
|
|
|
108
75
|
### Action
|
|
109
|
-
Use the `[daffFormFieldAction]` element to add an action element to a form field.
|
|
110
|
-
|
|
111
76
|
- Fluid appearance: The action is positioned within the form control's UI.
|
|
112
77
|
- Fixed appearance: The action is positioned adjacent to the form control's UI.
|
|
113
78
|
|
|
114
|
-
<design-land-example-viewer-container example="form-field-with-action"></design-land-example-viewer-container>
|
|
115
|
-
|
|
116
|
-
### Prefix and suffix
|
|
117
|
-
Use the `[daffPrefix]` and `[daffSuffix]` elements to display leading or trailing visuals, typically icons, on either side of the form control.
|
|
118
|
-
|
|
119
79
|
> **Note**
|
|
120
80
|
>
|
|
121
|
-
> In a fluid appearance, avoid using suffix alongside an action.
|
|
122
|
-
|
|
123
|
-
<design-land-example-viewer-container example="form-field-with-prefix"></design-land-example-viewer-container>
|
|
81
|
+
> In a fluid appearance, avoid using a suffix alongside an action.
|
|
124
82
|
|
|
125
|
-
<
|
|
83
|
+
<daff-docs-example-viewer example="form-field-with-action"></daff-docs-example-viewer>
|
|
126
84
|
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
- `fluid`: alternate, stylized UI where the label is placed inside of the form control.
|
|
131
|
-
- `fixed`: corresponds with a traditional style where the label is positioned outside and above the form control.
|
|
85
|
+
### Validated hints
|
|
86
|
+
Use the `validated` property on `<daff-hint>` to apply validation styling:
|
|
132
87
|
|
|
133
|
-
<
|
|
88
|
+
<daff-docs-example-viewer example="form-field-validated-hint"></daff-docs-example-viewer>
|
|
134
89
|
|
|
135
|
-
|
|
90
|
+
### Custom IDs
|
|
136
91
|
Form fields automatically generate IDs to handle accessibility. You can override this by setting a custom `id` on the form field when needed for specific labeling requirements.
|
|
137
92
|
|
|
138
93
|
```html
|
|
@@ -146,7 +101,7 @@ Form fields automatically generate IDs to handle accessibility. You can override
|
|
|
146
101
|
>
|
|
147
102
|
> When you provide a custom `id`, the `<daff-form-label>` automatically gets the correct `for` attribute that matches the control's `id`.
|
|
148
103
|
|
|
149
|
-
|
|
104
|
+
### Custom controls
|
|
150
105
|
In addition to the controls that Daffodil Design provides, you can create your own custom control by using the `DaffFormFieldControl` interface.
|
|
151
106
|
|
|
152
107
|
1. Your control component must implement the `DaffFormFieldControl` interface.
|
|
@@ -165,13 +120,21 @@ In addition to the controls that Daffodil Design provides, you can create your o
|
|
|
165
120
|
export class CustomControlComponent implements DaffFormFieldControl<any> {}
|
|
166
121
|
```
|
|
167
122
|
|
|
123
|
+
## Examples
|
|
124
|
+
|
|
125
|
+
### Form field with prefix
|
|
126
|
+
<daff-docs-example-viewer example="form-field-with-prefix"></daff-docs-example-viewer>
|
|
127
|
+
|
|
128
|
+
### Form field with suffix
|
|
129
|
+
<daff-docs-example-viewer example="form-field-with-suffix"></daff-docs-example-viewer>
|
|
130
|
+
|
|
168
131
|
## Best practices
|
|
169
132
|
- Always provide labels for accessibility. Use `<daff-form-label>` for the best experience with auto-labelling controls.
|
|
170
133
|
- Set meaningful custom IDs for form fields to improve accessibility and form management.
|
|
171
134
|
|
|
172
135
|
## Accessibility
|
|
173
136
|
|
|
174
|
-
###
|
|
137
|
+
### Built-in behavior
|
|
175
138
|
|
|
176
139
|
- `<daff-hint>` and `<daff-error-message>` are linked to the form control via `aria-describedby`.
|
|
177
140
|
- `<daff-error-message>` is set to `aria-live="polite"` by default so that assistive technology only announce errors when they appear.
|
|
@@ -193,5 +156,7 @@ export class CustomControlComponent implements DaffFormFieldControl<any> {}
|
|
|
193
156
|
|
|
194
157
|
## Troubleshooting
|
|
195
158
|
|
|
196
|
-
###
|
|
197
|
-
|
|
159
|
+
### Missing child control
|
|
160
|
+
> A DaffFormFieldComponent must contain a DaffFormFieldControl
|
|
161
|
+
|
|
162
|
+
`DaffFormFieldComponent` requires a child component that implements `DaffFormFieldControl`. To fix this, add a control like `daff-input` inside the form field.
|
package/form-field/index.d.ts
CHANGED
|
@@ -7,11 +7,10 @@ import { DaffFormFieldLabelDirective, DaffHintComponent, DaffErrorMessageCompone
|
|
|
7
7
|
import { NgControl } from '@angular/forms';
|
|
8
8
|
import { BehaviorSubject, Observable } from 'rxjs';
|
|
9
9
|
|
|
10
|
+
/**
|
|
11
|
+
* DaffFormFieldActionDirective marks an element, typically a button, as an action attached to a form control inside `DaffFormFieldComponent`.
|
|
12
|
+
*/
|
|
10
13
|
declare class DaffFormFieldActionDirective {
|
|
11
|
-
/**
|
|
12
|
-
* @docs-private
|
|
13
|
-
*/
|
|
14
|
-
class: boolean;
|
|
15
14
|
static ɵfac: i0.ɵɵFactoryDeclaration<DaffFormFieldActionDirective, never>;
|
|
16
15
|
static ɵdir: i0.ɵɵDirectiveDeclaration<DaffFormFieldActionDirective, "[daffFormFieldAction]", never, {}, {}, never, never, true, never>;
|
|
17
16
|
}
|
|
@@ -25,11 +24,11 @@ interface DaffFormFieldState {
|
|
|
25
24
|
}
|
|
26
25
|
|
|
27
26
|
/**
|
|
28
|
-
*
|
|
27
|
+
* Form controls must extend this class to be used inside `DaffFormFieldComponent`.
|
|
29
28
|
*
|
|
30
29
|
* > **Note**
|
|
31
|
-
* >
|
|
32
|
-
*
|
|
30
|
+
* > The control is defined as an abstract class instead of an interface to support Angular's dependency injection. Interfaces are erased during TypeScript compilation and cannot be used as DI tokens.
|
|
31
|
+
* >
|
|
33
32
|
* > By using an abstract class, the Angular DI container can match the class token for injection.
|
|
34
33
|
*/
|
|
35
34
|
declare abstract class DaffFormFieldControl<T> {
|
|
@@ -101,6 +100,9 @@ declare abstract class DaffFormFieldControl<T> {
|
|
|
101
100
|
}
|
|
102
101
|
|
|
103
102
|
type DaffFormFieldApperanace = 'fluid' | 'fixed';
|
|
103
|
+
/**
|
|
104
|
+
* DaffFormFieldComponent is a wrapping component that provides consistent styling and behavior for form control elements.
|
|
105
|
+
*/
|
|
104
106
|
declare class DaffFormFieldComponent implements AfterContentInit, AfterContentChecked, AfterViewInit {
|
|
105
107
|
private cd;
|
|
106
108
|
elementRef: ElementRef;
|
|
@@ -119,7 +121,7 @@ declare class DaffFormFieldComponent implements AfterContentInit, AfterContentCh
|
|
|
119
121
|
_control: DaffFormFieldControl<unknown>;
|
|
120
122
|
/**
|
|
121
123
|
* @docs-private
|
|
122
|
-
* @deprecated Deprecated in version 0.86.0. Will be removed in
|
|
124
|
+
* @deprecated Deprecated in version 0.86.0. Will be removed in version 1.0.0.
|
|
123
125
|
*/
|
|
124
126
|
_formLabelDirective: DaffFormLabelDirective;
|
|
125
127
|
/**
|
|
@@ -178,7 +180,7 @@ declare class DaffFormFieldComponent implements AfterContentInit, AfterContentCh
|
|
|
178
180
|
get isRaised(): boolean;
|
|
179
181
|
private _appearance;
|
|
180
182
|
/**
|
|
181
|
-
* The appearance
|
|
183
|
+
* The appearance of the form field. Defaults to `fluid`.
|
|
182
184
|
*/
|
|
183
185
|
get appearance(): DaffFormFieldApperanace;
|
|
184
186
|
set appearance(value: DaffFormFieldApperanace);
|
package/hero/README.md
CHANGED
|
@@ -4,7 +4,7 @@ A hero is a top-level container designed to be large and captivating, typically
|
|
|
4
4
|
## Overview
|
|
5
5
|
Heroes are the first visual element users see on a page and are intended to make a bold statement. They're flexible and extensible, including pre-styled content containers for common layouts such as titles, subtitles, taglines, and body content. Heroes should only be used once per page.
|
|
6
6
|
|
|
7
|
-
<
|
|
7
|
+
<daff-docs-example-viewer example="basic-hero"></daff-docs-example-viewer>
|
|
8
8
|
|
|
9
9
|
## Best practices
|
|
10
10
|
|
|
@@ -103,21 +103,21 @@ A hero consists of the following components, displayed in the order listed:
|
|
|
103
103
|
### Colors
|
|
104
104
|
Use the `color` property to change the background of a hero.
|
|
105
105
|
|
|
106
|
-
<
|
|
106
|
+
<daff-docs-example-viewer example="hero-theming"></daff-docs-example-viewer>
|
|
107
107
|
|
|
108
108
|
### Text alignment
|
|
109
109
|
Control hero-specific text alignment with the `textAlignment` property. It defaults to `left` and **does not** affect `[daffHeroBody]` content or nested elements.
|
|
110
110
|
|
|
111
|
-
<
|
|
111
|
+
<daff-docs-example-viewer example="hero-text-alignment"></daff-docs-example-viewer>
|
|
112
112
|
|
|
113
113
|
### Compact
|
|
114
114
|
Use the `compact` property on hero to reduce padding and suit UIs with tighter spacing requirements.
|
|
115
115
|
|
|
116
|
-
<
|
|
116
|
+
<daff-docs-example-viewer example="compact-hero"></daff-docs-example-viewer>
|
|
117
117
|
|
|
118
118
|
## Examples
|
|
119
119
|
|
|
120
120
|
### Hero with two columns
|
|
121
121
|
Heroes are flexible enough to support custom grid layouts for more complex arrangements:
|
|
122
122
|
|
|
123
|
-
<
|
|
123
|
+
<daff-docs-example-viewer example="hero-with-grid"></daff-docs-example-viewer>
|
package/image/README.md
CHANGED
|
@@ -8,7 +8,7 @@ Image builds on Angular's [`NgOptimizedImage`](https://angular.dev/guide/image-o
|
|
|
8
8
|
- Ensuring accessibility by requiring descriptive `alt` text
|
|
9
9
|
- Maintaining proper aspect ratios for responsive designs
|
|
10
10
|
|
|
11
|
-
<
|
|
11
|
+
<daff-docs-example-viewer example="basic-image"></daff-docs-example-viewer>
|
|
12
12
|
|
|
13
13
|
## Usage
|
|
14
14
|
|
|
@@ -70,7 +70,7 @@ All four of the following attributes are required and will throw an error if mis
|
|
|
70
70
|
## Skeleton screen
|
|
71
71
|
Use the `skeleton` property to display a placeholder skeleton screen that helps reduce load-time frustration.
|
|
72
72
|
|
|
73
|
-
<
|
|
73
|
+
<daff-docs-example-viewer example="skeleton-image"></daff-docs-example-viewer>
|
|
74
74
|
|
|
75
75
|
## Priority loading
|
|
76
76
|
Use the `priority` property to mark an image as a priority for loading. Priority images are loaded eagerly and not lazy-loaded.
|