@daffodil/design 0.81.1 → 0.83.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 +44 -29
- package/accordion/accordion/accordion/accordion.component.d.ts +3 -0
- package/accordion/accordion/accordion-item/accordion-item.component.d.ts +23 -12
- package/accordion/accordion/accordion-item-title/accordion-item-title.directive.d.ts +3 -0
- package/accordion/accordion.d.ts +5 -0
- package/accordion/examples/disabled-accordion/disabled-accordion.component.d.ts +5 -0
- package/accordion/examples/initially-expanded-accordion/initially-expanded-accordion.component.d.ts +5 -0
- package/accordion/examples/public_api.d.ts +2 -0
- package/accordion/src/accordion-theme.scss +28 -6
- package/article/README.md +4 -3
- package/article/article.d.ts +3 -0
- package/article/src/article-theme.scss +128 -51
- package/breadcrumb/README.md +38 -28
- package/breadcrumb/breadcrumb/breadcrumb.component.d.ts +15 -2
- package/breadcrumb/breadcrumb-item/breadcrumb-item.directive.d.ts +18 -4
- package/breadcrumb/breadcrumb.d.ts +3 -0
- package/breadcrumb/examples/iterated-breadcrumb/iterated-breadcrumb.component.d.ts +6 -0
- package/breadcrumb/public_api.d.ts +2 -2
- package/button/README.md +43 -23
- package/button/button/basic/button.component.d.ts +5 -1
- package/button/button/button-base.directive.d.ts +11 -3
- package/button/button/button-sizable.directive.d.ts +1 -1
- package/button/button/raised/raised.component.d.ts +2 -0
- package/button/button/stroked/stroked.component.d.ts +5 -1
- package/button/button.d.ts +4 -2
- package/button/button.module.d.ts +1 -2
- package/button/examples/elevated-button/elevated-button.component.d.ts +6 -0
- package/button/examples/examples.d.ts +2 -1
- package/button/examples/public_api.d.ts +1 -0
- package/button/public_api.d.ts +0 -1
- package/button/src/button/basic/button-theme.scss +185 -80
- package/button/src/button/button-base.scss +41 -16
- package/button/src/button/flat/flat-theme.scss +144 -85
- package/button/src/button/icon/icon-theme.scss +183 -79
- package/button/src/button/raised/raised-theme.scss +2 -7
- package/button/src/button/stroked/stroked-theme.scss +128 -94
- package/button/src/button/underline/underline-theme.scss +112 -44
- package/callout/README.md +4 -3
- package/callout/callout.d.ts +3 -0
- package/card/README.md +6 -3
- package/card/card/basic/basic.component.d.ts +7 -0
- package/card/card/raised/raised.component.d.ts +7 -0
- package/card/card/stroked/stroked.component.d.ts +7 -0
- package/card/card-base.directive.d.ts +25 -0
- package/card/card.d.ts +18 -1
- package/card/card.module.d.ts +10 -8
- package/card/examples/card-theming/card-theming.component.d.ts +2 -1
- package/card/examples/public_api.d.ts +1 -1
- package/card/public_api.d.ts +6 -1
- package/card/src/card/raised/raised-theme.scss +30 -0
- package/card/src/card/stroked/stroked-theme.scss +135 -0
- package/card/src/card-base-theme.scss +197 -0
- package/card/src/card-base.scss +134 -0
- package/container/README.md +5 -3
- package/container/container.d.ts +3 -0
- package/core/colorable/colorable.d.ts +20 -14
- package/core/colorable/colorable.directive.d.ts +9 -6
- package/fesm2022/daffodil-design-accordion-examples.mjs +28 -4
- package/fesm2022/daffodil-design-accordion-examples.mjs.map +1 -1
- package/fesm2022/daffodil-design-accordion.mjs +56 -29
- package/fesm2022/daffodil-design-accordion.mjs.map +1 -1
- package/fesm2022/daffodil-design-article-examples.mjs +30 -30
- package/fesm2022/daffodil-design-article.mjs +14 -11
- package/fesm2022/daffodil-design-article.mjs.map +1 -1
- package/fesm2022/daffodil-design-breadcrumb-examples.mjs +24 -4
- package/fesm2022/daffodil-design-breadcrumb-examples.mjs.map +1 -1
- package/fesm2022/daffodil-design-breadcrumb.mjs +78 -40
- package/fesm2022/daffodil-design-breadcrumb.mjs.map +1 -1
- package/fesm2022/daffodil-design-button-examples.mjs +55 -33
- package/fesm2022/daffodil-design-button-examples.mjs.map +1 -1
- package/fesm2022/daffodil-design-button.mjs +79 -69
- package/fesm2022/daffodil-design-button.mjs.map +1 -1
- package/fesm2022/daffodil-design-callout-examples.mjs +12 -12
- package/fesm2022/daffodil-design-callout-examples.mjs.map +1 -1
- package/fesm2022/daffodil-design-callout.mjs +25 -22
- package/fesm2022/daffodil-design-callout.mjs.map +1 -1
- package/fesm2022/daffodil-design-card-examples.mjs +35 -31
- package/fesm2022/daffodil-design-card-examples.mjs.map +1 -1
- package/fesm2022/daffodil-design-card.mjs +140 -86
- package/fesm2022/daffodil-design-card.mjs.map +1 -1
- package/fesm2022/daffodil-design-checkbox-examples.mjs +6 -6
- package/fesm2022/daffodil-design-checkbox-examples.mjs.map +1 -1
- package/fesm2022/daffodil-design-container-examples.mjs +3 -3
- package/fesm2022/daffodil-design-container.mjs +10 -7
- package/fesm2022/daffodil-design-container.mjs.map +1 -1
- package/fesm2022/daffodil-design-hero-examples.mjs +12 -12
- package/fesm2022/daffodil-design-hero-examples.mjs.map +1 -1
- package/fesm2022/daffodil-design-hero.mjs +25 -22
- package/fesm2022/daffodil-design-hero.mjs.map +1 -1
- package/fesm2022/daffodil-design-image-examples.mjs +9 -9
- package/fesm2022/daffodil-design-image.mjs +36 -19
- package/fesm2022/daffodil-design-image.mjs.map +1 -1
- package/fesm2022/daffodil-design-input-examples.mjs +12 -12
- package/fesm2022/daffodil-design-link-set.mjs +19 -16
- package/fesm2022/daffodil-design-link-set.mjs.map +1 -1
- package/fesm2022/daffodil-design-list-examples.mjs +12 -12
- package/fesm2022/daffodil-design-list.mjs +13 -10
- package/fesm2022/daffodil-design-list.mjs.map +1 -1
- package/fesm2022/daffodil-design-loading-icon-examples.mjs +4 -4
- package/fesm2022/daffodil-design-loading-icon-examples.mjs.map +1 -1
- package/fesm2022/daffodil-design-loading-icon.mjs +11 -8
- package/fesm2022/daffodil-design-loading-icon.mjs.map +1 -1
- package/fesm2022/daffodil-design-media-gallery-examples.mjs +62 -13
- package/fesm2022/daffodil-design-media-gallery-examples.mjs.map +1 -1
- package/fesm2022/daffodil-design-media-gallery.mjs +204 -250
- package/fesm2022/daffodil-design-media-gallery.mjs.map +1 -1
- package/fesm2022/daffodil-design-menu-examples.mjs +6 -6
- package/fesm2022/daffodil-design-menu-examples.mjs.map +1 -1
- package/fesm2022/daffodil-design-menu.mjs +16 -16
- package/fesm2022/daffodil-design-modal-examples.mjs +7 -7
- package/fesm2022/daffodil-design-modal-examples.mjs.map +1 -1
- package/fesm2022/daffodil-design-modal.mjs +28 -25
- package/fesm2022/daffodil-design-modal.mjs.map +1 -1
- package/fesm2022/daffodil-design-navbar-examples.mjs +12 -12
- package/fesm2022/daffodil-design-navbar-examples.mjs.map +1 -1
- package/fesm2022/daffodil-design-navbar.mjs +10 -7
- package/fesm2022/daffodil-design-navbar.mjs.map +1 -1
- package/fesm2022/daffodil-design-notification-examples.mjs +17 -16
- package/fesm2022/daffodil-design-notification-examples.mjs.map +1 -1
- package/fesm2022/daffodil-design-notification.mjs +23 -20
- package/fesm2022/daffodil-design-notification.mjs.map +1 -1
- package/fesm2022/daffodil-design-paginator-examples.mjs +6 -6
- package/fesm2022/daffodil-design-paginator.mjs +13 -7
- package/fesm2022/daffodil-design-paginator.mjs.map +1 -1
- package/fesm2022/daffodil-design-progress-bar-examples.mjs +10 -10
- package/fesm2022/daffodil-design-progress-bar-examples.mjs.map +1 -1
- package/fesm2022/daffodil-design-progress-bar.mjs +13 -13
- package/fesm2022/daffodil-design-progress-bar.mjs.map +1 -1
- package/fesm2022/daffodil-design-quantity-field-examples.mjs +12 -12
- package/fesm2022/daffodil-design-radio-examples.mjs +3 -3
- package/fesm2022/daffodil-design-sidebar-examples.mjs +14 -14
- package/fesm2022/daffodil-design-sidebar-examples.mjs.map +1 -1
- package/fesm2022/daffodil-design-sidebar.mjs +150 -61
- package/fesm2022/daffodil-design-sidebar.mjs.map +1 -1
- package/fesm2022/daffodil-design-switch-examples.mjs +15 -15
- package/fesm2022/daffodil-design-switch-examples.mjs.map +1 -1
- package/fesm2022/daffodil-design-switch.mjs +38 -10
- package/fesm2022/daffodil-design-switch.mjs.map +1 -1
- package/fesm2022/daffodil-design-tabs-examples.mjs +23 -17
- package/fesm2022/daffodil-design-tabs-examples.mjs.map +1 -1
- package/fesm2022/daffodil-design-tabs.mjs +67 -35
- package/fesm2022/daffodil-design-tabs.mjs.map +1 -1
- package/fesm2022/daffodil-design-text-snippet-examples.mjs +3 -3
- package/fesm2022/daffodil-design-text-snippet.mjs +4 -5
- package/fesm2022/daffodil-design-text-snippet.mjs.map +1 -1
- package/fesm2022/daffodil-design-toast-examples.mjs +40 -15
- package/fesm2022/daffodil-design-toast-examples.mjs.map +1 -1
- package/fesm2022/daffodil-design-toast.mjs +296 -239
- package/fesm2022/daffodil-design-toast.mjs.map +1 -1
- package/fesm2022/daffodil-design-tree-examples.mjs +6 -6
- package/fesm2022/daffodil-design-tree.mjs +15 -12
- package/fesm2022/daffodil-design-tree.mjs.map +1 -1
- package/fesm2022/daffodil-design-youtube-player.mjs +104 -0
- package/fesm2022/daffodil-design-youtube-player.mjs.map +1 -0
- package/fesm2022/daffodil-design.mjs +167 -155
- package/fesm2022/daffodil-design.mjs.map +1 -1
- package/hero/README.md +4 -3
- package/hero/hero.d.ts +3 -0
- package/image/README.md +4 -3
- package/image/image/image.component.d.ts +22 -1
- package/image/image.d.ts +3 -0
- package/link-set/README.md +4 -3
- package/link-set/link-set.d.ts +3 -0
- package/list/README.md +4 -3
- package/list/list.d.ts +3 -0
- package/loading-icon/README.md +10 -7
- package/loading-icon/loading-icon.d.ts +3 -0
- package/loading-icon/src/loading-icon-theme.scss +66 -38
- package/media-gallery/README.md +19 -10
- package/media-gallery/examples/iterated-media-gallery/iterated-media-gallery.component.d.ts +13 -0
- package/media-gallery/examples/media-gallery-with-video/media-gallery-with-video.component.d.ts +5 -0
- package/media-gallery/examples/public_api.d.ts +2 -0
- package/media-gallery/helpers/media-gallery-registration.interface.d.ts +1 -1
- package/media-gallery/media-gallery/media-gallery.component.d.ts +89 -11
- package/media-gallery/media-gallery.d.ts +4 -2
- package/media-gallery/media-gallery.module.d.ts +1 -2
- package/media-gallery/public_api.d.ts +3 -4
- package/media-gallery/src/media-gallery-theme.scss +30 -4
- package/media-gallery/thumbnail/thumbnail.directive.d.ts +45 -22
- package/menu/README.md +1 -2
- package/modal/README.md +3 -2
- package/modal/modal.d.ts +3 -0
- package/navbar/README.md +3 -2
- package/navbar/navbar.d.ts +3 -0
- package/notification/README.md +5 -4
- package/notification/notification.d.ts +3 -0
- package/notification/src/notification-theme.scss +62 -23
- package/package.json +1 -1
- package/paginator/README.md +3 -2
- package/paginator/paginator/paginator.component.d.ts +3 -0
- package/paginator/paginator.d.ts +3 -0
- package/progress-bar/README.md +5 -6
- package/progress-bar/progress-bar.component.d.ts +0 -3
- package/progress-bar/progress-bar.d.ts +3 -0
- package/progress-bar/src/progress-bar-theme.scss +17 -8
- package/scss/theme.scss +36 -17
- package/scss/theming/_configure-theme.scss +2 -0
- package/scss/theming/_index.scss +1 -0
- package/scss/theming/_light-dark.scss +45 -0
- package/sidebar/README.md +20 -21
- package/sidebar/helper/sidebar-mode.d.ts +9 -15
- package/sidebar/public_api.d.ts +10 -11
- package/sidebar/sidebar/sidebar.component.d.ts +22 -7
- package/sidebar/sidebar-footer/sidebar-footer.component.d.ts +11 -0
- package/sidebar/sidebar-header/sidebar-header-title/sidebar-header-title.directive.d.ts +8 -0
- package/sidebar/sidebar-header/sidebar-header.component.d.ts +19 -1
- package/sidebar/sidebar-viewport/sidebar-viewport.component.d.ts +36 -15
- package/sidebar/sidebar-viewport-backdrop/sidebar-viewport-backdrop.component.d.ts +17 -0
- package/sidebar/sidebar.d.ts +4 -2
- package/sidebar/sidebar.module.d.ts +1 -2
- package/switch/README.md +3 -2
- package/switch/src/switch-theme.scss +29 -10
- package/switch/switch/switch.component.d.ts +31 -6
- package/switch/switch.d.ts +3 -0
- package/tabs/README.md +33 -3
- package/tabs/src/tabs-theme.scss +31 -13
- package/tabs/tabs/tab/tab.component.d.ts +1 -1
- package/tabs/tabs/tab-label/tab-label.component.d.ts +6 -0
- package/tabs/tabs/tab-panel/tab-panel.component.d.ts +8 -0
- package/tabs/tabs/tabs.component.d.ts +21 -4
- package/tabs/tabs.d.ts +8 -2
- package/text-snippet/README.md +19 -1
- package/toast/README.md +21 -151
- package/toast/examples/dismissible-toast/dismissible-toast.component.d.ts +11 -0
- package/toast/examples/public_api.d.ts +2 -1
- package/toast/interfaces/toast-action.d.ts +22 -11
- package/toast/interfaces/toast-action.type.d.ts +10 -0
- package/toast/interfaces/toast.d.ts +11 -5
- package/toast/options/daff-toast-options.d.ts +2 -1
- package/toast/public_api.d.ts +2 -6
- package/toast/service/position.service.d.ts +9 -1
- package/toast/service/toast.service.d.ts +63 -0
- package/toast/src/toast-theme.scss +80 -33
- package/toast/toast/toast-config.d.ts +24 -1
- package/toast/toast/toast-provider.d.ts +16 -0
- package/toast/toast/toast.component.d.ts +20 -1
- package/toast/toast-actions/toast-actions.directive.d.ts +3 -0
- package/toast/toast-message/toast-message.directive.d.ts +3 -0
- package/toast/toast-title/toast-title.directive.d.ts +3 -0
- package/tree/README.md +6 -10
- package/tree/src/tree-theme.scss +39 -13
- package/tree/tree.d.ts +3 -0
- package/youtube-player/index.d.ts +1 -0
- package/youtube-player/public_api.d.ts +3 -0
- package/youtube-player/safe-url.pipe.d.ts +10 -0
- package/youtube-player/youtube-player.component.d.ts +23 -0
- package/youtube-player/youtube-player.d.ts +6 -0
- package/card/card/card.component.d.ts +0 -48
- package/card/src/card-theme-variants/basic-card.scss +0 -6
- package/card/src/card-theme-variants/linkable-card.scss +0 -16
- package/card/src/card-theme-variants/stroked-card.scss +0 -3
- package/card/src/card-theme.scss +0 -170
- package/media-gallery/media-renderer/media-renderer.component.d.ts +0 -29
- package/media-gallery/registry/media-gallery.registry.d.ts +0 -34
- package/media-gallery/thumbnail/thumbnail-compat.token.d.ts +0 -1
- package/media-gallery/thumbnail/thumbnail-registration.interface.d.ts +0 -9
- package/scss/theming/prebuilt/internal-theme.scss +0 -13
- package/toast/toast.module.d.ts +0 -19
@@ -7,12 +7,11 @@ import * as i5 from "./sidebar-header/sidebar-header.component";
|
|
7
7
|
import * as i6 from "./sidebar-footer/sidebar-footer.component";
|
8
8
|
import * as i7 from "./sidebar-header/sidebar-header-title/sidebar-header-title.directive";
|
9
9
|
import * as i8 from "./sidebar-header/sidebar-header-action/sidebar-header-action.directive";
|
10
|
-
import * as i9 from "./sidebar-viewport-backdrop/sidebar-viewport-backdrop.component";
|
11
10
|
/**
|
12
11
|
* @deprecated in favor of {@link DAFF_SIDEBAR_COMPONENTS}. Deprecated in version 0.78.0. Will be removed in version 1.0.0.
|
13
12
|
*/
|
14
13
|
export declare class DaffSidebarModule {
|
15
14
|
static ɵfac: i0.ɵɵFactoryDeclaration<DaffSidebarModule, never>;
|
16
|
-
static ɵmod: i0.ɵɵNgModuleDeclaration<DaffSidebarModule, never, [typeof i1.CommonModule, typeof i2.A11yModule, typeof i3.DaffSidebarComponent, typeof i4.DaffSidebarViewportComponent, typeof i5.DaffSidebarHeaderComponent, typeof i6.DaffSidebarFooterComponent, typeof i7.DaffSidebarHeaderTitleDirective, typeof i8.DaffSidebarHeaderActionDirective
|
15
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<DaffSidebarModule, never, [typeof i1.CommonModule, typeof i2.A11yModule, typeof i3.DaffSidebarComponent, typeof i4.DaffSidebarViewportComponent, typeof i5.DaffSidebarHeaderComponent, typeof i6.DaffSidebarFooterComponent, typeof i7.DaffSidebarHeaderTitleDirective, typeof i8.DaffSidebarHeaderActionDirective], [typeof i3.DaffSidebarComponent, typeof i4.DaffSidebarViewportComponent, typeof i5.DaffSidebarHeaderComponent, typeof i6.DaffSidebarFooterComponent, typeof i7.DaffSidebarHeaderTitleDirective, typeof i8.DaffSidebarHeaderActionDirective]>;
|
17
16
|
static ɵinj: i0.ɵɵInjectorDeclaration<DaffSidebarModule>;
|
18
17
|
}
|
package/switch/README.md
CHANGED
@@ -7,13 +7,14 @@ Switches provide a way to toggle between two states with a visual indicator of t
|
|
7
7
|
## Usage
|
8
8
|
|
9
9
|
### Within a standalone component
|
10
|
-
To use a switch in a standalone component, import
|
10
|
+
To use a switch in a standalone component, import `DAFF_SWITCH_COMPONENTS` directly into your custom component:
|
11
11
|
|
12
12
|
```ts
|
13
|
+
import { DAFF_SWITCH_COMPONENTS } from '@daffodil/design/switch';
|
14
|
+
|
13
15
|
@Component({
|
14
16
|
selector: 'custom-component',
|
15
17
|
templateUrl: './custom-component.component.html',
|
16
|
-
standalone: true,
|
17
18
|
imports: [
|
18
19
|
DAFF_SWITCH_COMPONENTS,
|
19
20
|
],
|
@@ -4,27 +4,46 @@
|
|
4
4
|
|
5
5
|
@mixin daff-switch-theme($theme) {
|
6
6
|
$primary: core.daff-map-get($theme, primary);
|
7
|
-
$base: core.daff-map-get($theme, 'core', 'base');
|
8
|
-
$base-contrast: core.daff-map-get($theme, 'core', 'base-contrast');
|
9
7
|
$white: core.daff-map-get($theme, 'core', 'white');
|
10
|
-
$black: core.daff-map-get($theme, 'core', 'black');
|
11
8
|
$neutral: core.daff-map-get($theme, 'core', 'neutral');
|
9
|
+
$type: core.daff-map-get($theme, 'core', 'type');
|
12
10
|
|
13
11
|
.daff-switch {
|
14
12
|
&__toggle {
|
15
|
-
background-color: theming.daff-illuminate($base, $neutral, 3);
|
16
13
|
border: 2px solid transparent;
|
17
14
|
|
18
|
-
&:focus-within {
|
19
|
-
border: 2px solid theming.daff-illuminate($base, $neutral, 2);
|
20
|
-
}
|
21
|
-
|
22
15
|
&.daff-checked {
|
23
16
|
background-color: theming.daff-color($primary);
|
24
17
|
}
|
25
18
|
|
26
|
-
|
27
|
-
background-color: $
|
19
|
+
@include theming.light($type) {
|
20
|
+
background-color: theming.daff-color($neutral, 30);
|
21
|
+
|
22
|
+
&:focus-within {
|
23
|
+
border: 2px solid theming.daff-color($neutral, 20);
|
24
|
+
}
|
25
|
+
|
26
|
+
&::before {
|
27
|
+
background-color: $white;
|
28
|
+
}
|
29
|
+
}
|
30
|
+
|
31
|
+
@include theming.dark($type) {
|
32
|
+
background-color: theming.daff-color($neutral, 80);
|
33
|
+
|
34
|
+
&:focus-within {
|
35
|
+
border: 2px solid theming.daff-color($neutral, 90);
|
36
|
+
}
|
37
|
+
|
38
|
+
&::before {
|
39
|
+
background-color: theming.daff-color($neutral, 40);
|
40
|
+
}
|
41
|
+
|
42
|
+
&.daff-checked {
|
43
|
+
&::before {
|
44
|
+
background-color: $white;
|
45
|
+
}
|
46
|
+
}
|
28
47
|
}
|
29
48
|
}
|
30
49
|
}
|
@@ -4,12 +4,9 @@ import * as i0 from "@angular/core";
|
|
4
4
|
/**
|
5
5
|
* The switch component provides a way to toggle between two settings.
|
6
6
|
*
|
7
|
-
* @example
|
8
|
-
*
|
9
7
|
* ```html
|
10
|
-
* <daff-switch
|
11
|
-
*
|
12
|
-
* <daff-error-message>Error message</daff-error-message>
|
8
|
+
* <daff-switch>
|
9
|
+
* Label
|
13
10
|
* </daff-switch>
|
14
11
|
* ```
|
15
12
|
*/
|
@@ -19,8 +16,17 @@ export declare class DaffSwitchComponent {
|
|
19
16
|
*/
|
20
17
|
get disabled(): any;
|
21
18
|
set disabled(value: any);
|
19
|
+
/**
|
20
|
+
* @docs-private
|
21
|
+
*/
|
22
22
|
get disabledAttribute(): boolean;
|
23
|
+
/**
|
24
|
+
* @docs-private
|
25
|
+
*/
|
23
26
|
get ariaDisabled(): boolean;
|
27
|
+
/**
|
28
|
+
* @docs-private
|
29
|
+
*/
|
24
30
|
get classes(): string;
|
25
31
|
/**
|
26
32
|
* Whether the switch is loading.
|
@@ -31,13 +37,16 @@ export declare class DaffSwitchComponent {
|
|
31
37
|
*/
|
32
38
|
checked: boolean;
|
33
39
|
/**
|
34
|
-
* The position of the label relative to the switch.
|
40
|
+
* The position of the label relative to the switch.
|
35
41
|
*/
|
36
42
|
labelPosition: DaffLabelPosition;
|
37
43
|
/**
|
38
44
|
* Whether the switch shows an error.
|
39
45
|
*/
|
40
46
|
error: boolean;
|
47
|
+
/**
|
48
|
+
* @docs-private
|
49
|
+
*/
|
41
50
|
_disabled: boolean;
|
42
51
|
handleKeydown(event: KeyboardEvent): void;
|
43
52
|
/**
|
@@ -48,8 +57,24 @@ export declare class DaffSwitchComponent {
|
|
48
57
|
* aria-label for the switch.
|
49
58
|
*/
|
50
59
|
ariaLabel: string;
|
60
|
+
/**
|
61
|
+
* A unique id for the switch.
|
62
|
+
*
|
63
|
+
* The `id` is automatically generated by linking the prefix 'daff-switch-' with an incrementing number. This value can be customized by passing a different `id` value via the component's `id` input.
|
64
|
+
*
|
65
|
+
* @example Using the `id` property
|
66
|
+
* ```html
|
67
|
+
* <daff-switch [id]="'custom-id'"></daff-switch>
|
68
|
+
* ```
|
69
|
+
*/
|
51
70
|
id: string;
|
71
|
+
/**
|
72
|
+
* Output event triggered when the switch has been toggled.
|
73
|
+
*/
|
52
74
|
toggled: EventEmitter<boolean>;
|
75
|
+
/**
|
76
|
+
* @docs-private
|
77
|
+
*/
|
53
78
|
onToggle(): void;
|
54
79
|
static ɵfac: i0.ɵɵFactoryDeclaration<DaffSwitchComponent, never>;
|
55
80
|
static ɵcmp: i0.ɵɵComponentDeclaration<DaffSwitchComponent, "daff-switch", never, { "disabled": { "alias": "disabled"; "required": false; }; "loading": { "alias": "loading"; "required": false; }; "checked": { "alias": "checked"; "required": false; }; "labelPosition": { "alias": "labelPosition"; "required": false; }; "error": { "alias": "error"; "required": false; }; "ariaLabel": { "alias": "aria-label"; "required": false; }; "id": { "alias": "id"; "required": false; }; }, { "toggled": "toggled"; }, never, ["*", "daff-error-message"], true, never>;
|
package/switch/switch.d.ts
CHANGED
@@ -1,3 +1,6 @@
|
|
1
1
|
import { DaffErrorMessageModule } from '@daffodil/design';
|
2
2
|
import { DaffSwitchComponent } from './switch/switch.component';
|
3
|
+
/**
|
4
|
+
* @docs-private
|
5
|
+
*/
|
3
6
|
export declare const DAFF_SWITCH_COMPONENTS: readonly [typeof DaffSwitchComponent, typeof DaffErrorMessageModule];
|
package/tabs/README.md
CHANGED
@@ -4,12 +4,45 @@ Tabs provide a way to navigate between panels that display related content.
|
|
4
4
|
## Overview
|
5
5
|
Tabs allow for users to navigate between related content without having to leave the page. They can be used within components like modals or cards.
|
6
6
|
|
7
|
+
## Usage
|
8
|
+
|
9
|
+
### Within a standalone component
|
10
|
+
To use a tabs in a standalone component, import `DAFF_TABS_COMPONENTS` directly into your custom component:
|
11
|
+
|
12
|
+
```ts
|
13
|
+
import { DAFF_TABS_COMPONENTS } from '@daffodil/design/tabs';
|
14
|
+
|
15
|
+
@Component({
|
16
|
+
selector: 'custom-component',
|
17
|
+
templateUrl: './custom-component.component.html',
|
18
|
+
imports: [
|
19
|
+
DAFF_TABS_COMPONENTS,
|
20
|
+
],
|
21
|
+
})
|
22
|
+
export class CustomComponent {}
|
23
|
+
```
|
24
|
+
|
25
|
+
## Properties
|
26
|
+
|
27
|
+
### Link Mode
|
28
|
+
Tabs in link mode replaces the tab buttons with anchors. This allows the selected tab to be connected to a URL. By default, the current URL and `tab` query param will be used. These can be overriden with the `url` and `queryParam` inputs respectively.
|
29
|
+
|
30
|
+
```html
|
31
|
+
<daff-tabs [linkMode]="true">
|
32
|
+
</daff-tabs>
|
33
|
+
```
|
34
|
+
|
7
35
|
## Accessbility
|
8
36
|
Tabs follow the [ARIA Tabs design pattern](https://www.w3.org/WAI/ARIA/apg/patterns/tabs/). Tabs compose of `tablist`, `tab`, and `tabpanel` elements, each with its appropriate role and integrated keyboard interactions.
|
9
37
|
|
10
38
|
### Label
|
11
39
|
A meaningful `aria-label` should be set on `<daff-tabs>` by using the `aria-label` property. This will set the `aria-label` on the `tablist` element.
|
12
40
|
|
41
|
+
```html
|
42
|
+
<daff-tabs aria-label="Custom aria label">
|
43
|
+
</daff-tabs>
|
44
|
+
```
|
45
|
+
|
13
46
|
### Keyboard Interactions
|
14
47
|
| Key | Action |
|
15
48
|
| --- | ------ |
|
@@ -17,6 +50,3 @@ A meaningful `aria-label` should be set on `<daff-tabs>` by using the `aria-labe
|
|
17
50
|
| Right Arrow | Moves focus and activates next tab. If focus is on the last tab, moves focus to the first tab. |
|
18
51
|
| Home | Moves focus and activates first tab. |
|
19
52
|
| End | Moves focus and activates last tab. |
|
20
|
-
|
21
|
-
### Link Mode
|
22
|
-
Tabs can operate in "link mode" which replaces the tab buttons with anchors. This allows the selected tab to be connected to the URL. To use this mode, set `linkMode` to `true` on the tabs component. By default, the current URL and `tab` query param will be used. These can be overriden with the `url` and `queryParam` inputs respectively.
|
package/tabs/src/tabs-theme.scss
CHANGED
@@ -4,27 +4,45 @@
|
|
4
4
|
|
5
5
|
@mixin daff-tabs-theme($theme) {
|
6
6
|
$primary: core.daff-map-get($theme, primary);
|
7
|
-
$secondary: core.daff-map-get($theme, secondary);
|
8
|
-
$tertiary: core.daff-map-get($theme, tertiary);
|
9
7
|
$neutral: core.daff-map-get($theme, 'core', 'neutral');
|
10
|
-
$base: core.daff-map-get($theme, 'core', 'base');
|
11
8
|
$base-contrast: core.daff-map-get($theme, 'core', 'base-contrast');
|
12
|
-
$
|
13
|
-
$black: core.daff-map-get($theme, 'core', 'black');
|
9
|
+
$type: core.daff-map-get($theme, 'core', 'type');
|
14
10
|
|
15
|
-
.
|
16
|
-
|
17
|
-
|
18
|
-
|
11
|
+
@include theming.light($type) {
|
12
|
+
.daff-tabs {
|
13
|
+
&__tab-list {
|
14
|
+
&::after {
|
15
|
+
background: theming.daff-color($neutral, 20);
|
16
|
+
}
|
17
|
+
}
|
18
|
+
}
|
19
|
+
|
20
|
+
.daff-tab-activator {
|
21
|
+
border-bottom: 2px solid theming.daff-color($neutral, 20);
|
22
|
+
color: $base-contrast;
|
23
|
+
|
24
|
+
&.daff-selected {
|
25
|
+
border-bottom: 2px solid theming.daff-color($primary);
|
19
26
|
}
|
20
27
|
}
|
21
28
|
}
|
22
29
|
|
23
|
-
.
|
24
|
-
|
30
|
+
@include theming.dark($type) {
|
31
|
+
.daff-tabs {
|
32
|
+
&__tab-list {
|
33
|
+
&::after {
|
34
|
+
background: theming.daff-color($neutral, 80);
|
35
|
+
}
|
36
|
+
}
|
37
|
+
}
|
25
38
|
|
26
|
-
|
27
|
-
border-bottom: 2px solid theming.daff-color($
|
39
|
+
.daff-tab-activator {
|
40
|
+
border-bottom: 2px solid theming.daff-color($neutral, 80);
|
41
|
+
color: $base-contrast;
|
42
|
+
|
43
|
+
&.daff-selected {
|
44
|
+
border-bottom: 2px solid theming.daff-color($primary);
|
45
|
+
}
|
28
46
|
}
|
29
47
|
}
|
30
48
|
}
|
@@ -3,7 +3,7 @@ import * as i0 from "@angular/core";
|
|
3
3
|
/**
|
4
4
|
* `DaffTabComponet` is an element in the tab list that is used as a content container to group the label of a tab panel and the tab panel together.
|
5
5
|
*
|
6
|
-
* A `<daff-tab>` should include the
|
6
|
+
* A `<daff-tab>` should include the DaffTabLabelComponent and DaffTabPanelComponent components in order to properly structure the UI.
|
7
7
|
*
|
8
8
|
* @example Basic structure of tab
|
9
9
|
* ```html
|
@@ -13,7 +13,13 @@ import * as i0 from "@angular/core";
|
|
13
13
|
* ```
|
14
14
|
*/
|
15
15
|
export declare class DaffTabLabelComponent implements DaffPrefixable, DaffSuffixable {
|
16
|
+
/**
|
17
|
+
* @docs-private
|
18
|
+
*/
|
16
19
|
_prefix: DaffPrefixDirective;
|
20
|
+
/**
|
21
|
+
* @docs-private
|
22
|
+
*/
|
17
23
|
_suffix: DaffSuffixDirective;
|
18
24
|
static ɵfac: i0.ɵɵFactoryDeclaration<DaffTabLabelComponent, never>;
|
19
25
|
static ɵcmp: i0.ɵɵComponentDeclaration<DaffTabLabelComponent, "daff-tab-label", never, {}, {}, ["_prefix", "_suffix"], ["[daffPrefix]", "*", "[daffSuffix]"], true, never>;
|
@@ -17,19 +17,27 @@ export declare class DaffTabPanelComponent {
|
|
17
17
|
*/
|
18
18
|
private class;
|
19
19
|
/**
|
20
|
+
* @docs-private
|
21
|
+
*
|
20
22
|
* Sets the `role` to tabpanel.
|
21
23
|
*/
|
22
24
|
role: string;
|
23
25
|
/**
|
26
|
+
* @docs-private
|
27
|
+
*
|
24
28
|
* `aria-labelledby` for the tab.
|
25
29
|
*/
|
26
30
|
ariaLabelledBy: string;
|
27
31
|
/**
|
32
|
+
* @docs-private
|
33
|
+
*
|
28
34
|
* Sets the `tabindex` to 0.
|
29
35
|
*/
|
30
36
|
tabIndex: string;
|
31
37
|
private _id;
|
32
38
|
/**
|
39
|
+
* @docs-private
|
40
|
+
*
|
33
41
|
* Dynamically binds the tab panel's id to a unique value generated from the associated tab's panelId.
|
34
42
|
*/
|
35
43
|
get tabPanelId(): string;
|
@@ -40,23 +40,26 @@ export declare class DaffTabsComponent implements AfterContentInit, OnInit {
|
|
40
40
|
*/
|
41
41
|
private class;
|
42
42
|
/**
|
43
|
+
* @docs-private
|
44
|
+
*
|
43
45
|
* The currently selected tab. This property is dynamically updated when a user selects a tab.
|
44
46
|
*/
|
45
47
|
selectedTab: string;
|
46
48
|
/**
|
47
|
-
* The tab that is
|
49
|
+
* The tab that is selected on initial load. If it's not used, the first tab in the tablist will be selected by default.
|
48
50
|
*/
|
49
51
|
initiallySelected: string;
|
50
52
|
/**
|
51
|
-
*
|
53
|
+
* aria-label for the tab.
|
52
54
|
*/
|
53
55
|
private externalAriaLabel;
|
54
56
|
/**
|
55
|
-
*
|
57
|
+
* @docs-private
|
58
|
+
*
|
56
59
|
*/
|
57
60
|
ariaLabel: string;
|
58
61
|
/**
|
59
|
-
* Replace the tab buttons
|
62
|
+
* Replace the tab buttons as links.
|
60
63
|
*/
|
61
64
|
linkMode: boolean;
|
62
65
|
/**
|
@@ -84,8 +87,12 @@ export declare class DaffTabsComponent implements AfterContentInit, OnInit {
|
|
84
87
|
* @docs-private
|
85
88
|
*/
|
86
89
|
_tabActivators: QueryList<DaffTabActivatorComponent>;
|
90
|
+
/**
|
91
|
+
* @docs-private
|
92
|
+
*/
|
87
93
|
get currentPath(): string;
|
88
94
|
constructor(cdRef: ChangeDetectorRef, location: Location);
|
95
|
+
private reset;
|
89
96
|
/**
|
90
97
|
* @docs-private
|
91
98
|
*/
|
@@ -95,6 +102,8 @@ export declare class DaffTabsComponent implements AfterContentInit, OnInit {
|
|
95
102
|
*/
|
96
103
|
ngAfterContentInit(): void;
|
97
104
|
/**
|
105
|
+
* @docs-private
|
106
|
+
*
|
98
107
|
* Selects a tab and sets focus on the selected tab.
|
99
108
|
*/
|
100
109
|
select(tabId: string): void;
|
@@ -108,18 +117,26 @@ export declare class DaffTabsComponent implements AfterContentInit, OnInit {
|
|
108
117
|
*/
|
109
118
|
_buildQueryParams(tab: string): Params;
|
110
119
|
/**
|
120
|
+
* @docs-private
|
121
|
+
*
|
111
122
|
* Selects the previous tab and wraps around to the last tab if the first tab is currently selected.
|
112
123
|
*/
|
113
124
|
previous(): void;
|
114
125
|
/**
|
126
|
+
* @docs-private
|
127
|
+
*
|
115
128
|
* Selects the next tab and wraps around to the first tab if the last tab is currently selected.
|
116
129
|
*/
|
117
130
|
next(): void;
|
118
131
|
/**
|
132
|
+
* @docs-private
|
133
|
+
*
|
119
134
|
* Selects the first tab.
|
120
135
|
*/
|
121
136
|
selectFirst(event: KeyboardEvent | null): void;
|
122
137
|
/**
|
138
|
+
* @docs-private
|
139
|
+
*
|
123
140
|
* Selects the last tab.
|
124
141
|
*/
|
125
142
|
selectLast(event: KeyboardEvent | null): void;
|
package/tabs/tabs.d.ts
CHANGED
@@ -1,6 +1,12 @@
|
|
1
|
-
import { DaffPrefixSuffixModule } from '@daffodil/design';
|
2
1
|
import { DaffTabComponent } from './tabs/tab/tab.component';
|
3
2
|
import { DaffTabLabelComponent } from './tabs/tab-label/tab-label.component';
|
4
3
|
import { DaffTabPanelComponent } from './tabs/tab-panel/tab-panel.component';
|
5
4
|
import { DaffTabsComponent } from './tabs/tabs.component';
|
6
|
-
|
5
|
+
/**
|
6
|
+
* @docs-private
|
7
|
+
*
|
8
|
+
* ```ts
|
9
|
+
* import { DAFF_TABS_COMPONENTS } from '@daffodil/design/tabs';
|
10
|
+
* ```
|
11
|
+
*/
|
12
|
+
export declare const DAFF_TABS_COMPONENTS: readonly [typeof DaffTabsComponent, typeof DaffTabLabelComponent, typeof DaffTabPanelComponent, typeof DaffTabComponent];
|
package/text-snippet/README.md
CHANGED
@@ -1,2 +1,20 @@
|
|
1
1
|
# Text Snippet
|
2
|
-
The text snippet component shows a snippet of text, with the ability to show or hide content beyond one line of text.
|
2
|
+
The text snippet component shows a snippet of text, with the ability to show or hide content beyond one line of text.
|
3
|
+
|
4
|
+
## Usage
|
5
|
+
|
6
|
+
### Within a standalone component
|
7
|
+
To use a text snippet in a standalone component, import `DaffTextSnippetComponent` directly into your custom component:
|
8
|
+
|
9
|
+
```ts
|
10
|
+
import { DaffTextSnippetComponent } from '@daffodil/design/text-snippet';
|
11
|
+
|
12
|
+
@Component({
|
13
|
+
selector: 'custom-component',
|
14
|
+
templateUrl: './custom-component.component.html',
|
15
|
+
imports: [
|
16
|
+
DaffTextSnippetComponent,
|
17
|
+
],
|
18
|
+
})
|
19
|
+
export class CustomComponent {}
|
20
|
+
```
|
package/toast/README.md
CHANGED
@@ -4,187 +4,57 @@ Toasts are small messages designed to mimic push notifications. They are used to
|
|
4
4
|
## Overview
|
5
5
|
Toasts should be used to display temporary messages about actions or events that occured or in need of attention, with no relation to content on a page. For messaging that provide context in close promixity to a piece of content within a page, use the [Notification](/libs/design/notification/README.md) component.
|
6
6
|
|
7
|
-
## Basic
|
7
|
+
## Basic toast
|
8
8
|
<design-land-example-viewer-container example="default-toast"></design-land-example-viewer-container>
|
9
9
|
|
10
10
|
## Setting up the component
|
11
|
-
`provideDaffToast()`
|
11
|
+
`provideDaffToast()` must be added as a provider in your application's root component for global use or in a specific feature component for the toast functionality to work properly.
|
12
12
|
|
13
13
|
```ts
|
14
14
|
import { provideDaffToast } from '@daffodil/design/toast';
|
15
15
|
|
16
16
|
@NgModule({
|
17
|
-
|
18
|
-
|
19
|
-
|
17
|
+
providers: [
|
18
|
+
provideDaffToast(),
|
19
|
+
]
|
20
20
|
)}
|
21
21
|
|
22
22
|
export class AppModule {}
|
23
23
|
```
|
24
24
|
|
25
|
-
### Configurations
|
26
|
-
Toast can be configured by using the `DaffToastService`.
|
27
|
-
|
28
|
-
The following is an example of a toast with a duration:
|
29
|
-
|
30
|
-
```ts
|
31
|
-
import {
|
32
|
-
ChangeDetectionStrategy,
|
33
|
-
Component,
|
34
|
-
} from '@angular/core';
|
35
|
-
|
36
|
-
import {
|
37
|
-
DaffToast
|
38
|
-
DaffToastService,
|
39
|
-
} from '@daffodil/design/toast';
|
40
|
-
|
41
|
-
@Component({
|
42
|
-
selector: 'custom-toast',
|
43
|
-
templateUrl: './custom-toast.component.html',
|
44
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
45
|
-
standalone: true,
|
46
|
-
})
|
47
|
-
export class CustomToastComponent {
|
48
|
-
private toast: DaffToast;
|
49
|
-
|
50
|
-
constructor(private toastService: DaffToastService) {}
|
51
|
-
|
52
|
-
open() {
|
53
|
-
this.toast = this.toastService.open({
|
54
|
-
title: 'Update Complete',
|
55
|
-
message: 'This page has been updated to the newest version.',
|
56
|
-
},
|
57
|
-
{
|
58
|
-
duration: 5000,
|
59
|
-
});
|
60
|
-
}
|
61
|
-
}
|
62
|
-
```
|
63
|
-
|
64
|
-
The following is an example of a toast with actions:
|
65
|
-
|
66
|
-
```ts
|
67
|
-
import {
|
68
|
-
ChangeDetectionStrategy,
|
69
|
-
Component,
|
70
|
-
EventEmitter,
|
71
|
-
OnInit,
|
72
|
-
} from '@angular/core';
|
73
|
-
|
74
|
-
import { DAFF_BUTTON_COMPONENTS } from '@daffodil/design/button';
|
75
|
-
import {
|
76
|
-
DaffToast,
|
77
|
-
DaffToastAction,
|
78
|
-
DaffToastService,
|
79
|
-
} from '@daffodil/design/toast';
|
80
|
-
|
81
|
-
@Component({
|
82
|
-
selector: 'action-toast',
|
83
|
-
templateUrl: './action-toast.component.html',
|
84
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
85
|
-
standalone: true,
|
86
|
-
imports: [
|
87
|
-
DAFF_BUTTON_COMPONENTS,
|
88
|
-
],
|
89
|
-
})
|
90
|
-
export class ActionToastComponent implements OnInit {
|
91
|
-
private toast: DaffToast;
|
92
|
-
|
93
|
-
constructor(private toastService: DaffToastService) {}
|
94
|
-
|
95
|
-
update = new EventEmitter<DaffToastAction>();
|
96
|
-
|
97
|
-
closeToast = new EventEmitter<DaffToastAction>();
|
98
|
-
|
99
|
-
open() {
|
100
|
-
this.toast = this.toastService.open({
|
101
|
-
title: 'Update Available',
|
102
|
-
message: 'A new version of this page is available.',
|
103
|
-
actions: [
|
104
|
-
{ content: 'Update', color: 'theme-contrast', size: 'sm', eventEmitter: this.update },
|
105
|
-
{ content: 'Remind me later', type: 'flat', size: 'sm', eventEmitter: this.closeToast },
|
106
|
-
]
|
107
|
-
});
|
108
|
-
}
|
109
|
-
|
110
|
-
ngOnInit() {
|
111
|
-
this.update.subscribe(() => {
|
112
|
-
});
|
113
|
-
|
114
|
-
this.closeToast.subscribe(() => {
|
115
|
-
this.toastService.close(this.toast);
|
116
|
-
});
|
117
|
-
}
|
118
|
-
}
|
119
|
-
```
|
120
|
-
|
121
|
-
The following configurations are available in the `DaffToastService`:
|
122
|
-
|
123
|
-
| Property | Type | Description | Default |
|
124
|
-
| -------- | ------ | ------------------------------- | ------- |
|
125
|
-
| title | string | A quick overview of the toast | -- |
|
126
|
-
| message | string | Additional details about the message that should be limited to one or two sentences | -- |
|
127
|
-
| actions | `DaffToastAction` | Adds a `daff-button` that allow users to perform an action related to the message. Actions should be limited to two buttons. | -- |
|
128
|
-
| dismissible | boolean | Allows a toast to be dismissible via a close button | true |
|
129
|
-
| duration | number | The duration in milliseconds that a toast is visible before it's dismissed | 5000 |
|
130
|
-
|
131
|
-
The `actions` configurations are based on the properties of the `DaffButtonComponent` (view [Button Documentation](/libs/design/button/README.md)) with the addition of `data` and `eventEmitter`.
|
132
|
-
|
133
25
|
## Dismissal
|
134
|
-
A toast can be dismissed via a timed duration
|
26
|
+
A toast can be dismissed via a timed duration or a close button.
|
27
|
+
|
28
|
+
The `duration` and `dismissible` properties can be updated when you open it with the `DaffToastService`.
|
135
29
|
|
136
30
|
### Timed duration
|
137
|
-
A toast with actions will persist until one of the actions have been interacted with
|
31
|
+
A toast with actions will persist until one of the actions have been interacted with or dismissed by the close button. By default, a toast without actions will be dismissed after `5000ms`.
|
138
32
|
|
139
|
-
|
33
|
+
> Actionable toasts should be persistent, but a duration is allowed to be set. If duration must be set, make sure it's long enough for users to engage with the actions.
|
140
34
|
|
141
|
-
#### Toast with custom duration
|
142
35
|
<design-land-example-viewer-container example="toast-with-custom-duration"></design-land-example-viewer-container>
|
143
36
|
|
144
37
|
### Close button
|
145
|
-
The close button is
|
38
|
+
The close button is hidden by default, and dismissible is ignored when there are actions in a toast. You can change the visibility of the close button via the `dismissible` property.
|
146
39
|
|
147
|
-
|
148
|
-
A toast can be dismissed by using the `ESC` key if it has actions and is focus trapped.
|
40
|
+
<design-land-example-viewer-container example="dismissible-toast"></design-land-example-viewer-container>
|
149
41
|
|
150
42
|
## Stacking
|
151
43
|
A maximum of three toasts can be shown at a time. Toasts are stacked vertically, with the most recent toast displayed on top.
|
152
44
|
|
153
45
|
## Statuses
|
154
|
-
|
155
|
-
|
156
|
-
Supported statuses: `warn | critical | success`
|
46
|
+
You can set the status of a toast when opening it with `DaffToastService`, using values defined by `DaffStatus`.
|
157
47
|
|
158
|
-
### Toast with statuses
|
159
48
|
<design-land-example-viewer-container example="toast-status"></design-land-example-viewer-container>
|
160
49
|
|
161
|
-
##
|
162
|
-
|
163
|
-
| Property | Value | Default |
|
164
|
-
| ------------ | ------------------------ | ------- |
|
165
|
-
| `vertical` | `top | bottom` | top |
|
166
|
-
| `horizontal` | `left | center | right ` | right |
|
167
|
-
|
168
|
-
To change the horizontal and vertical position of a toast, add the `provideDaffToastOptions` dependency key to the `providers` key in the module as shown below:
|
169
|
-
|
170
|
-
```ts
|
171
|
-
providers: [
|
172
|
-
provideDaffToastOptions({
|
173
|
-
position: {
|
174
|
-
vertical: 'bottom',
|
175
|
-
horizontal: 'center',
|
176
|
-
}
|
177
|
-
useParent: false,
|
178
|
-
})
|
179
|
-
]
|
180
|
-
```
|
181
|
-
|
182
|
-
The position of a toast on a mobile device will always be on the bottom center.
|
50
|
+
## Accessibility
|
51
|
+
By default, toasts use a `role="status"` to announce messages. It's the equivalent of `aria-live="polite"`, which does not interrupt a user's current activity and waits until they are idle to make the announcement.
|
183
52
|
|
184
|
-
|
185
|
-
<design-land-example-viewer-container example="toast-positions"></design-land-example-viewer-container>
|
53
|
+
`role="alertdialog"` is used when a toast has action. The toast will be focus trapped and focus immediately moves to the actions.
|
186
54
|
|
187
|
-
|
188
|
-
By default, toasts use a `role="status"` to announce messages. It's the equivalent of `aria-live="polite"`, which does not interrupt a user's current activity and waits until they are idle to make the announcement. When a toast has actions, a `role="alertdialog"` is used. The toast will be focus trapped and focus immediately moves to the actions.
|
55
|
+
Avoid setting a duration on toasts with actions because they will disappear automatically, making it difficult for users to interact with the actions.
|
189
56
|
|
190
|
-
|
57
|
+
### Keyboard Interactions
|
58
|
+
| Key | Action |
|
59
|
+
| ----- | ------ |
|
60
|
+
| `ESC` | Dismisses a toast if it has actions and is focus trapped. |
|