@daffodil/design 0.86.0 → 0.87.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/accordion/README.md +36 -34
- package/accordion/accordion/accordion/accordion.component.d.ts +15 -1
- package/accordion/accordion/accordion-item/accordion-item.component.d.ts +10 -3
- package/accordion/accordion/accordion-item-title/accordion-item-title.directive.d.ts +6 -1
- package/atoms/form/form-field/action/action.directive.d.ts +9 -0
- package/atoms/form/form-field/form-field/form-field.component.d.ts +33 -1
- package/atoms/form/form-field/form-field.d.ts +2 -1
- package/atoms/form/form-field/public_api.d.ts +1 -0
- package/breadcrumb/README.md +24 -22
- package/breadcrumb/breadcrumb/breadcrumb.component.d.ts +15 -0
- package/breadcrumb/breadcrumb-item/breadcrumb-item.directive.d.ts +10 -0
- package/button/README.md +58 -42
- package/button/button/button-base.directive.d.ts +10 -4
- package/button/button.d.ts +22 -1
- package/button/public_api.d.ts +1 -1
- package/button/src/button/button-base.scss +0 -1
- package/button/src/button/raised/raised-theme.scss +3 -3
- package/core/statusable/statusable.directive.d.ts +22 -2
- package/fesm2022/daffodil-design-accordion.mjs +31 -5
- package/fesm2022/daffodil-design-accordion.mjs.map +1 -1
- package/fesm2022/daffodil-design-article.mjs +2 -2
- package/fesm2022/daffodil-design-article.mjs.map +1 -1
- package/fesm2022/daffodil-design-breadcrumb.mjs +25 -0
- package/fesm2022/daffodil-design-breadcrumb.mjs.map +1 -1
- package/fesm2022/daffodil-design-button.mjs +58 -16
- package/fesm2022/daffodil-design-button.mjs.map +1 -1
- package/fesm2022/daffodil-design-form-field-examples.mjs +95 -0
- package/fesm2022/daffodil-design-form-field-examples.mjs.map +1 -0
- package/fesm2022/daffodil-design-input-examples.mjs +5 -5
- package/fesm2022/daffodil-design-input-examples.mjs.map +1 -1
- package/fesm2022/daffodil-design-input.mjs +11 -15
- package/fesm2022/daffodil-design-input.mjs.map +1 -1
- package/fesm2022/daffodil-design-media-gallery-examples.mjs +2 -2
- package/fesm2022/daffodil-design-media-gallery-examples.mjs.map +1 -1
- package/fesm2022/daffodil-design-modal-examples.mjs +3 -2
- package/fesm2022/daffodil-design-modal-examples.mjs.map +1 -1
- package/fesm2022/daffodil-design-modal.mjs +12 -11
- package/fesm2022/daffodil-design-modal.mjs.map +1 -1
- package/fesm2022/daffodil-design-notification-examples.mjs +3 -3
- package/fesm2022/daffodil-design-notification-examples.mjs.map +1 -1
- package/fesm2022/daffodil-design-quantity-field-examples.mjs +4 -4
- package/fesm2022/daffodil-design-quantity-field-examples.mjs.map +1 -1
- package/fesm2022/daffodil-design-select-examples.mjs +117 -0
- package/fesm2022/daffodil-design-select-examples.mjs.map +1 -0
- package/fesm2022/daffodil-design-select.mjs +431 -0
- package/fesm2022/daffodil-design-select.mjs.map +1 -0
- package/fesm2022/daffodil-design-textarea-examples.mjs +66 -0
- package/fesm2022/daffodil-design-textarea-examples.mjs.map +1 -0
- package/fesm2022/daffodil-design-textarea.mjs +124 -0
- package/fesm2022/daffodil-design-textarea.mjs.map +1 -0
- package/fesm2022/daffodil-design.mjs +135 -11
- package/fesm2022/daffodil-design.mjs.map +1 -1
- package/form-field/examples/examples.d.ts +3 -0
- package/form-field/examples/form-field-appearances/form-field-appearances.component.d.ts +7 -0
- package/form-field/examples/form-field-with-action/form-field-with-action.component.d.ts +9 -0
- package/form-field/examples/form-field-with-prefix/form-field-with-prefix.component.d.ts +6 -0
- package/form-field/examples/form-field-with-suffix/form-field-with-suffix.component.d.ts +6 -0
- package/form-field/examples/index.d.ts +1 -0
- package/form-field/examples/public_api.d.ts +1 -0
- package/input/input.component.d.ts +4 -8
- package/media-gallery/README.md +24 -12
- package/modal/modal/modal.component.d.ts +5 -3
- package/notification/src/notification-theme.scss +34 -18
- package/package.json +1 -1
- package/scss/theme.scss +8 -0
- package/scss/theming/illuminate/illuminate.scss +2 -0
- package/select/README.md +8 -0
- package/select/animation/select-animation-state.d.ts +7 -0
- package/select/animation/select-animation.d.ts +4 -0
- package/select/animation/state.enum.d.ts +4 -0
- package/select/examples/default-select/default-select.component.d.ts +8 -0
- package/select/examples/disabled-select/disabled-select.component.d.ts +8 -0
- package/select/examples/index.d.ts +1 -0
- package/select/examples/models/address.type.d.ts +7 -0
- package/select/examples/models/addresses.d.ts +2 -0
- package/select/examples/public_api.d.ts +3 -0
- package/select/examples/select-with-error/select-with-error.component.d.ts +8 -0
- package/select/examples/skeleton-select/skeleton-select.component.d.ts +8 -0
- package/select/index.d.ts +1 -0
- package/select/option/context.type.d.ts +17 -0
- package/select/option/option.directive.d.ts +11 -0
- package/select/public_api.d.ts +4 -0
- package/select/select/select.component.d.ts +170 -0
- package/select/select.d.ts +4 -0
- package/select/src/select-theme.scss +75 -0
- package/src/atoms/form/form-field/form-field/form-field-theme.scss +35 -8
- package/textarea/README.md +28 -0
- package/textarea/examples/basic-textarea/basic-textarea.component.d.ts +5 -0
- package/textarea/examples/examples.d.ts +2 -0
- package/textarea/examples/index.d.ts +1 -0
- package/textarea/examples/public_api.d.ts +1 -0
- package/textarea/examples/textarea-disabled/textarea-disabled.component.d.ts +7 -0
- package/textarea/examples/textarea-error/textarea-error.component.d.ts +7 -0
- package/textarea/index.d.ts +1 -0
- package/textarea/public_api.d.ts +1 -0
- package/textarea/textarea.component.d.ts +59 -0
package/accordion/README.md
CHANGED
@@ -1,21 +1,14 @@
|
|
1
1
|
# Accordion
|
2
|
-
An accordion is a group of vertically stacked headings
|
2
|
+
An accordion is a group of vertically stacked headings that allow users to toggle the visibility of related content.
|
3
3
|
|
4
4
|
## Overview
|
5
|
-
Accordions
|
5
|
+
Accordions helps reduce scrolling by hiding non-essential information until it’s needed. Use it to organize content into collapsible sections. This is especially useful for long pages where not all information needs to be visible at once.
|
6
6
|
|
7
7
|
<design-land-example-viewer-container example="basic-accordion"></design-land-example-viewer-container>
|
8
8
|
|
9
|
-
## Formatting
|
10
|
-
Accordions are built using `<daff-accordion>`, `<daff-accordion-item>`, and `[daffAccordionItemTitle]`.
|
11
|
-
|
12
|
-
- **`<daff-accordion>`**: A wrapper for grouping accordion items.
|
13
|
-
- **`<daff-accordion-item>`**: The wrapper for the title and content. It handles the expansion and collapse of the inner content when clicked.
|
14
|
-
- **`[daffAccordionItemTitle]`**: Used to provide a high level overview of the content.
|
15
|
-
|
16
|
-
Any additional content placed inside of an accordion item will be displayed as part of the collapsible content.
|
17
|
-
|
18
9
|
## Usage
|
10
|
+
To use the accordion components, import `DAFF_ACCORDION_COMPONENTS` into your custom component:
|
11
|
+
|
19
12
|
```ts
|
20
13
|
import { DAFF_ACCORDION_COMPONENTS } from '@daffodil/design/accordion';
|
21
14
|
|
@@ -29,43 +22,52 @@ import { DAFF_ACCORDION_COMPONENTS } from '@daffodil/design/accordion';
|
|
29
22
|
export class CustomComponent {}
|
30
23
|
```
|
31
24
|
|
25
|
+
## Anatomy
|
26
|
+
An accordion is composed of the following:
|
27
|
+
|
28
|
+
- **`<daff-accordion>`**: Groups accordion items.
|
29
|
+
- **`<daff-accordion-item>`**: Contains the title and collapsible content. Handles expansion and collapse on user interaction.
|
30
|
+
- **`[daffAccordionItemTitle]`**: Used to provide a high level overview of the panel content.
|
31
|
+
|
32
|
+
Content inside `<daff-accordion-item>` (excluding the title) is part of the panel content that is shown or hidden when the item is toggled.
|
33
|
+
|
32
34
|
```html
|
33
35
|
<daff-accordion>
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
<daff-accordion-item>
|
39
|
-
<div daffAccordionItemTitle></div>
|
40
|
-
<p>Item Content</p>
|
41
|
-
</daff-accordion-item>
|
36
|
+
<daff-accordion-item>
|
37
|
+
<div daffAccordionItemTitle>Title</div>
|
38
|
+
<div>Expandable content</div>
|
39
|
+
</daff-accordion-item>
|
42
40
|
</daff-accordion>
|
43
41
|
```
|
44
42
|
|
45
|
-
##
|
43
|
+
## Expand an item by default
|
44
|
+
Use the `initiallyExpanded` property on the accordion item to have an item open by default.
|
46
45
|
|
47
|
-
|
48
|
-
Use the `initiallyExpanded` property on the accordion item to have it opened by default.
|
46
|
+
<design-land-example-viewer-container example="initially-expanded-accordion"></design-land-example-viewer-container>
|
49
47
|
|
50
|
-
|
51
|
-
|
52
|
-
```
|
48
|
+
## Disable an accordion item
|
49
|
+
Use the `disabled` property on the accordion item to disable and prevent it from being expanded or collapsed.
|
53
50
|
|
54
|
-
|
55
|
-
Use the `disabled` property on the accordion item to prevent it from being expanded or collapsed.
|
56
|
-
|
57
|
-
```html
|
58
|
-
<daff-accordion-item [disabled]="true"></daff-accordion-item>
|
59
|
-
```
|
51
|
+
<design-land-example-viewer-container example="disabled-accordion"></design-land-example-viewer-container>
|
60
52
|
|
61
53
|
## Accessibility
|
62
54
|
Accordion follows the [Accordion WAI-ARIA design pattern](https://www.w3.org/WAI/ARIA/apg/patterns/accordion/).
|
63
55
|
|
64
|
-
|
65
|
-
-
|
56
|
+
Titles act as buttons with:
|
57
|
+
- `role="button"`
|
58
|
+
- A unique `id`, defined by the `contentId` property.
|
59
|
+
- `aria-expanded` to indicate current state.
|
60
|
+
- `aria-controls` property linked to the associated panel content.
|
61
|
+
|
62
|
+
Content blocks include:
|
63
|
+
- `role="region"`
|
64
|
+
- A unique `id`, defined by the `itemId` property.
|
65
|
+
- `aria-labelledby` property linked to the corresponding title.
|
66
|
+
|
67
|
+
IDs are autogenerated by default but can be overridden via the `contentId` and `itemId` inputs on `<daff-accordion-item>`.
|
66
68
|
|
67
69
|
### Keyboard interactions
|
68
70
|
| Key | Action |
|
69
71
|
| --- | ------ |
|
70
72
|
| `Tab` | Moves focus to the next focusable element. |
|
71
|
-
| `Space`
|
73
|
+
| `Space` / `Enter` | Expands or collapses the focused accordion item's panel content. |
|
@@ -1,7 +1,21 @@
|
|
1
1
|
import * as i0 from "@angular/core";
|
2
2
|
import * as i1 from "@daffodil/design";
|
3
3
|
/**
|
4
|
-
*
|
4
|
+
* Groups accordion items.
|
5
|
+
*
|
6
|
+
* @example
|
7
|
+
* ```html
|
8
|
+
* <daff-accordion>
|
9
|
+
* <daff-accordion-item>
|
10
|
+
* <div daffAccordionItemTitle>Title</div>
|
11
|
+
* <div>Expandable content</div>
|
12
|
+
* </daff-accordion-item>
|
13
|
+
* <daff-accordion-item>
|
14
|
+
* <div daffAccordionItemTitle>Title</div>
|
15
|
+
* <div>Expandable content</div>
|
16
|
+
* </daff-accordion-item>
|
17
|
+
* </daff-accordion>
|
18
|
+
* ```
|
5
19
|
*/
|
6
20
|
export declare class DaffAccordionComponent {
|
7
21
|
static ɵfac: i0.ɵɵFactoryDeclaration<DaffAccordionComponent, never>;
|
@@ -3,8 +3,15 @@ import { DaffOpenable, DaffOpenableDirective } from '@daffodil/design';
|
|
3
3
|
import * as i0 from "@angular/core";
|
4
4
|
import * as i1 from "@daffodil/design";
|
5
5
|
/**
|
6
|
-
*
|
7
|
-
*
|
6
|
+
* Contains the title and collapsible content. Handles expansion and collapse on user interaction. All `<daff-accordion-item>`s should be grouped inside a `<daff-accordion>`.
|
7
|
+
*
|
8
|
+
* @example
|
9
|
+
* ```html
|
10
|
+
* <daff-accordion-item>
|
11
|
+
* <div daffAccordionItemTitle>Title</div>
|
12
|
+
* <div>Accordion content</div>
|
13
|
+
* </daff-accordion-item>
|
14
|
+
* ```
|
8
15
|
*/
|
9
16
|
export declare class DaffAccordionItemComponent implements OnInit, DaffOpenable {
|
10
17
|
private openDirective;
|
@@ -21,7 +28,7 @@ export declare class DaffAccordionItemComponent implements OnInit, DaffOpenable
|
|
21
28
|
*/
|
22
29
|
contentId: string;
|
23
30
|
/**
|
24
|
-
* Whether or not
|
31
|
+
* Whether or not an accordion item is initially expanded by default.
|
25
32
|
*/
|
26
33
|
initiallyExpanded: boolean;
|
27
34
|
/**
|
@@ -1,6 +1,11 @@
|
|
1
1
|
import * as i0 from "@angular/core";
|
2
2
|
/**
|
3
|
-
* Used to provide a high level overview of the content. It should be wrapped by a `<daff-accordion-item>`.
|
3
|
+
* Used to provide a high level overview of the panel content. It should be wrapped by a `<daff-accordion-item>`.
|
4
|
+
*
|
5
|
+
* @example
|
6
|
+
* ```html
|
7
|
+
* <div daffAccordionItemTitle>Title</div>
|
8
|
+
* ```
|
4
9
|
*/
|
5
10
|
export declare class DaffAccordionItemTitleDirective {
|
6
11
|
/**
|
@@ -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
|
+
}
|
@@ -2,10 +2,12 @@ import { AfterContentInit, AfterContentChecked, ChangeDetectorRef, AfterViewInit
|
|
2
2
|
import { DaffPrefixDirective } from '../../../../core/prefix-suffix/prefix.directive';
|
3
3
|
import { DaffSuffixDirective } from '../../../../core/prefix-suffix/suffix.directive';
|
4
4
|
import { DaffFormLabelDirective } from '../../form-label/form-label.directive';
|
5
|
+
import { DaffFormFieldActionDirective } from '../action/action.directive';
|
5
6
|
import { DaffFormFieldControl } from '../form-field-control';
|
6
7
|
import { DaffFormFieldLabelDirective } from '../label/label.directive';
|
7
8
|
import * as i0 from "@angular/core";
|
8
9
|
import * as i1 from "../../../../core/skeletonable/skeletonable.directive";
|
10
|
+
export type DaffFormFieldApperanace = 'fluid' | 'fixed';
|
9
11
|
export declare class DaffFormFieldComponent implements AfterContentInit, AfterContentChecked, AfterViewInit {
|
10
12
|
private cd;
|
11
13
|
/** @docs-private */
|
@@ -15,8 +17,16 @@ export declare class DaffFormFieldComponent implements AfterContentInit, AfterCo
|
|
15
17
|
constructor(cd: ChangeDetectorRef);
|
16
18
|
/** @docs-private */
|
17
19
|
_prefix: DaffPrefixDirective;
|
20
|
+
/**
|
21
|
+
* @docs-private
|
22
|
+
*/
|
23
|
+
get hasPrefixClass(): DaffPrefixDirective;
|
18
24
|
/** @docs-private */
|
19
25
|
_suffix: DaffSuffixDirective;
|
26
|
+
/**
|
27
|
+
* @docs-private
|
28
|
+
*/
|
29
|
+
get hasSuffixClass(): DaffSuffixDirective | DaffFormFieldActionDirective;
|
20
30
|
/**
|
21
31
|
* @docs-private
|
22
32
|
*
|
@@ -32,6 +42,10 @@ export declare class DaffFormFieldComponent implements AfterContentInit, AfterCo
|
|
32
42
|
* @docs-private
|
33
43
|
*/
|
34
44
|
_formFieldLabelDirective: DaffFormFieldLabelDirective;
|
45
|
+
/**
|
46
|
+
* @docs-private
|
47
|
+
*/
|
48
|
+
_action: DaffFormFieldActionDirective;
|
35
49
|
/**
|
36
50
|
* @docs-private
|
37
51
|
*/
|
@@ -94,6 +108,24 @@ export declare class DaffFormFieldComponent implements AfterContentInit, AfterCo
|
|
94
108
|
* @docs-private
|
95
109
|
*/
|
96
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);
|
117
|
+
/**
|
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;
|
97
129
|
/**
|
98
130
|
* The unique id of the form field. Defaults to an autogenerated value. When using this,
|
99
131
|
* it's your responsibility to ensure that the id for each form field is unique.
|
@@ -152,5 +184,5 @@ export declare class DaffFormFieldComponent implements AfterContentInit, AfterCo
|
|
152
184
|
*/
|
153
185
|
ngAfterContentChecked(): void;
|
154
186
|
static ɵfac: i0.ɵɵFactoryDeclaration<DaffFormFieldComponent, never>;
|
155
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<DaffFormFieldComponent, "daff-form-field", never, { "id": { "alias": "id"; "required": false; }; }, {}, ["_prefix", "_suffix", "_control", "_formLabelDirective", "_formFieldLabelDirective", "_hint", "_error"], ["[daffPrefix]", "
|
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: {}; }]>;
|
156
188
|
}
|
@@ -4,8 +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';
|
7
8
|
import { DaffFormFieldLabelDirective } from './label/label.directive';
|
8
9
|
/**
|
9
10
|
* @docs-private
|
10
11
|
*/
|
11
|
-
export declare const DAFF_FORM_FIELD_COMPONENTS: readonly [typeof DaffFormFieldComponent, typeof DaffErrorMessageComponent, typeof DaffFormLabelDirective, typeof DaffHintComponent, typeof DaffPrefixDirective, typeof DaffSuffixDirective, typeof DaffFormFieldLabelDirective];
|
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];
|
@@ -3,3 +3,4 @@ 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
5
|
export { DaffFormFieldLabelDirective } from './label/label.directive';
|
6
|
+
export { DaffFormFieldActionDirective } from './action/action.directive';
|
package/breadcrumb/README.md
CHANGED
@@ -1,22 +1,14 @@
|
|
1
1
|
# Breadcrumb
|
2
|
-
|
2
|
+
Breadcrumb is a secondary navigation pattern that shows users their current location within a website or application’s hierarchy.
|
3
3
|
|
4
4
|
## Overview
|
5
|
-
Breadcrumbs
|
6
|
-
|
7
|
-
## Requirements
|
8
|
-
- `[daff-breadcrumb]` is required to be used with the native HTML `<ol>` element.
|
9
|
-
- Each `[daffBreadcrumbItem]` needs to be a `<li>` element.
|
10
|
-
|
11
|
-
## Structure
|
12
|
-
Breadcrumbs are built using `[daff-breadcrumb]` and `[daffBreadCrumbItem]`.
|
13
|
-
|
14
|
-
- **`[daff-breadcrumb]`**: a wrapper for grouping breadcrumb items.
|
15
|
-
- **`[daffBreacrumbItem]`**: used to display each breadcrumb item.
|
5
|
+
Breadcrumbs visually represent the navigational structure of a site or app and helps users navigate to parent levels with ease. Each breadcrumb item corresponds to a level in the hierarchy, with the last item indicating the current page or context.
|
16
6
|
|
17
7
|
<design-land-example-viewer-container example="basic-breadcrumb"></design-land-example-viewer-container>
|
18
8
|
|
19
9
|
## Usage
|
10
|
+
To use the breadcrumb components, import `DAFF_BREADCRUMB_COMPONENTS` into your custom component:
|
11
|
+
|
20
12
|
```ts
|
21
13
|
import { DAFF_BREADCRUMB_COMPONENTS } from '@daffodil/design/breadcrumb';
|
22
14
|
|
@@ -30,16 +22,19 @@ import { DAFF_BREADCRUMB_COMPONENTS } from '@daffodil/design/breadcrumb';
|
|
30
22
|
export class CustomComponent {}
|
31
23
|
```
|
32
24
|
|
25
|
+
## Anatomy
|
26
|
+
A breadcrumb is composed of the following:
|
27
|
+
|
28
|
+
- **`[daff-breadcrumb]`**: Groups breadcrumb items. Must be applied to a native `<ol>` element.
|
29
|
+
- **`[daffBreacrumbItem]`**: Represents each individual breadcrumb item. Must be used on a `<li>` element.
|
30
|
+
|
33
31
|
```html
|
34
32
|
<ol daff-breadcrumb>
|
35
33
|
<li daffBreadcrumbItem>
|
36
|
-
<a routerLink="/
|
37
|
-
</li>
|
38
|
-
<li daffBreadcrumbItem>
|
39
|
-
<a routerLink="/link">Link</a>
|
34
|
+
<a routerLink="/">Home</a>
|
40
35
|
</li>
|
41
36
|
<li daffBreacrumbItem>
|
42
|
-
<span>
|
37
|
+
<span>Current page</span>
|
43
38
|
</li>
|
44
39
|
</ol>
|
45
40
|
```
|
@@ -47,16 +42,23 @@ export class CustomComponent {}
|
|
47
42
|
## Accessibility
|
48
43
|
Breadcrumb follows the [Breadcrumb WAI-ARIA design pattern](https://www.w3.org/WAI/ARIA/apg/patterns/breadcrumb/).
|
49
44
|
|
50
|
-
- `aria-current="page"`
|
45
|
+
- The last breadcrumb item is automatically assigned `aria-current="page"` to indicate the current page.
|
51
46
|
|
52
|
-
|
47
|
+
### Best practices
|
48
|
+
To ensure full accessibility compliance with the WAI-ARIA design pattern:
|
53
49
|
|
54
|
-
-
|
55
|
-
-
|
50
|
+
- Wrap the breadcrumb in a `<nav>` element so assistive technologies can present the breadcrumb as a navigational element on the page.
|
51
|
+
- Provide a descriptive `aria-label` on the `<nav>` element to identify the type of navigation.
|
56
52
|
|
57
53
|
```html
|
58
|
-
<nav aria-label="breadcrumb">
|
54
|
+
<nav aria-label="Category breadcrumb">
|
59
55
|
<ol daff-breadcrumb>
|
56
|
+
<li daffBreadcrumbItem>
|
57
|
+
<a routerLink="/">Home</a>
|
58
|
+
</li>
|
59
|
+
<li daffBreadcrumbItem>
|
60
|
+
<span>Current Page</span>
|
61
|
+
</li>
|
60
62
|
</ol>
|
61
63
|
</nav>
|
62
64
|
```
|
@@ -2,6 +2,21 @@ import { QueryList, AfterContentInit, DestroyRef } from '@angular/core';
|
|
2
2
|
import { DaffBreadcrumbItemDirective } from '../breadcrumb-item/breadcrumb-item.directive';
|
3
3
|
import * as i0 from "@angular/core";
|
4
4
|
import * as i1 from "@daffodil/design";
|
5
|
+
/**
|
6
|
+
* Groups breadcrumb items. Must be applied to a native `<ol>` element.
|
7
|
+
*
|
8
|
+
* @example
|
9
|
+
* ```html
|
10
|
+
* <ol daff-breadcrumb>
|
11
|
+
* <li daffBreadcrumbItem>
|
12
|
+
* <a routerLink="/">Home</a>
|
13
|
+
* </li>
|
14
|
+
* <li daffBreacrumbItem>
|
15
|
+
* <span>Current page</span>
|
16
|
+
* </li>
|
17
|
+
* </ol>
|
18
|
+
* ```
|
19
|
+
*/
|
5
20
|
export declare class DaffBreadcrumbComponent implements AfterContentInit {
|
6
21
|
private destroyRef;
|
7
22
|
constructor(destroyRef: DestroyRef);
|
@@ -1,5 +1,15 @@
|
|
1
1
|
import { ChangeDetectorRef } from '@angular/core';
|
2
2
|
import * as i0 from "@angular/core";
|
3
|
+
/**
|
4
|
+
* Represents each individual breadcrumb item. Must be used on a `<li>` element.
|
5
|
+
*
|
6
|
+
* @example
|
7
|
+
* ```html
|
8
|
+
* <li daffBreadcrumbItem>
|
9
|
+
* <a routerLink="/">Link</a>
|
10
|
+
* </li>
|
11
|
+
* ```
|
12
|
+
*/
|
3
13
|
export declare class DaffBreadcrumbItemDirective {
|
4
14
|
private cdRef;
|
5
15
|
/**
|
package/button/README.md
CHANGED
@@ -1,55 +1,63 @@
|
|
1
1
|
# Button
|
2
|
-
Buttons
|
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
|
-
|
5
|
+
Button supports five variants that change its visual style, each applied as an attribute:
|
6
6
|
|
7
|
-
|
8
|
-
|
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
|
-
|
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
|
-
|
18
|
+
**Flat button**
|
22
19
|
<design-land-example-viewer-container example="flat-button"></design-land-example-viewer-container>
|
23
20
|
|
24
|
-
|
21
|
+
**Stroked button**
|
25
22
|
<design-land-example-viewer-container example="stroked-button"></design-land-example-viewer-container>
|
26
23
|
|
27
24
|
> `dark`, `light`, and `theme` should be used with caution to ensure that there is sufficient contrast.
|
28
25
|
|
29
|
-
|
26
|
+
**Icon button**
|
30
27
|
<design-land-example-viewer-container example="icon-button"></design-land-example-viewer-container>
|
31
28
|
|
32
29
|
> `dark`, `light`, and `theme` should be used with caution to ensure that there is sufficient contrast.
|
33
30
|
|
34
|
-
|
31
|
+
**Underline button**
|
35
32
|
<design-land-example-viewer-container example="underline-button"></design-land-example-viewer-container>
|
36
33
|
|
37
|
-
|
38
|
-
|
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.
|
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 {
|
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
|
-
|
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
|
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.
|
114
|
+
Use the `color` property to change the color of a button.
|
89
115
|
|
90
|
-
>
|
116
|
+
> Note: `dark`, `light`, and `theme` should be used on appropriate backgrounds for sufficient contrast.
|
91
117
|
|
92
118
|
## Status indicators
|
93
|
-
|
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
|
-
|
124
|
+
Add shadows to buttons with the `elevated` property.
|
99
125
|
|
100
|
-
|
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
|
-
|
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
|
-
-
|
117
|
-
-
|
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,18 +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
|
-
|
15
|
+
_suffix: DaffSuffixDirective;
|
16
|
+
constructor(size: DaffButtonSizableDirective);
|
15
17
|
/**
|
16
|
-
* Sets the tabindex.
|
18
|
+
* Sets the tabindex.
|
17
19
|
*/
|
18
20
|
tabindex: number;
|
19
21
|
private _disabled;
|
22
|
+
/**
|
23
|
+
* @docs-private
|
24
|
+
*/
|
25
|
+
get disabledClass(): any;
|
20
26
|
/**
|
21
27
|
* The disabled state of the button.
|
22
28
|
*/
|
package/button/button.d.ts
CHANGED
@@ -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];
|
package/button/public_api.d.ts
CHANGED
@@ -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';
|
@@ -42,7 +42,7 @@
|
|
42
42
|
|
43
43
|
.daff-raised-button {
|
44
44
|
@include daff-raised-button-theme-variant(
|
45
|
-
daff-
|
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-
|
79
|
+
daff-color($neutral, 30)
|
80
80
|
);
|
81
|
-
color: daff-
|
81
|
+
color: daff-color($neutral, 50);
|
82
82
|
|
83
83
|
&::after {
|
84
84
|
box-shadow: none;
|