@daffodil/design 0.90.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 +9 -6
- package/article/README.md +66 -46
- package/article/index.d.ts +41 -0
- package/article/src/article-theme.scss +22 -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 +27 -6
- package/button/src/button/basic/button-theme.scss +4 -2
- package/button/src/button/button-base.scss +29 -6
- package/button/src/button/icon/icon-theme.scss +10 -6
- package/button/src/button/raised/raised-theme.scss +6 -4
- package/callout/README.md +15 -27
- package/card/README.md +36 -69
- package/card/index.d.ts +7 -41
- package/card/src/card-base-theme.scss +2 -5
- package/card/src/card-base.scss +2 -2
- package/checkbox/README.md +0 -0
- package/checkbox/index.d.ts +177 -0
- package/container/README.md +18 -23
- package/fesm2022/daffodil-design-accordion.mjs +34 -25
- package/fesm2022/daffodil-design-accordion.mjs.map +1 -1
- package/fesm2022/daffodil-design-article.mjs +283 -17
- 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 +90 -45
- 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 +43 -90
- package/fesm2022/daffodil-design-card.mjs.map +1 -1
- package/fesm2022/daffodil-design-checkbox.mjs +317 -0
- package/fesm2022/daffodil-design-checkbox.mjs.map +1 -0
- package/fesm2022/daffodil-design-container.mjs +8 -8
- package/fesm2022/daffodil-design-container.mjs.map +1 -1
- package/fesm2022/daffodil-design-form-field.mjs +56 -86
- package/fesm2022/daffodil-design-form-field.mjs.map +1 -1
- package/fesm2022/daffodil-design-form.mjs +62 -0
- package/fesm2022/daffodil-design-form.mjs.map +1 -0
- package/fesm2022/daffodil-design-hero.mjs +23 -23
- package/fesm2022/daffodil-design-hero.mjs.map +1 -1
- package/fesm2022/daffodil-design-image.mjs +19 -11
- 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 +86 -83
- 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 +28 -64
- package/fesm2022/daffodil-design-notification.mjs.map +1 -1
- package/fesm2022/daffodil-design-paginator.mjs +11 -16
- 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 +19 -18
- package/fesm2022/daffodil-design-quantity-field.mjs.map +1 -1
- package/fesm2022/daffodil-design-radio.mjs +27 -56
- 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 +30 -60
- 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 +49 -106
- package/fesm2022/daffodil-design-switch.mjs.map +1 -1
- package/fesm2022/daffodil-design-tabs.mjs +35 -27
- 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 +79 -80
- package/fesm2022/daffodil-design-toast.mjs.map +1 -1
- package/fesm2022/daffodil-design-tree.mjs +152 -112
- 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 +559 -711
- package/fesm2022/daffodil-design.mjs.map +1 -1
- package/form/README.md +75 -0
- package/form/index.d.ts +27 -0
- package/form-field/README.md +74 -99
- package/form-field/index.d.ts +64 -42
- package/hero/README.md +5 -5
- package/image/README.md +27 -19
- package/image/index.d.ts +6 -1
- package/index.d.ts +282 -447
- package/input/README.md +36 -16
- 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 +107 -17
- package/modal/index.d.ts +72 -35
- package/native-select/README.md +52 -15
- 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/notification/index.d.ts +7 -38
- package/package.json +1 -1
- package/paginator/README.md +42 -6
- package/paginator/index.d.ts +5 -9
- 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/radio/index.d.ts +0 -16
- package/scss/layout/_breakpoint.scss +1 -1
- package/scss/theme.scss +9 -5
- package/scss/theming/_color-palettes.scss +19 -11
- package/scss/theming/_configure-theme.scss +11 -10
- package/scss/theming/_daff-theme.scss +5 -14
- package/scss/theming/_get-base-color.scss +2 -2
- package/scss/theming/_get-palette.scss +2 -2
- package/scss/theming/_get-theme-mode.scss +3 -3
- package/scss/theming/_index.scss +2 -1
- package/scss/theming/contrast/max-contrast/max-contrast.scss +3 -3
- package/scss/theming/contrast/text-contrast/text-contrast.scss +22 -16
- package/scss/theming/contrast/text-contrast/text-contrast.spec.scss +57 -0
- package/scss/theming/create-theme/_create-theme.scss +330 -0
- package/scss/theming/create-theme/_create-theme.spec.scss +122 -0
- package/scss/theming/create-theme/_index.scss +1 -0
- package/scss/theming/get-font-colors/_get-font-colors.scss +36 -0
- package/scss/theming/get-font-colors/_get-font-colors.spec.scss +72 -0
- package/scss/typography/mixins/_font-weight.scss +8 -14
- package/select/README.md +107 -4
- package/sidebar/README.md +6 -14
- package/sidebar/index.d.ts +3 -15
- 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 +21 -29
- package/switch/index.d.ts +18 -48
- package/switch/src/switch-theme.scss +26 -18
- package/tabs/README.md +1 -1
- package/tabs/index.d.ts +8 -5
- package/tag/README.md +24 -30
- package/tag/index.d.ts +1 -1
- package/tag/src/tag-theme.scss +11 -9
- package/text-snippet/README.md +1 -1
- package/text-snippet/src/text-snippet-theme.scss +12 -0
- package/textarea/README.md +36 -6
- 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 -96
- package/tree/src/tree-theme.scss +0 -4
- package/accordion/examples/index.d.ts +0 -20
- package/article/examples/index.d.ts +0 -50
- package/breadcrumb/examples/index.d.ts +0 -10
- package/button/examples/index.d.ts +0 -67
- package/callout/examples/index.d.ts +0 -41
- package/card/examples/index.d.ts +0 -62
- package/card/src/card/raised/raised-theme.scss +0 -28
- package/checkbox/examples/index.d.ts +0 -32
- package/container/examples/index.d.ts +0 -16
- package/fesm2022/daffodil-design-accordion-examples.mjs +0 -50
- package/fesm2022/daffodil-design-accordion-examples.mjs.map +0 -1
- package/fesm2022/daffodil-design-article-examples.mjs +0 -134
- package/fesm2022/daffodil-design-article-examples.mjs.map +0 -1
- package/fesm2022/daffodil-design-breadcrumb-examples.mjs +0 -46
- package/fesm2022/daffodil-design-breadcrumb-examples.mjs.map +0 -1
- package/fesm2022/daffodil-design-button-examples.mjs +0 -178
- package/fesm2022/daffodil-design-button-examples.mjs.map +0 -1
- package/fesm2022/daffodil-design-callout-examples.mjs +0 -116
- package/fesm2022/daffodil-design-callout-examples.mjs.map +0 -1
- package/fesm2022/daffodil-design-card-examples.mjs +0 -168
- package/fesm2022/daffodil-design-card-examples.mjs.map +0 -1
- package/fesm2022/daffodil-design-checkbox-examples.mjs +0 -76
- package/fesm2022/daffodil-design-checkbox-examples.mjs.map +0 -1
- package/fesm2022/daffodil-design-container-examples.mjs +0 -41
- package/fesm2022/daffodil-design-container-examples.mjs.map +0 -1
- package/fesm2022/daffodil-design-form-field-examples.mjs +0 -96
- package/fesm2022/daffodil-design-form-field-examples.mjs.map +0 -1
- package/fesm2022/daffodil-design-hero-examples.mjs +0 -121
- package/fesm2022/daffodil-design-hero-examples.mjs.map +0 -1
- package/fesm2022/daffodil-design-image-examples.mjs +0 -58
- package/fesm2022/daffodil-design-image-examples.mjs.map +0 -1
- package/fesm2022/daffodil-design-input-examples.mjs +0 -108
- package/fesm2022/daffodil-design-input-examples.mjs.map +0 -1
- package/fesm2022/daffodil-design-list-examples.mjs +0 -77
- package/fesm2022/daffodil-design-list-examples.mjs.map +0 -1
- package/fesm2022/daffodil-design-loading-icon-examples.mjs +0 -44
- package/fesm2022/daffodil-design-loading-icon-examples.mjs.map +0 -1
- package/fesm2022/daffodil-design-media-gallery-examples.mjs +0 -104
- package/fesm2022/daffodil-design-media-gallery-examples.mjs.map +0 -1
- package/fesm2022/daffodil-design-menu-examples.mjs +0 -50
- package/fesm2022/daffodil-design-menu-examples.mjs.map +0 -1
- package/fesm2022/daffodil-design-modal-examples.mjs +0 -51
- package/fesm2022/daffodil-design-modal-examples.mjs.map +0 -1
- package/fesm2022/daffodil-design-native-select-examples.mjs +0 -71
- package/fesm2022/daffodil-design-native-select-examples.mjs.map +0 -1
- package/fesm2022/daffodil-design-navbar-examples.mjs +0 -88
- package/fesm2022/daffodil-design-navbar-examples.mjs.map +0 -1
- package/fesm2022/daffodil-design-notification-examples.mjs +0 -102
- package/fesm2022/daffodil-design-notification-examples.mjs.map +0 -1
- package/fesm2022/daffodil-design-paginator-examples.mjs +0 -59
- package/fesm2022/daffodil-design-paginator-examples.mjs.map +0 -1
- package/fesm2022/daffodil-design-progress-bar-examples.mjs +0 -57
- package/fesm2022/daffodil-design-progress-bar-examples.mjs.map +0 -1
- package/fesm2022/daffodil-design-quantity-field-examples.mjs +0 -85
- package/fesm2022/daffodil-design-quantity-field-examples.mjs.map +0 -1
- package/fesm2022/daffodil-design-radio-examples.mjs +0 -34
- package/fesm2022/daffodil-design-radio-examples.mjs.map +0 -1
- package/fesm2022/daffodil-design-select-examples.mjs +0 -117
- package/fesm2022/daffodil-design-select-examples.mjs.map +0 -1
- package/fesm2022/daffodil-design-sidebar-examples.mjs +0 -109
- package/fesm2022/daffodil-design-sidebar-examples.mjs.map +0 -1
- package/fesm2022/daffodil-design-sticky-examples.mjs +0 -25
- package/fesm2022/daffodil-design-sticky-examples.mjs.map +0 -1
- package/fesm2022/daffodil-design-switch-examples.mjs +0 -110
- package/fesm2022/daffodil-design-switch-examples.mjs.map +0 -1
- package/fesm2022/daffodil-design-tabs-examples.mjs +0 -115
- package/fesm2022/daffodil-design-tabs-examples.mjs.map +0 -1
- package/fesm2022/daffodil-design-tag-examples.mjs +0 -125
- package/fesm2022/daffodil-design-tag-examples.mjs.map +0 -1
- package/fesm2022/daffodil-design-text-snippet-examples.mjs +0 -25
- package/fesm2022/daffodil-design-text-snippet-examples.mjs.map +0 -1
- package/fesm2022/daffodil-design-textarea-examples.mjs +0 -66
- package/fesm2022/daffodil-design-textarea-examples.mjs.map +0 -1
- package/fesm2022/daffodil-design-toast-examples.mjs +0 -147
- package/fesm2022/daffodil-design-toast-examples.mjs.map +0 -1
- package/fesm2022/daffodil-design-tree-examples.mjs +0 -104
- package/fesm2022/daffodil-design-tree-examples.mjs.map +0 -1
- package/form-field/examples/index.d.ts +0 -18
- package/hero/examples/index.d.ts +0 -45
- package/image/examples/index.d.ts +0 -10
- package/input/examples/index.d.ts +0 -10
- package/list/examples/index.d.ts +0 -29
- package/loading-icon/examples/index.d.ts +0 -16
- package/media-gallery/examples/index.d.ts +0 -38
- package/menu/examples/index.d.ts +0 -20
- package/modal/examples/index.d.ts +0 -15
- package/native-select/examples/index.d.ts +0 -10
- package/navbar/examples/index.d.ts +0 -31
- package/notification/examples/index.d.ts +0 -12
- package/paginator/examples/index.d.ts +0 -26
- package/progress-bar/examples/index.d.ts +0 -10
- package/quantity-field/examples/index.d.ts +0 -30
- package/radio/examples/index.d.ts +0 -13
- package/select/examples/index.d.ts +0 -28
- package/sidebar/examples/index.d.ts +0 -10
- package/sticky/examples/index.d.ts +0 -10
- package/switch/examples/index.d.ts +0 -46
- package/tabs/examples/index.d.ts +0 -12
- package/tag/examples/index.d.ts +0 -50
- package/text-snippet/examples/index.d.ts +0 -10
- package/textarea/examples/index.d.ts +0 -10
- package/toast/examples/index.d.ts +0 -56
- package/tree/examples/index.d.ts +0 -18
- /package/{form-field → form}/src/error-message/error-message-theme.scss +0 -0
- /package/{form-field → form}/src/hint/hint-theme.scss +0 -0
|
@@ -1,45 +1,53 @@
|
|
|
1
1
|
@use '../../scss/theming' as *;
|
|
2
2
|
|
|
3
|
+
// stylelint-disable selector-class-pattern
|
|
3
4
|
@mixin daff-switch-theme($theme) {
|
|
4
5
|
$primary: daff-get-palette($theme, primary);
|
|
5
6
|
$white: daff-get-base-color($theme, 'white');
|
|
6
7
|
$neutral: daff-get-palette($theme, neutral);
|
|
8
|
+
$base-contrast: daff-get-base-color($theme, base-contrast);
|
|
7
9
|
$mode: daff-get-theme-mode($theme);
|
|
8
10
|
|
|
9
11
|
.daff-switch {
|
|
10
|
-
|
|
11
|
-
border: 2px solid transparent;
|
|
12
|
+
$root: '.daff-switch';
|
|
12
13
|
|
|
13
|
-
|
|
14
|
+
&__label {
|
|
15
|
+
color: $base-contrast;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
&.checked {
|
|
19
|
+
#{$root}__toggle {
|
|
14
20
|
background-color: daff-color($primary);
|
|
15
21
|
}
|
|
22
|
+
}
|
|
16
23
|
|
|
17
|
-
|
|
24
|
+
@include light($mode) {
|
|
25
|
+
&__toggle {
|
|
18
26
|
background-color: daff-color($neutral, 30);
|
|
19
27
|
|
|
20
|
-
&:focus-within {
|
|
21
|
-
border: 2px solid daff-color($neutral, 20);
|
|
22
|
-
}
|
|
23
|
-
|
|
24
28
|
&::before {
|
|
25
29
|
background-color: $white;
|
|
26
30
|
}
|
|
27
|
-
}
|
|
28
31
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
border: 2px solid daff-color($neutral, 90);
|
|
32
|
+
&:focus {
|
|
33
|
+
&::after {
|
|
34
|
+
outline: 2px solid rgba($base-contrast, 0.08);
|
|
35
|
+
}
|
|
34
36
|
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
@include dark($mode) {
|
|
41
|
+
&__toggle {
|
|
42
|
+
background-color: daff-color($neutral, 70);
|
|
35
43
|
|
|
36
44
|
&::before {
|
|
37
|
-
background-color:
|
|
45
|
+
background-color: $white;
|
|
38
46
|
}
|
|
39
47
|
|
|
40
|
-
|
|
41
|
-
&::
|
|
42
|
-
|
|
48
|
+
&:focus {
|
|
49
|
+
&::after {
|
|
50
|
+
outline: 2px solid rgba($base-contrast, 0.15);
|
|
43
51
|
}
|
|
44
52
|
}
|
|
45
53
|
}
|
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 { 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,11 +23,14 @@ import { Params } from '@angular/router';
|
|
|
23
23
|
* </daff-tab>
|
|
24
24
|
* ```
|
|
25
25
|
*/
|
|
26
|
-
declare class DaffTabComponent {
|
|
26
|
+
declare class DaffTabComponent implements DaffDisableable {
|
|
27
|
+
private disabledDirective;
|
|
27
28
|
/**
|
|
29
|
+
* @docs-private
|
|
30
|
+
*
|
|
28
31
|
* Whether the tab is disabled.
|
|
29
32
|
*/
|
|
30
|
-
disabled: boolean;
|
|
33
|
+
get disabled(): boolean;
|
|
31
34
|
/**
|
|
32
35
|
* @docs-private
|
|
33
36
|
*/
|
|
@@ -45,9 +48,9 @@ declare class DaffTabComponent {
|
|
|
45
48
|
* @docs-private
|
|
46
49
|
*/
|
|
47
50
|
panelId: string;
|
|
48
|
-
constructor();
|
|
51
|
+
constructor(disabledDirective: DaffDisableableDirective);
|
|
49
52
|
static ɵfac: i0.ɵɵFactoryDeclaration<DaffTabComponent, never>;
|
|
50
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<DaffTabComponent, "daff-tab", never, { "
|
|
53
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<DaffTabComponent, "daff-tab", never, { "id": { "alias": "id"; "required": false; }; }, {}, never, ["daff-tab-label", "daff-tab-panel"], true, [{ directive: typeof i1.DaffDisableableDirective; inputs: { "disabled": "disabled"; }; outputs: {}; }]>;
|
|
51
54
|
}
|
|
52
55
|
|
|
53
56
|
/**
|
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/tag/src/tag-theme.scss
CHANGED
|
@@ -9,12 +9,14 @@
|
|
|
9
9
|
$critical: daff-get-palette($theme, critical);
|
|
10
10
|
$success: daff-get-palette($theme, success);
|
|
11
11
|
$neutral: daff-get-palette($theme, neutral);
|
|
12
|
+
$black: daff-get-base-color($theme, 'black');
|
|
13
|
+
$white: daff-get-base-color($theme, 'white');
|
|
12
14
|
$mode: daff-get-theme-mode($theme);
|
|
13
15
|
|
|
14
16
|
.daff-tag {
|
|
15
17
|
@include light($mode) {
|
|
16
18
|
background: daff-color($neutral, 20);
|
|
17
|
-
color:
|
|
19
|
+
color: $black;
|
|
18
20
|
|
|
19
21
|
&.daff-primary {
|
|
20
22
|
background: daff-color($primary, 10);
|
|
@@ -42,13 +44,13 @@
|
|
|
42
44
|
}
|
|
43
45
|
|
|
44
46
|
&.daff-theme {
|
|
45
|
-
background:
|
|
46
|
-
color:
|
|
47
|
+
background: $white;
|
|
48
|
+
color: $black;
|
|
47
49
|
}
|
|
48
50
|
|
|
49
51
|
&.daff-theme-contrast {
|
|
50
|
-
background:
|
|
51
|
-
color:
|
|
52
|
+
background: $black;
|
|
53
|
+
color: $white;
|
|
52
54
|
}
|
|
53
55
|
|
|
54
56
|
&.daff-warn {
|
|
@@ -102,13 +104,13 @@
|
|
|
102
104
|
}
|
|
103
105
|
|
|
104
106
|
&.daff-theme {
|
|
105
|
-
background:
|
|
106
|
-
color:
|
|
107
|
+
background: $black;
|
|
108
|
+
color: $white;
|
|
107
109
|
}
|
|
108
110
|
|
|
109
111
|
&.daff-theme-contrast {
|
|
110
|
-
background:
|
|
111
|
-
color:
|
|
112
|
+
background: $white;
|
|
113
|
+
color: $black;
|
|
112
114
|
}
|
|
113
115
|
|
|
114
116
|
&.daff-warn {
|
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
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
# Textarea
|
|
2
|
-
Textarea
|
|
2
|
+
Textarea works alongside the HTML textarea element, with additional custom styling and functionality.
|
|
3
3
|
|
|
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:
|
|
@@ -22,7 +22,37 @@ import { DaffTextareaComponent } from '@daffodil/design/textarea';
|
|
|
22
22
|
export class CustomComponent {}
|
|
23
23
|
```
|
|
24
24
|
|
|
25
|
-
##
|
|
25
|
+
## Anatomy
|
|
26
|
+
Textarea must be used inside `<daff-form-field>` to enable proper state management and provide enhanced UI features such as hints, error messages, prefixes, and suffixes. The form field component also ensures accessibility compliance. For more details, see the [form field documentation](/libs/design/form-field/README.md).
|
|
26
27
|
|
|
27
|
-
###
|
|
28
|
-
|
|
28
|
+
### Basic structure
|
|
29
|
+
```html
|
|
30
|
+
<daff-form-field>
|
|
31
|
+
<daff-form-label>Comments</daff-form-label>
|
|
32
|
+
<textarea daff-textarea name="comments"></textarea>
|
|
33
|
+
</daff-form-field>
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## States
|
|
37
|
+
|
|
38
|
+
### Disabled
|
|
39
|
+
Textarea can be disabled in two ways: using Angular's reactive forms with `FormControl` or with the native HTML `disabled` attribute.
|
|
40
|
+
|
|
41
|
+
<daff-docs-example-viewer example="textarea-disabled"></daff-docs-example-viewer>
|
|
42
|
+
|
|
43
|
+
### Error
|
|
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
|
+
|
|
46
|
+
<daff-docs-example-viewer example="textarea-error"></daff-docs-example-viewer>
|
|
47
|
+
|
|
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
|
+
|
|
50
|
+
## Hints
|
|
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
|
+
|
|
53
|
+
<daff-docs-example-viewer example="textarea-hint"></daff-docs-example-viewer>
|
|
54
|
+
|
|
55
|
+
## Accessibility
|
|
56
|
+
When `<daff-form-label>` is used within `<daff-form-field>`, the label automatically associates with the textarea using the `for` and `id` attributes.
|
|
57
|
+
|
|
58
|
+
If a `<daff-form-label>` is not specified, use the `<label>` element to associate text with form elements explicitly. The `for` attribute of the label must exactly match the `id` of the form control.
|
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
|