@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
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import * as i1 from '@daffodil/design';
|
|
3
|
+
import { DaffSizableDirective, DaffSizeAllType } from '@daffodil/design';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Labels are used to describe the loading state and provide context for users.
|
|
7
|
+
* They are optional.
|
|
8
|
+
*
|
|
9
|
+
* @usage
|
|
10
|
+
* ```html
|
|
11
|
+
* <daff-spinner-label>Loading</daff-spinner-label>
|
|
12
|
+
* ```
|
|
13
|
+
*/
|
|
14
|
+
declare class DaffSpinnerLabelDirective {
|
|
15
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DaffSpinnerLabelDirective, never>;
|
|
16
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<DaffSpinnerLabelDirective, "daff-spinner-label", never, {}, {}, never, never, true, never>;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* DaffSpinnerComponent is an animated indicator that lets users know content or action is being loaded.
|
|
21
|
+
*/
|
|
22
|
+
declare class DaffSpinnerComponent {
|
|
23
|
+
private sizable;
|
|
24
|
+
/**
|
|
25
|
+
* @docs-private
|
|
26
|
+
*/
|
|
27
|
+
_label: DaffSpinnerLabelDirective;
|
|
28
|
+
private static readonly SIZE_MAP;
|
|
29
|
+
/**
|
|
30
|
+
* The `aria-label` for the spinner. Defaults to "loading".
|
|
31
|
+
*/
|
|
32
|
+
ariaLabel: i0.InputSignal<string>;
|
|
33
|
+
/**
|
|
34
|
+
* @docs-private
|
|
35
|
+
*/
|
|
36
|
+
get _ariaLabel(): string;
|
|
37
|
+
/**
|
|
38
|
+
* @docs-private
|
|
39
|
+
*
|
|
40
|
+
* The dimension (width/height) based on the size.
|
|
41
|
+
*/
|
|
42
|
+
get dimension(): number;
|
|
43
|
+
constructor(sizable: DaffSizableDirective<DaffSizeAllType>);
|
|
44
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DaffSpinnerComponent, never>;
|
|
45
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<DaffSpinnerComponent, "daff-spinner", never, { "ariaLabel": { "alias": "aria-label"; "required": false; "isSignal": true; }; }, {}, ["_label"], ["daff-spinner-label"], true, [{ directive: typeof i1.DaffColorableDirective; inputs: { "color": "color"; }; outputs: {}; }, { directive: typeof i1.DaffSizableDirective; inputs: { "size": "size"; }; outputs: {}; }]>;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* @docs-private
|
|
50
|
+
*/
|
|
51
|
+
declare const DAFF_SPINNER_COMPONENTS: readonly [typeof DaffSpinnerComponent, typeof DaffSpinnerLabelDirective];
|
|
52
|
+
|
|
53
|
+
export { DAFF_SPINNER_COMPONENTS, DaffSpinnerComponent, DaffSpinnerLabelDirective };
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
@use '../../scss/theming' as *;
|
|
2
|
+
|
|
3
|
+
@mixin daff-spinner-light-variant($loader-color) {
|
|
4
|
+
.daff-spinner__track,
|
|
5
|
+
.daff-spinner__path {
|
|
6
|
+
stroke: $loader-color;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.daff-spinner__path {
|
|
10
|
+
stroke: $loader-color;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
@mixin daff-spinner-dark-variant($loader-color) {
|
|
15
|
+
.daff-spinner__track {
|
|
16
|
+
stroke: $loader-color;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.daff-spinner__path {
|
|
20
|
+
stroke: $loader-color;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
@mixin daff-spinner-theme($theme) {
|
|
25
|
+
$primary: daff-get-palette($theme, primary);
|
|
26
|
+
$secondary: daff-get-palette($theme, secondary);
|
|
27
|
+
$tertiary: daff-get-palette($theme, tertiary);
|
|
28
|
+
$base: daff-get-base-color($theme, base);
|
|
29
|
+
$base-contrast: daff-get-base-color($theme, base-contrast);
|
|
30
|
+
$white: daff-get-base-color($theme, 'white');
|
|
31
|
+
$black: daff-get-base-color($theme, 'black');
|
|
32
|
+
|
|
33
|
+
.daff-spinner {
|
|
34
|
+
&.daff-primary {
|
|
35
|
+
@include daff-spinner-light-variant(daff-color($primary));
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
&.daff-secondary {
|
|
39
|
+
@include daff-spinner-light-variant(daff-color($secondary));
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
&.daff-tertiary {
|
|
43
|
+
@include daff-spinner-light-variant(daff-color($tertiary));
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
&.daff-theme {
|
|
47
|
+
@include daff-spinner-light-variant($base);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
&.daff-theme-contrast {
|
|
51
|
+
@include daff-spinner-light-variant($base-contrast);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
&.daff-dark {
|
|
55
|
+
@include daff-spinner-light-variant($black);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
&.daff-light {
|
|
59
|
+
@include daff-spinner-light-variant($white);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
package/switch/README.md
CHANGED
|
@@ -4,7 +4,7 @@ A switch allows users to toggle the state of a single setting.
|
|
|
4
4
|
## Overview
|
|
5
5
|
Switches provide a way to toggle between two states with a visual indicator of the current state. A label can be positioned on the left, right, top, or bottom of the switch. The switch can be set to a disabled state, display a loading indicator, or show a custom error message.
|
|
6
6
|
|
|
7
|
-
<
|
|
7
|
+
<daff-docs-example-viewer example="basic-switch"></daff-docs-example-viewer>
|
|
8
8
|
|
|
9
9
|
## Usage
|
|
10
10
|
|
|
@@ -27,17 +27,17 @@ export class CustomComponent {}
|
|
|
27
27
|
## Sizes
|
|
28
28
|
A small switch variant is available for dense layouts. Use the `size="sm"` property to render a more compact version of a switch.
|
|
29
29
|
|
|
30
|
-
<
|
|
30
|
+
<daff-docs-example-viewer example="switch-sizes"></daff-docs-example-viewer>
|
|
31
31
|
|
|
32
32
|
## Disable a switch
|
|
33
33
|
Use the `disabled` property on switch to make it non-interactive.
|
|
34
34
|
|
|
35
|
-
<
|
|
35
|
+
<daff-docs-example-viewer example="disabled-switch"></daff-docs-example-viewer>
|
|
36
36
|
|
|
37
37
|
## Label positions
|
|
38
38
|
Use the `labelPosition` property to control the visual relationship between the switch and its label. By default, labels appear to the left of the switch control.
|
|
39
39
|
|
|
40
|
-
<
|
|
40
|
+
<daff-docs-example-viewer example="switch-label-positions"></daff-docs-example-viewer>
|
|
41
41
|
|
|
42
42
|
## Accessibility
|
|
43
43
|
Switch follows the [ARIA Switch design pattern](https://www.w3.org/WAI/ARIA/apg/patterns/switch/).
|
package/switch/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { EventEmitter } from '@angular/core';
|
|
3
3
|
import * as i1 from '@daffodil/design';
|
|
4
|
-
import { DaffSizableDirective, DaffSizeSmallType, DaffDisableableDirective } from '@daffodil/design';
|
|
4
|
+
import { DaffSizableDirective, DaffSizeSmallType, DaffDisableable, DaffDisableableDirective } from '@daffodil/design';
|
|
5
5
|
|
|
6
6
|
type DaffSwitchLabelPosition = 'left' | 'right' | 'top' | 'bottom';
|
|
7
7
|
|
|
@@ -13,7 +13,7 @@ type DaffSwitchSize = DaffSizeSmallType;
|
|
|
13
13
|
* <daff-switch>Label</daff-switch>
|
|
14
14
|
* ```
|
|
15
15
|
*/
|
|
16
|
-
declare class DaffSwitchComponent extends DaffSizableDirective<DaffSwitchSize> {
|
|
16
|
+
declare class DaffSwitchComponent extends DaffSizableDirective<DaffSwitchSize> implements DaffDisableable {
|
|
17
17
|
private disabledDirective;
|
|
18
18
|
/**
|
|
19
19
|
* The position of the label relative to the switch.
|
package/tabs/README.md
CHANGED
|
@@ -4,7 +4,7 @@ Tabs provide a way to navigate between panels that display related content witho
|
|
|
4
4
|
## Overview
|
|
5
5
|
Tabs help organize related content into manageable sections, making it easier for users to find and focus on specific information. They're particularly useful for displaying content in compact spaces, such as within [modals](/libs/design/modal/README.md) or [cards](/libs/design/card/README.md), allowing users to switch between sections without navigating away from the current view.
|
|
6
6
|
|
|
7
|
-
<
|
|
7
|
+
<daff-docs-example-viewer example="basic-tabs"></daff-docs-example-viewer>
|
|
8
8
|
|
|
9
9
|
## Best practices
|
|
10
10
|
|
package/tabs/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { TemplateRef, ElementRef, AfterContentInit, OnInit, EventEmitter, QueryList, ChangeDetectorRef } from '@angular/core';
|
|
3
3
|
import * as i1 from '@daffodil/design';
|
|
4
|
-
import { DaffDisableableDirective, DaffPrefixDirective, DaffSuffixDirective, DaffSelectableDirective } from '@daffodil/design';
|
|
4
|
+
import { DaffDisableable, DaffDisableableDirective, DaffPrefixDirective, DaffSuffixDirective, DaffSelectableDirective } from '@daffodil/design';
|
|
5
5
|
import { Location } from '@angular/common';
|
|
6
6
|
import { Params } from '@angular/router';
|
|
7
7
|
|
|
@@ -23,7 +23,7 @@ import { Params } from '@angular/router';
|
|
|
23
23
|
* </daff-tab>
|
|
24
24
|
* ```
|
|
25
25
|
*/
|
|
26
|
-
declare class DaffTabComponent {
|
|
26
|
+
declare class DaffTabComponent implements DaffDisableable {
|
|
27
27
|
private disabledDirective;
|
|
28
28
|
/**
|
|
29
29
|
* @docs-private
|
package/tag/README.md
CHANGED
|
@@ -1,20 +1,12 @@
|
|
|
1
1
|
# Tag
|
|
2
|
-
Tags are compact visual indicators used to display short pieces of information
|
|
2
|
+
Tags are compact visual indicators used to display short pieces of information such as status, categories, or labels.
|
|
3
3
|
|
|
4
4
|
## Overview
|
|
5
5
|
Tag supports flexible content projection to allow for various combinations of icons, labels, and interactive elements within a consistent container.
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
| --------- | ----------- |
|
|
9
|
-
| `daff-tag` | Flexible tag container that can contain an icon, a label, and a dismiss button |
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
**Basic tag**
|
|
13
|
-
<design-land-example-viewer-container example="basic-tag"></design-land-example-viewer-container>
|
|
7
|
+
<daff-docs-example-viewer example="basic-tag"></daff-docs-example-viewer>
|
|
14
8
|
|
|
15
9
|
## Usage
|
|
16
|
-
|
|
17
|
-
### Within a standalone component
|
|
18
10
|
To use tag in a standalone component, import `DAFF_TAG_COMPONENTS` directly into your custom component.
|
|
19
11
|
|
|
20
12
|
```ts
|
|
@@ -31,10 +23,10 @@ export class CustomComponent {}
|
|
|
31
23
|
```
|
|
32
24
|
|
|
33
25
|
## Anatomy
|
|
34
|
-
Tags should always
|
|
26
|
+
Tags should always include a text label unless the icon is universally understood and accessible.
|
|
35
27
|
|
|
36
|
-
### Icon
|
|
37
|
-
|
|
28
|
+
### Icon
|
|
29
|
+
Use the `[daffPrefix]` element to display a leading visual icon for a tag.
|
|
38
30
|
|
|
39
31
|
```html
|
|
40
32
|
<daff-tag>
|
|
@@ -43,45 +35,47 @@ An icon can be rendered within the tag using the `daffPrefix` directive.
|
|
|
43
35
|
</daff-tag>
|
|
44
36
|
```
|
|
45
37
|
|
|
46
|
-
|
|
47
|
-
|
|
38
|
+
## Features
|
|
39
|
+
|
|
40
|
+
### Dismissible tag
|
|
41
|
+
Set `dismissible` to `true` to display a close button. The button emits a `closeTag` event when clicked.
|
|
48
42
|
|
|
49
43
|
```html
|
|
50
|
-
<daff-tag dismissible (closeTag)="onCloseTag()">
|
|
44
|
+
<daff-tag [dismissible]="true" (closeTag)="onCloseTag()">
|
|
51
45
|
<fa-icon [icon]="faCircleCheck" daffPrefix></fa-icon>
|
|
52
46
|
<div>Tag label</div>
|
|
53
47
|
</daff-tag>
|
|
54
48
|
```
|
|
55
49
|
|
|
56
|
-
### Disabled
|
|
57
|
-
|
|
50
|
+
### Disabled
|
|
51
|
+
Set `disabled` to `true` to disable the tag. Disabled tags cannot be dismissed.
|
|
58
52
|
|
|
59
53
|
```html
|
|
60
|
-
<daff-tag
|
|
54
|
+
<daff-tag [disabled]="true">
|
|
61
55
|
<fa-icon [icon]="faCircleCheck" daffPrefix></fa-icon>
|
|
62
56
|
<div>Disabled tag</div>
|
|
63
57
|
</daff-tag>
|
|
64
58
|
```
|
|
65
59
|
|
|
66
60
|
## Sizes
|
|
67
|
-
Use the `size` property to control tag dimensions.
|
|
61
|
+
Use the `size` property to control tag dimensions. Supported sizes: `sm`, `md` (default), `lg`.
|
|
68
62
|
|
|
69
|
-
<
|
|
63
|
+
<daff-docs-example-viewer example="sizable-tag"></daff-docs-example-viewer>
|
|
70
64
|
|
|
71
65
|
## Colors
|
|
72
66
|
Use the `color` property to change the color of a tag. Supported colors: `primary`, `secondary`, `tertiary`, `dark`, `light`, `theme`, `theme-contrast`.
|
|
73
67
|
|
|
74
|
-
>
|
|
75
|
-
|
|
76
|
-
<design-land-example-viewer-container example="colorable-tag"></design-land-example-viewer-container>
|
|
68
|
+
<daff-docs-example-viewer example="colorable-tag"></daff-docs-example-viewer>
|
|
77
69
|
|
|
78
|
-
## Status
|
|
79
|
-
|
|
70
|
+
## Status
|
|
71
|
+
Use the `status` property to convey semantic meaning. Supported statuses: `warn`, `critical`, `info`, `success`.
|
|
80
72
|
|
|
81
|
-
<
|
|
73
|
+
<daff-docs-example-viewer example="statusable-tag"></daff-docs-example-viewer>
|
|
82
74
|
|
|
83
75
|
## Accessibility
|
|
84
|
-
|
|
76
|
+
No additional accessibility annotations are needed.
|
|
77
|
+
|
|
78
|
+
### Keyboard interactions
|
|
79
|
+
Default tags are not interactive and do not receive focus.
|
|
85
80
|
|
|
86
|
-
|
|
87
|
-
- Use appropriate contrast ratios for text and background colors
|
|
81
|
+
Dismissible tags include a focusable close button that can be activated with `Enter` or `Space`.
|
package/tag/index.d.ts
CHANGED
|
@@ -18,7 +18,7 @@ declare class DaffTagSizableDirective extends DaffSizableDirective<DaffTagSize>
|
|
|
18
18
|
*
|
|
19
19
|
* @example
|
|
20
20
|
* ```html
|
|
21
|
-
* <daff-tag dismissible (closeTag)="onCloseTag()">
|
|
21
|
+
* <daff-tag [dismissible]="true" (closeTag)="onCloseTag()">
|
|
22
22
|
* <fa-icon daffPrefix [icon]="faCircleCheck"></fa-icon>
|
|
23
23
|
* <div>Label</div>
|
|
24
24
|
* </daff-tag>
|
package/text-snippet/README.md
CHANGED
|
@@ -4,7 +4,7 @@ A text snippet is used to display a section of text with the ability to show or
|
|
|
4
4
|
## Overview
|
|
5
5
|
Text snippets provide a way to show previews of long content while allowing users to expand and read the full text when needed. They help condense screen space by truncating long text blocks such as product descriptions, reviews, or articles. By default, content is displayed in condensed mode with a toggle button to expand or collapse the full text.
|
|
6
6
|
|
|
7
|
-
<
|
|
7
|
+
<daff-docs-example-viewer example="basic-text-snippet"></daff-docs-example-viewer>
|
|
8
8
|
|
|
9
9
|
## Best practices
|
|
10
10
|
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
@use '../../scss/theming' as *;
|
|
2
|
+
|
|
3
|
+
@mixin daff-text-snippet-theme($theme) {
|
|
4
|
+
$base-contrast: daff-get-base-color($theme, base-contrast);
|
|
5
|
+
|
|
6
|
+
.daff-text-snippet {
|
|
7
|
+
&__toggle {
|
|
8
|
+
border-bottom: thin solid $base-contrast;
|
|
9
|
+
color: $base-contrast;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
}
|
package/textarea/README.md
CHANGED
|
@@ -4,7 +4,7 @@ Textarea works alongside the HTML textarea element, with additional custom styli
|
|
|
4
4
|
## Overview
|
|
5
5
|
Textarea has the same functionality as a native HTML textarea element, with additional custom styling and functionality. It **cannot** be used by itself and must be contained within a [form field](/libs/design/src/atoms/form/form-field/README.md).
|
|
6
6
|
|
|
7
|
-
<
|
|
7
|
+
<daff-docs-example-viewer example="basic-textarea"></daff-docs-example-viewer>
|
|
8
8
|
|
|
9
9
|
## Usage
|
|
10
10
|
To use textarea, import `DaffTextareaComponent` directly into your custom component:
|
|
@@ -38,19 +38,19 @@ Textarea must be used inside `<daff-form-field>` to enable proper state manageme
|
|
|
38
38
|
### Disabled
|
|
39
39
|
Textarea can be disabled in two ways: using Angular's reactive forms with `FormControl` or with the native HTML `disabled` attribute.
|
|
40
40
|
|
|
41
|
-
<
|
|
41
|
+
<daff-docs-example-viewer example="textarea-disabled"></daff-docs-example-viewer>
|
|
42
42
|
|
|
43
43
|
### Error
|
|
44
44
|
Textarea supports validation and error messages through Angular's form validation system. Use `<daff-error-message>` within the form field to display context-specific error messages. Error messages automatically appear when the textarea is invalid and has been touched or submitted.
|
|
45
45
|
|
|
46
|
-
<
|
|
46
|
+
<daff-docs-example-viewer example="textarea-error"></daff-docs-example-viewer>
|
|
47
47
|
|
|
48
48
|
Multiple error messages can be displayed conditionally based on the type of validation error. The form field component handles the styling and positioning of error messages.
|
|
49
49
|
|
|
50
50
|
## Hints
|
|
51
51
|
Hints provide additional context or instructions to help users complete the textarea field correctly. Use `<daff-hint>` within the form field to display helpful information below the textarea. Unlike error messages, hints are always visible and provide guidance rather than validation feedback.
|
|
52
52
|
|
|
53
|
-
<
|
|
53
|
+
<daff-docs-example-viewer example="textarea-hint"></daff-docs-example-viewer>
|
|
54
54
|
|
|
55
55
|
## Accessibility
|
|
56
56
|
When `<daff-form-label>` is used within `<daff-form-field>`, the label automatically associates with the textarea using the `for` and `id` attributes.
|
package/textarea/index.d.ts
CHANGED
|
@@ -24,16 +24,16 @@ declare class DaffTextareaComponent extends DaffFormFieldControl<string> impleme
|
|
|
24
24
|
* @docs-private
|
|
25
25
|
*/
|
|
26
26
|
get internalId(): string;
|
|
27
|
-
/**
|
|
28
|
-
* @docs-private
|
|
29
|
-
*/
|
|
30
|
-
get disabledAttribute(): true;
|
|
31
27
|
/**
|
|
32
28
|
* @docs-private
|
|
33
29
|
*
|
|
34
30
|
* Implemented as part of DaffFormFieldControl.
|
|
35
31
|
*/
|
|
36
32
|
disabled: boolean;
|
|
33
|
+
/**
|
|
34
|
+
* @docs-private
|
|
35
|
+
*/
|
|
36
|
+
get disabledAttribute(): boolean;
|
|
37
37
|
private _required;
|
|
38
38
|
/**
|
|
39
39
|
* @docs-private
|
package/toast/README.md
CHANGED
|
@@ -6,7 +6,7 @@ Toasts communicate updates about actions or events that require attention but ar
|
|
|
6
6
|
|
|
7
7
|
For short messages tied to page-level content or actions, use the [Notification](/libs/design/notification/README.md) component.
|
|
8
8
|
|
|
9
|
-
<
|
|
9
|
+
<daff-docs-example-viewer example="default-toast"></daff-docs-example-viewer>
|
|
10
10
|
|
|
11
11
|
## Usage
|
|
12
12
|
Add `provideDaffToast()` to the root provider of your application to enable toast functionality:
|
|
@@ -58,14 +58,14 @@ By default, toasts without actions dismiss automatically after `5000ms`. Toasts
|
|
|
58
58
|
|
|
59
59
|
> Actionable toasts should remain persistent. If a duration is required, make sure it is long enough for users to engage with the actions.
|
|
60
60
|
|
|
61
|
-
<
|
|
61
|
+
<daff-docs-example-viewer example="toast-with-custom-duration"></daff-docs-example-viewer>
|
|
62
62
|
|
|
63
63
|
### Close button
|
|
64
64
|
The close button is hidden by default. When a toast contains actions, the `dismissible` property is ignored.
|
|
65
65
|
|
|
66
66
|
For non-actionable toasts, the close button can be displayed by setting `dismissible: true`.
|
|
67
67
|
|
|
68
|
-
<
|
|
68
|
+
<daff-docs-example-viewer example="dismissible-toast"></daff-docs-example-viewer>
|
|
69
69
|
|
|
70
70
|
## Stacking
|
|
71
71
|
A maximum of three toasts can be displayed at once. Toasts stack vertically with the most recent toast at the top.
|
|
@@ -73,7 +73,7 @@ A maximum of three toasts can be displayed at once. Toasts stack vertically with
|
|
|
73
73
|
## Statuses
|
|
74
74
|
Toast status can be set when opening a toast through the `DaffToastService` by using a `DaffStatus` value.
|
|
75
75
|
|
|
76
|
-
<
|
|
76
|
+
<daff-docs-example-viewer example="toast-status"></daff-docs-example-viewer>
|
|
77
77
|
|
|
78
78
|
## Positions
|
|
79
79
|
On desktop, toasts appear in the top-right corner by default.
|
package/tree/README.md
CHANGED
|
@@ -1,20 +1,15 @@
|
|
|
1
1
|
# Tree
|
|
2
|
-
Trees
|
|
2
|
+
Trees display hierarchical information in a nested, expandable format.
|
|
3
3
|
|
|
4
4
|
## Overview
|
|
5
|
-
|
|
5
|
+
Trees help users navigate complex structures by organizing content into parent and child relationships. They're commonly used for navigation menus, file browsers, and category lists. For flat lists without nested content, use the [navigation list](/libs/design/list/README.md) instead.
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
Generally, tree usage consists of taking existing tree data, converting it to the `DaffTreeData` format, setting the `tree` input on the `DaffTreeComponent`, and providing templates for the cases where the tree element has children or not.
|
|
10
|
-
|
|
11
|
-
<design-land-example-viewer-container example="basic-tree">
|
|
12
|
-
</design-land-example-viewer-container>
|
|
7
|
+
<daff-docs-example-viewer example="basic-tree"></daff-docs-example-viewer>
|
|
13
8
|
|
|
14
9
|
## Usage
|
|
15
10
|
|
|
16
11
|
### Within a standalone component
|
|
17
|
-
To use
|
|
12
|
+
To use tree in a standalone component, import `DAFF_TREE_COMPONENTS` directly into your custom component:
|
|
18
13
|
|
|
19
14
|
```ts
|
|
20
15
|
import { DAFF_TREE_COMPONENTS } from '@daffodil/design/tree';
|
|
@@ -30,7 +25,7 @@ export class CustomComponent {}
|
|
|
30
25
|
```
|
|
31
26
|
|
|
32
27
|
### Within a module (deprecated)
|
|
33
|
-
To use
|
|
28
|
+
To use tree in a module, import `DaffTreeModule` into your custom module:
|
|
34
29
|
|
|
35
30
|
```ts
|
|
36
31
|
import { NgModule } from '@angular/core';
|
|
@@ -38,7 +33,7 @@ import { DaffTreeModule } from '@daffodil/design/tree';
|
|
|
38
33
|
import { CustomComponent } from './custom.component';
|
|
39
34
|
|
|
40
35
|
@NgModule({
|
|
41
|
-
|
|
36
|
+
declarations: [
|
|
42
37
|
CustomComponent,
|
|
43
38
|
],
|
|
44
39
|
exports: [
|
|
@@ -51,23 +46,45 @@ import { CustomComponent } from './custom.component';
|
|
|
51
46
|
export class CustomComponentModule { }
|
|
52
47
|
```
|
|
53
48
|
|
|
49
|
+
> **Warning**
|
|
50
|
+
>
|
|
54
51
|
> This method is deprecated. It's recommended to update all custom components to standalone.
|
|
55
52
|
|
|
56
|
-
##
|
|
57
|
-
|
|
53
|
+
## Anatomy
|
|
54
|
+
A tree consists of the following parts:
|
|
58
55
|
|
|
59
|
-
|
|
56
|
+
### Container
|
|
57
|
+
`<daff-tree>`: The main wrapper that holds the tree and accepts your data.
|
|
60
58
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
59
|
+
### Node templates
|
|
60
|
+
Define how each tree item looks:
|
|
61
|
+
|
|
62
|
+
- `#daffTreeItemWithChildrenTpl`: For items that can expand to show children. Click handling and icons are added automatically.
|
|
63
|
+
- `#daffTreeItemTpl`: For items at the end of a branch with no children.
|
|
65
64
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
65
|
+
### Tree item
|
|
66
|
+
`[daffTreeItem]`: Added to links or buttons inside your templates to connect them to the tree.
|
|
67
|
+
|
|
68
|
+
### Basic structure
|
|
69
|
+
```html
|
|
70
|
+
<daff-tree [tree]="treeData">
|
|
71
|
+
<ng-template #daffTreeItemWithChildrenTpl let-node>
|
|
72
|
+
<button daffTreeItem [node]="node">{{ node.title }}</button>
|
|
73
|
+
</ng-template>
|
|
74
|
+
|
|
75
|
+
<ng-template #daffTreeItemTpl let-node>
|
|
76
|
+
<a daffTreeItem [node]="node" [routerLink]="node.url">{{ node.title }}</a>
|
|
77
|
+
</ng-template>
|
|
78
|
+
</daff-tree>
|
|
69
79
|
```
|
|
70
80
|
|
|
71
81
|
## Accessibility
|
|
82
|
+
The tree follows the [disclosure navigation menu](https://www.w3.org/WAI/ARIA/apg/patterns/disclosure/examples/disclosure-navigation/) pattern rather than the [tree view](https://www.w3.org/WAI/ARIA/apg/patterns/treeview/) pattern.
|
|
83
|
+
|
|
84
|
+
### Daffodil provides
|
|
85
|
+
- Unique `id` automatically assigned to each tree item
|
|
86
|
+
- `aria-expanded` indicating whether a parent item is open or closed
|
|
72
87
|
|
|
73
|
-
|
|
88
|
+
### Developer responsibilities
|
|
89
|
+
- Use links (`<a>`) for navigation and buttons (`<button>`) for expanding sections
|
|
90
|
+
- Write clear, descriptive text for each tree item
|