@daffodil/design 0.92.3 → 0.93.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/accordion/README.md +4 -4
- package/beacon/README.md +61 -0
- package/beacon/src/beacon-theme.scss +61 -0
- package/breadcrumb/README.md +13 -35
- package/button/README.md +28 -50
- package/card/README.md +8 -22
- package/card/src/card/stroked/stroked-theme.scss +8 -1
- package/card/src/card-base-theme.scss +12 -1
- package/container/README.md +4 -26
- package/fesm2022/daffodil-design-accordion.mjs +15 -15
- package/fesm2022/daffodil-design-accordion.mjs.map +1 -1
- package/fesm2022/daffodil-design-article.mjs +30 -30
- package/fesm2022/daffodil-design-article.mjs.map +1 -1
- package/fesm2022/daffodil-design-beacon.mjs +48 -0
- package/fesm2022/daffodil-design-beacon.mjs.map +1 -0
- package/fesm2022/daffodil-design-breadcrumb.mjs +20 -20
- package/fesm2022/daffodil-design-breadcrumb.mjs.map +1 -1
- package/fesm2022/daffodil-design-button.mjs +37 -49
- package/fesm2022/daffodil-design-button.mjs.map +1 -1
- package/fesm2022/daffodil-design-callout.mjs +22 -22
- package/fesm2022/daffodil-design-callout.mjs.map +1 -1
- package/fesm2022/daffodil-design-card.mjs +31 -31
- 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 +7 -7
- package/fesm2022/daffodil-design-container.mjs.map +1 -1
- package/fesm2022/daffodil-design-form-field.mjs +13 -12
- 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 +22 -22
- 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 +12 -11
- package/fesm2022/daffodil-design-input.mjs.map +1 -1
- package/fesm2022/daffodil-design-link-set.mjs +16 -16
- package/fesm2022/daffodil-design-link-set.mjs.map +1 -1
- package/fesm2022/daffodil-design-list.mjs +20 -17
- package/fesm2022/daffodil-design-list.mjs.map +1 -1
- package/fesm2022/daffodil-design-loading-icon.mjs +7 -7
- 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 +20 -20
- package/fesm2022/daffodil-design-menu.mjs.map +1 -1
- package/fesm2022/daffodil-design-modal.mjs +33 -27
- package/fesm2022/daffodil-design-modal.mjs.map +1 -1
- package/fesm2022/daffodil-design-native-select.mjs +5 -3
- package/fesm2022/daffodil-design-native-select.mjs.map +1 -1
- package/fesm2022/daffodil-design-navbar.mjs +9 -9
- 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 +8 -8
- package/fesm2022/daffodil-design-paginator.mjs.map +1 -1
- package/fesm2022/daffodil-design-progress-bar.mjs +11 -11
- package/fesm2022/daffodil-design-progress-bar.mjs.map +1 -1
- package/fesm2022/daffodil-design-quantity-field.mjs +13 -13
- 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 +11 -11
- package/fesm2022/daffodil-design-select.mjs.map +1 -1
- package/fesm2022/daffodil-design-sidebar.mjs +36 -30
- package/fesm2022/daffodil-design-sidebar.mjs.map +1 -1
- package/fesm2022/daffodil-design-spinner.mjs +8 -8
- package/fesm2022/daffodil-design-spinner.mjs.map +1 -1
- package/fesm2022/daffodil-design-switch.mjs +3 -3
- package/fesm2022/daffodil-design-switch.mjs.map +1 -1
- package/fesm2022/daffodil-design-tabs.mjs +17 -25
- package/fesm2022/daffodil-design-tabs.mjs.map +1 -1
- package/fesm2022/daffodil-design-tag.mjs +43 -35
- package/fesm2022/daffodil-design-tag.mjs.map +1 -1
- package/fesm2022/daffodil-design-testing.mjs +19 -0
- package/fesm2022/daffodil-design-testing.mjs.map +1 -0
- package/fesm2022/daffodil-design-text-snippet.mjs +3 -3
- package/fesm2022/daffodil-design-text-snippet.mjs.map +1 -1
- package/fesm2022/daffodil-design-textarea.mjs +3 -3
- package/fesm2022/daffodil-design-textarea.mjs.map +1 -1
- package/fesm2022/daffodil-design-toast.mjs +22 -22
- package/fesm2022/daffodil-design-toast.mjs.map +1 -1
- package/fesm2022/daffodil-design-tree.mjs +27 -25
- package/fesm2022/daffodil-design-tree.mjs.map +1 -1
- package/fesm2022/daffodil-design-youtube-player.mjs +22 -11
- package/fesm2022/daffodil-design-youtube-player.mjs.map +1 -1
- package/fesm2022/daffodil-design.mjs +126 -160
- package/fesm2022/daffodil-design.mjs.map +1 -1
- package/form/README.md +15 -6
- package/hero/README.md +14 -49
- package/image/README.md +6 -29
- package/input/README.md +8 -34
- package/list/README.md +29 -55
- package/list/src/list-theme.scss +16 -2
- package/media-gallery/README.md +36 -43
- package/menu/README.md +24 -55
- package/menu/src/menu-theme.scss +12 -2
- package/modal/README.md +15 -45
- package/native-select/README.md +8 -6
- package/navbar/README.md +18 -27
- package/notification/README.md +14 -49
- package/package.json +1 -1
- package/paginator/README.md +11 -31
- package/paginator/src/paginator-theme.scss +16 -2
- package/progress-bar/README.md +14 -41
- package/scss/global.scss +25 -2
- package/scss/theme.scss +2 -0
- package/select/README.md +5 -6
- package/select/src/select-theme.scss +10 -2
- package/sidebar/README.md +1 -1
- package/spinner/README.md +15 -9
- package/switch/README.md +17 -6
- package/tabs/README.md +39 -39
- package/tag/README.md +31 -31
- package/tag/src/tag-theme.scss +100 -3
- package/textarea/README.md +9 -7
- package/toast/README.md +55 -52
- package/tree/README.md +12 -43
- package/tree/src/tree-theme.scss +8 -4
- package/{accordion/index.d.ts → types/daffodil-design-accordion.d.ts} +1 -1
- package/types/daffodil-design-beacon.d.ts +26 -0
- package/{button/index.d.ts → types/daffodil-design-button.d.ts} +7 -8
- package/{input/index.d.ts → types/daffodil-design-input.d.ts} +4 -1
- package/{list/index.d.ts → types/daffodil-design-list.d.ts} +4 -1
- package/{menu/index.d.ts → types/daffodil-design-menu.d.ts} +3 -3
- package/{modal/index.d.ts → types/daffodil-design-modal.d.ts} +11 -5
- package/{native-select/index.d.ts → types/daffodil-design-native-select.d.ts} +3 -1
- package/{sidebar/index.d.ts → types/daffodil-design-sidebar.d.ts} +9 -3
- package/{tabs/index.d.ts → types/daffodil-design-tabs.d.ts} +0 -6
- package/types/daffodil-design-tag.d.ts +80 -0
- package/types/daffodil-design-testing.d.ts +11 -0
- package/{tree/index.d.ts → types/daffodil-design-tree.d.ts} +2 -0
- package/{youtube-player/index.d.ts → types/daffodil-design-youtube-player.d.ts} +15 -0
- package/{index.d.ts → types/daffodil-design.d.ts} +25 -67
- package/tag/index.d.ts +0 -71
- /package/{article/index.d.ts → types/daffodil-design-article.d.ts} +0 -0
- /package/{breadcrumb/index.d.ts → types/daffodil-design-breadcrumb.d.ts} +0 -0
- /package/{callout/index.d.ts → types/daffodil-design-callout.d.ts} +0 -0
- /package/{card/index.d.ts → types/daffodil-design-card.d.ts} +0 -0
- /package/{checkbox/index.d.ts → types/daffodil-design-checkbox.d.ts} +0 -0
- /package/{container/index.d.ts → types/daffodil-design-container.d.ts} +0 -0
- /package/{form-field/index.d.ts → types/daffodil-design-form-field.d.ts} +0 -0
- /package/{form/index.d.ts → types/daffodil-design-form.d.ts} +0 -0
- /package/{hero/index.d.ts → types/daffodil-design-hero.d.ts} +0 -0
- /package/{image/index.d.ts → types/daffodil-design-image.d.ts} +0 -0
- /package/{link-set/index.d.ts → types/daffodil-design-link-set.d.ts} +0 -0
- /package/{loading-icon/index.d.ts → types/daffodil-design-loading-icon.d.ts} +0 -0
- /package/{media-gallery/index.d.ts → types/daffodil-design-media-gallery.d.ts} +0 -0
- /package/{navbar/index.d.ts → types/daffodil-design-navbar.d.ts} +0 -0
- /package/{notification/index.d.ts → types/daffodil-design-notification.d.ts} +0 -0
- /package/{paginator/index.d.ts → types/daffodil-design-paginator.d.ts} +0 -0
- /package/{progress-bar/index.d.ts → types/daffodil-design-progress-bar.d.ts} +0 -0
- /package/{quantity-field/index.d.ts → types/daffodil-design-quantity-field.d.ts} +0 -0
- /package/{radio/index.d.ts → types/daffodil-design-radio.d.ts} +0 -0
- /package/{select/index.d.ts → types/daffodil-design-select.d.ts} +0 -0
- /package/{spinner/index.d.ts → types/daffodil-design-spinner.d.ts} +0 -0
- /package/{switch/index.d.ts → types/daffodil-design-switch.d.ts} +0 -0
- /package/{text-snippet/index.d.ts → types/daffodil-design-text-snippet.d.ts} +0 -0
- /package/{textarea/index.d.ts → types/daffodil-design-textarea.d.ts} +0 -0
- /package/{toast/index.d.ts → types/daffodil-design-toast.d.ts} +0 -0
package/select/README.md
CHANGED
|
@@ -7,7 +7,7 @@ Use select when you need users to pick one option from a list. It works like a s
|
|
|
7
7
|
<daff-docs-example-viewer example="basic-select"></daff-docs-example-viewer>
|
|
8
8
|
|
|
9
9
|
## Usage
|
|
10
|
-
|
|
10
|
+
Import `DAFF_SELECT_COMPONENTS` and `DAFF_FORM_FIELD_COMPONENTS` into your component:
|
|
11
11
|
|
|
12
12
|
```ts
|
|
13
13
|
import { DAFF_SELECT_COMPONENTS } from '@daffodil/design/select';
|
|
@@ -27,7 +27,6 @@ export class CustomComponent {}
|
|
|
27
27
|
## Anatomy
|
|
28
28
|
Select 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).
|
|
29
29
|
|
|
30
|
-
### Basic structure
|
|
31
30
|
Use `daffSelectOption` to render a list of options in the select panel:
|
|
32
31
|
|
|
33
32
|
```html
|
|
@@ -43,7 +42,7 @@ Use `daffSelectOption` to render a list of options in the select panel:
|
|
|
43
42
|
</daff-form-field>
|
|
44
43
|
```
|
|
45
44
|
|
|
46
|
-
##
|
|
45
|
+
## Features
|
|
47
46
|
|
|
48
47
|
### Disabled
|
|
49
48
|
Select can be disabled using Angular's reactive forms with `FormControl`.
|
|
@@ -57,15 +56,15 @@ Select supports validation and error messages through Angular's form validation
|
|
|
57
56
|
|
|
58
57
|
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.
|
|
59
58
|
|
|
60
|
-
|
|
61
|
-
Hints provide additional context or instructions to help users complete the select field correctly. Use `<daff-hint>` within the form field to display helpful information below the
|
|
59
|
+
### Hints
|
|
60
|
+
Hints provide additional context or instructions to help users complete the select field correctly. Use `<daff-hint>` within the form field to display helpful information below the select. Unlike error messages, hints are always visible and provide guidance rather than validation feedback.
|
|
62
61
|
|
|
63
62
|
<daff-docs-example-viewer example="select-with-hint"></daff-docs-example-viewer>
|
|
64
63
|
|
|
65
64
|
## Accessibility
|
|
66
65
|
Select follows the [Combobox WAI-ARIA design pattern](https://www.w3.org/WAI/ARIA/apg/patterns/combobox/examples/combobox-select-only/). The combobox activator is combined with an inner `role="listbox"` element opened in a popup.
|
|
67
66
|
|
|
68
|
-
###
|
|
67
|
+
### Built-in behavior
|
|
69
68
|
- Automatic focus trapping when select panel is open
|
|
70
69
|
- `aria-labelledby` associated with the `<daff-form-label>`
|
|
71
70
|
- `aria-expanded` state management
|
|
@@ -32,7 +32,12 @@
|
|
|
32
32
|
border-top: 1px solid $border-color-light;
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
-
|
|
35
|
+
@media (hover: hover) {
|
|
36
|
+
&:hover {
|
|
37
|
+
background-color: daff-color($neutral, 10);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
36
41
|
&.highlighted {
|
|
37
42
|
background-color: daff-color($neutral, 10);
|
|
38
43
|
}
|
|
@@ -57,7 +62,10 @@
|
|
|
57
62
|
border-top: 1px solid $border-color-dark;
|
|
58
63
|
}
|
|
59
64
|
|
|
60
|
-
|
|
65
|
+
@media (hover: hover) {
|
|
66
|
+
background-color: daff-color($neutral, 90);
|
|
67
|
+
}
|
|
68
|
+
|
|
61
69
|
&.highlighted {
|
|
62
70
|
background-color: daff-color($neutral, 90);
|
|
63
71
|
}
|
package/sidebar/README.md
CHANGED
|
@@ -206,7 +206,7 @@ body {
|
|
|
206
206
|
|
|
207
207
|
## Accessibility
|
|
208
208
|
|
|
209
|
-
###
|
|
209
|
+
### Built-in
|
|
210
210
|
- Automatic focus trapping for `over` and `under` modes (disabled for `side` and `side-fixed` modes)
|
|
211
211
|
- Focus moves to the first tabbable element when sidebar opens
|
|
212
212
|
- Focus returns to the previously focused element when sidebar closes
|
package/spinner/README.md
CHANGED
|
@@ -2,10 +2,13 @@
|
|
|
2
2
|
A spinner is an animated indicator that lets users know content or action is being loaded.
|
|
3
3
|
|
|
4
4
|
## Overview
|
|
5
|
-
Use a spinner to indicate a short, indeterminate loading state. It can appear on its own or paired with a loading message. For longer processes with measurable progress, use the [
|
|
5
|
+
Use a spinner to indicate a short, indeterminate loading state. It can appear on its own or paired with a loading message. For longer processes with measurable progress, use the [Progress Bar](/libs/design/progress-bar/README.md) component.
|
|
6
|
+
|
|
7
|
+
<daff-docs-example-viewer example="basic-spinner"></daff-docs-example-viewer>
|
|
6
8
|
|
|
7
9
|
## Usage
|
|
8
|
-
|
|
10
|
+
|
|
11
|
+
Import `DAFF_SPINNER_COMPONENTS` into your component:
|
|
9
12
|
|
|
10
13
|
```ts
|
|
11
14
|
import { DAFF_SPINNER_COMPONENTS } from '@daffodil/design/spinner';
|
|
@@ -21,9 +24,7 @@ export class CustomComponent {}
|
|
|
21
24
|
```
|
|
22
25
|
|
|
23
26
|
## Anatomy
|
|
24
|
-
|
|
25
|
-
### Label
|
|
26
|
-
Labels are used to describe the loading state and provide context for users. They are optional.
|
|
27
|
+
A spinner is composed of an animated indicator with an optional label:
|
|
27
28
|
|
|
28
29
|
```html
|
|
29
30
|
<daff-spinner>
|
|
@@ -31,7 +32,8 @@ Labels are used to describe the loading state and provide context for users. The
|
|
|
31
32
|
</daff-spinner>
|
|
32
33
|
```
|
|
33
34
|
|
|
34
|
-
|
|
35
|
+
- **`<daff-spinner>`**: The animated loading indicator.
|
|
36
|
+
- **`<daff-spinner-label>`**: An optional label that describes the loading state and provides context for users.
|
|
35
37
|
|
|
36
38
|
## Features
|
|
37
39
|
|
|
@@ -43,14 +45,18 @@ Use the `color` property to change the color of a spinner.
|
|
|
43
45
|
<daff-docs-example-viewer example="spinner-colors"></daff-docs-example-viewer>
|
|
44
46
|
|
|
45
47
|
### Sizes
|
|
46
|
-
Use the `size`
|
|
48
|
+
Use the `size` property to change the size of a spinner. The default size is `md`.
|
|
47
49
|
|
|
48
50
|
<daff-docs-example-viewer example="spinner-sizes"></daff-docs-example-viewer>
|
|
49
51
|
|
|
50
52
|
## Accessibility
|
|
51
|
-
The spinner has `role="status"` which announces content changes to assistive technologies.
|
|
52
53
|
|
|
53
|
-
|
|
54
|
+
### Built-in behavior
|
|
55
|
+
- `role="status"` on the spinner announces content changes to assistive technologies.
|
|
56
|
+
- When `<daff-spinner-label>` is used, its visible text serves as the accessible name. When no label is provided, the spinner defaults to `aria-label="loading"`.
|
|
57
|
+
|
|
58
|
+
### Developer responsibilities
|
|
59
|
+
- When no label is shown, customize the accessible name with the `aria-label` input to describe the loading state:
|
|
54
60
|
|
|
55
61
|
```html
|
|
56
62
|
<daff-spinner aria-label="Saving changes"></daff-spinner>
|
package/switch/README.md
CHANGED
|
@@ -2,14 +2,13 @@
|
|
|
2
2
|
A switch allows users to toggle the state of a single setting.
|
|
3
3
|
|
|
4
4
|
## Overview
|
|
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.
|
|
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.
|
|
6
6
|
|
|
7
7
|
<daff-docs-example-viewer example="basic-switch"></daff-docs-example-viewer>
|
|
8
8
|
|
|
9
9
|
## Usage
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
To use switch, import `DAFF_SWITCH_COMPONENTS` directly into your custom component:
|
|
11
|
+
Import `DAFF_SWITCH_COMPONENTS` into your component:
|
|
13
12
|
|
|
14
13
|
```ts
|
|
15
14
|
import { DAFF_SWITCH_COMPONENTS } from '@daffodil/design/switch';
|
|
@@ -24,17 +23,28 @@ import { DAFF_SWITCH_COMPONENTS } from '@daffodil/design/switch';
|
|
|
24
23
|
export class CustomComponent {}
|
|
25
24
|
```
|
|
26
25
|
|
|
27
|
-
##
|
|
26
|
+
## Anatomy
|
|
27
|
+
A switch consists of a toggle control with a label projected as content:
|
|
28
|
+
|
|
29
|
+
```html
|
|
30
|
+
<daff-switch>Wi-Fi</daff-switch>
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
- **`<daff-switch>`**: The switch control. The label is provided as projected content and is automatically associated with the toggle.
|
|
34
|
+
|
|
35
|
+
## Features
|
|
36
|
+
|
|
37
|
+
### Sizes
|
|
28
38
|
A small switch variant is available for dense layouts. Use the `size="sm"` property to render a more compact version of a switch.
|
|
29
39
|
|
|
30
40
|
<daff-docs-example-viewer example="switch-sizes"></daff-docs-example-viewer>
|
|
31
41
|
|
|
32
|
-
|
|
42
|
+
### Disabled switch
|
|
33
43
|
Use the `disabled` property on switch to make it non-interactive.
|
|
34
44
|
|
|
35
45
|
<daff-docs-example-viewer example="disabled-switch"></daff-docs-example-viewer>
|
|
36
46
|
|
|
37
|
-
|
|
47
|
+
### Label positions
|
|
38
48
|
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
49
|
|
|
40
50
|
<daff-docs-example-viewer example="switch-label-positions"></daff-docs-example-viewer>
|
|
@@ -42,6 +52,7 @@ Use the `labelPosition` property to control the visual relationship between the
|
|
|
42
52
|
## Accessibility
|
|
43
53
|
Switch follows the [ARIA Switch design pattern](https://www.w3.org/WAI/ARIA/apg/patterns/switch/).
|
|
44
54
|
|
|
55
|
+
### Built-in behavior
|
|
45
56
|
- The switch control is implemented as a `<button>` element with a role of `switch`.
|
|
46
57
|
- `aria-checked` is used to indicate the switch's on/off state.
|
|
47
58
|
- Links the switch to its label `id` using `aria-labelledby`.
|
package/tabs/README.md
CHANGED
|
@@ -13,15 +13,13 @@ Tabs help organize related content into manageable sections, making it easier fo
|
|
|
13
13
|
- Working within limited screen space
|
|
14
14
|
- Allowing users to switch between content views without page navigation
|
|
15
15
|
|
|
16
|
-
|
|
17
|
-
Avoid tabs when:
|
|
16
|
+
**When not to use**
|
|
18
17
|
- Content needs to be compared or viewed simultaneously
|
|
19
|
-
- Users need to see all content in a sequential
|
|
18
|
+
- Users need to see all content in a sequential order
|
|
20
19
|
|
|
21
20
|
## Usage
|
|
22
21
|
|
|
23
|
-
|
|
24
|
-
To use tabs in a standalone component, import `DAFF_TABS_COMPONENTS` directly into your custom component:
|
|
22
|
+
Import `DAFF_TABS_COMPONENTS` into your component:
|
|
25
23
|
|
|
26
24
|
```ts
|
|
27
25
|
import { DAFF_TABS_COMPONENTS } from '@daffodil/design/tabs';
|
|
@@ -37,24 +35,8 @@ export class CustomComponent {}
|
|
|
37
35
|
```
|
|
38
36
|
|
|
39
37
|
## Anatomy
|
|
40
|
-
A tabs component
|
|
38
|
+
A tabs component is composed of a container, tabs, labels, and panels:
|
|
41
39
|
|
|
42
|
-
### Container
|
|
43
|
-
**`<daff-tabs>`**: The wrapper component that contains all tabs.
|
|
44
|
-
|
|
45
|
-
### Tab
|
|
46
|
-
**`<daff-tab>`**: Represents a single tab that groups a label and its corresponding panel together.
|
|
47
|
-
|
|
48
|
-
### Tab Label
|
|
49
|
-
**`<daff-tab-label>`**: The clickable label that activates its corresponding tab panel. Labels can contain text, icons, or both.
|
|
50
|
-
|
|
51
|
-
### Icon
|
|
52
|
-
Use the `[daffPrefix]` or `[daffSuffix]` element to add a decorative icon before or after the label text. This provides quick visual cues about the tab's purpose.
|
|
53
|
-
|
|
54
|
-
### Tab Panel
|
|
55
|
-
**`<daff-tab-panel>`**: The content area displayed when a tab is active.
|
|
56
|
-
|
|
57
|
-
### Basic structure
|
|
58
40
|
```html
|
|
59
41
|
<daff-tabs>
|
|
60
42
|
<daff-tab>
|
|
@@ -70,35 +52,45 @@ Use the `[daffPrefix]` or `[daffSuffix]` element to add a decorative icon before
|
|
|
70
52
|
</daff-tabs>
|
|
71
53
|
```
|
|
72
54
|
|
|
55
|
+
- **`<daff-tabs>`**: The wrapper component that contains all tabs.
|
|
56
|
+
- **`<daff-tab>`**: A single tab that groups a label and its corresponding panel together.
|
|
57
|
+
- **`<daff-tab-label>`**: The clickable label that activates its corresponding tab panel. Labels can contain text, icons, or both.
|
|
58
|
+
- **`<daff-tab-panel>`**: The content area displayed when a tab is active.
|
|
59
|
+
- Add the `[daffPrefix]` or `[daffSuffix]` directive to an icon to place it before or after the label text. This provides a quick visual cue about the tab's purpose.
|
|
60
|
+
|
|
73
61
|
## Features
|
|
74
62
|
|
|
75
63
|
### Link mode
|
|
76
|
-
|
|
64
|
+
Set `linkMode` to `true` to replace the tab buttons with anchors, connecting the selected tab to a URL.
|
|
77
65
|
|
|
78
|
-
By default, the current URL and `tab` query param
|
|
66
|
+
By default, the current URL and `tab` query param are used. Override these with the `url` and `queryParam` inputs, respectively.
|
|
79
67
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
68
|
+
<daff-docs-example-viewer example="link-tabs"></daff-docs-example-viewer>
|
|
69
|
+
|
|
70
|
+
### Initially selected tab
|
|
71
|
+
Set the `initiallySelected` input to a tab's `id` to select that tab on load. Without it, the first tab is selected by default.
|
|
72
|
+
|
|
73
|
+
<daff-docs-example-viewer example="initially-select-tab"></daff-docs-example-viewer>
|
|
74
|
+
|
|
75
|
+
### Disabled tab
|
|
76
|
+
Set the `disabled` property on a `<daff-tab>` to make it non-interactive.
|
|
77
|
+
|
|
78
|
+
<daff-docs-example-viewer example="disabled-tabs"></daff-docs-example-viewer>
|
|
79
|
+
|
|
80
|
+
### Programmatic selection
|
|
81
|
+
Call the `select` method with a tab's `id` to change the active tab from your own code.
|
|
82
|
+
|
|
83
|
+
<daff-docs-example-viewer example="custom-select-tabs"></daff-docs-example-viewer>
|
|
84
84
|
|
|
85
85
|
## Accessibility
|
|
86
86
|
Tabs follow the [Tabs WAI-ARIA design pattern](https://www.w3.org/WAI/ARIA/apg/patterns/tabs/).
|
|
87
87
|
|
|
88
|
-
###
|
|
89
|
-
- `role="tablist"`, `role="tab"`, and `role="tabpanel"` on appropriate elements
|
|
90
|
-
- Unique IDs automatically assigned to each tab (customizable via `id` attribute)
|
|
88
|
+
### Built-in behavior
|
|
89
|
+
- `role="tablist"`, `role="tab"`, and `role="tabpanel"` on the appropriate elements
|
|
90
|
+
- Unique IDs automatically assigned to each tab (customizable via the `id` attribute)
|
|
91
91
|
- `aria-labelledby` linking tab panels to their corresponding tab labels
|
|
92
92
|
- `aria-selected` indicating the active tab
|
|
93
93
|
|
|
94
|
-
#### Keyboard interactions
|
|
95
|
-
| Key | Action |
|
|
96
|
-
| --- | ------ |
|
|
97
|
-
| `Left Arrow` | Moves focus and activates the previous tab. If focus is on the first tab, focus moves to the last tab. |
|
|
98
|
-
| `Right Arrow` | Moves focus and activates the next tab. If focus is on the last tab, focus moves to the first tab. |
|
|
99
|
-
| `Home` | Moves focus and activates the first tab. |
|
|
100
|
-
| `End` | Moves focus and activates the last tab. |
|
|
101
|
-
|
|
102
94
|
### Developer responsibilities
|
|
103
95
|
- Provide a meaningful `aria-label` on `<daff-tabs>` to describe the tab group
|
|
104
96
|
- Keep tab labels concise and descriptive
|
|
@@ -111,3 +103,11 @@ Tabs follow the [Tabs WAI-ARIA design pattern](https://www.w3.org/WAI/ARIA/apg/p
|
|
|
111
103
|
</daff-tab>
|
|
112
104
|
</daff-tabs>
|
|
113
105
|
```
|
|
106
|
+
|
|
107
|
+
### Keyboard interactions
|
|
108
|
+
| Key | Action |
|
|
109
|
+
| --- | ------ |
|
|
110
|
+
| `Left Arrow` | Moves focus and activates the previous tab. If focus is on the first tab, focus moves to the last tab. |
|
|
111
|
+
| `Right Arrow` | Moves focus and activates the next tab. If focus is on the last tab, focus moves to the first tab. |
|
|
112
|
+
| `Home` | Moves focus and activates the first tab. |
|
|
113
|
+
| `End` | Moves focus and activates the last tab. |
|
package/tag/README.md
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
# Tag
|
|
2
|
-
Tags are
|
|
2
|
+
Tags are interactive indicators and filters that can be edited or removed, used to represent selections, categories, or applied filters.
|
|
3
3
|
|
|
4
4
|
## Overview
|
|
5
|
-
Tag supports flexible content projection to allow for various combinations of icons, labels, and interactive elements within a consistent container.
|
|
5
|
+
Tag supports flexible content projection to allow for various combinations of icons, labels, and interactive elements within a consistent container. Tags can be dismissed to remove a selection or filter, making them well suited for filter chips, applied search criteria, and editable selections.
|
|
6
6
|
|
|
7
7
|
<daff-docs-example-viewer example="basic-tag"></daff-docs-example-viewer>
|
|
8
8
|
|
|
9
9
|
## Usage
|
|
10
|
-
|
|
10
|
+
|
|
11
|
+
Import `DAFF_TAG_COMPONENTS` into your component:
|
|
11
12
|
|
|
12
13
|
```ts
|
|
13
14
|
import { DAFF_TAG_COMPONENTS } from '@daffodil/design/tag';
|
|
@@ -23,59 +24,58 @@ export class CustomComponent {}
|
|
|
23
24
|
```
|
|
24
25
|
|
|
25
26
|
## Anatomy
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
### Icon
|
|
29
|
-
Use the `[daffPrefix]` element to display a leading visual icon for a tag.
|
|
27
|
+
A tag is composed of a wrapper, an optional prefix, a label, and an optional close button:
|
|
30
28
|
|
|
31
29
|
```html
|
|
32
|
-
<daff-tag>
|
|
30
|
+
<daff-tag [dismissible]="true" (closeTag)="onCloseTag()">
|
|
33
31
|
<fa-icon [icon]="faCircleCheck" daffPrefix></fa-icon>
|
|
34
|
-
|
|
32
|
+
Tag label
|
|
35
33
|
</daff-tag>
|
|
36
34
|
```
|
|
37
35
|
|
|
36
|
+
- **`<daff-tag>`**: The wrapper component that holds all tag content.
|
|
37
|
+
- **`[daffPrefix]`**: A leading visual, typically an icon, displayed before the label.
|
|
38
|
+
- **Label**: The text content of the tag, projected as a child element.
|
|
39
|
+
- **Close button**: A trailing remove button, displayed when `dismissible` is `true`.
|
|
40
|
+
|
|
38
41
|
## Features
|
|
39
42
|
|
|
40
|
-
### Dismissible
|
|
43
|
+
### Dismissible tags
|
|
41
44
|
Set `dismissible` to `true` to display a close button. The button emits a `closeTag` event when clicked.
|
|
42
45
|
|
|
43
|
-
|
|
44
|
-
<daff-tag [dismissible]="true" (closeTag)="onCloseTag()">
|
|
45
|
-
<fa-icon [icon]="faCircleCheck" daffPrefix></fa-icon>
|
|
46
|
-
<div>Tag label</div>
|
|
47
|
-
</daff-tag>
|
|
48
|
-
```
|
|
46
|
+
<daff-docs-example-viewer example="dismissible-tag"></daff-docs-example-viewer>
|
|
49
47
|
|
|
50
|
-
### Disabled
|
|
51
|
-
Set `disabled` to `true` to disable the tag. Disabled tags cannot be
|
|
48
|
+
### Disabled tags
|
|
49
|
+
Set `disabled` to `true` to disable the tag. Disabled tags cannot be removed.
|
|
52
50
|
|
|
53
|
-
|
|
54
|
-
<daff-tag [disabled]="true">
|
|
55
|
-
<fa-icon [icon]="faCircleCheck" daffPrefix></fa-icon>
|
|
56
|
-
<div>Disabled tag</div>
|
|
57
|
-
</daff-tag>
|
|
58
|
-
```
|
|
51
|
+
<daff-docs-example-viewer example="disabled-tag"></daff-docs-example-viewer>
|
|
59
52
|
|
|
60
|
-
|
|
53
|
+
### Sizes
|
|
61
54
|
Use the `size` property to control tag dimensions. Supported sizes: `sm`, `md` (default), `lg`.
|
|
62
55
|
|
|
63
56
|
<daff-docs-example-viewer example="sizable-tag"></daff-docs-example-viewer>
|
|
64
57
|
|
|
65
|
-
|
|
58
|
+
### Colors
|
|
66
59
|
Use the `color` property to change the color of a tag. Supported colors: `primary`, `secondary`, `tertiary`, `dark`, `light`, `theme`, `theme-contrast`.
|
|
67
60
|
|
|
68
61
|
<daff-docs-example-viewer example="colorable-tag"></daff-docs-example-viewer>
|
|
69
62
|
|
|
70
|
-
|
|
63
|
+
### Statuses
|
|
71
64
|
Use the `status` property to convey semantic meaning. Supported statuses: `warn`, `critical`, `info`, `success`.
|
|
72
65
|
|
|
66
|
+
> **Deprecation notice:**
|
|
67
|
+
>
|
|
68
|
+
> The `status` property is deprecated. Tags are intended for selections, categories, and applied filters, so use the `color` property instead.
|
|
69
|
+
|
|
73
70
|
<daff-docs-example-viewer example="statusable-tag"></daff-docs-example-viewer>
|
|
74
71
|
|
|
75
72
|
## Accessibility
|
|
76
|
-
No additional accessibility annotations are needed.
|
|
77
73
|
|
|
78
|
-
###
|
|
79
|
-
Default tags are not interactive and do not receive focus.
|
|
74
|
+
### Built-in behavior
|
|
75
|
+
- Default tags are not interactive and do not receive focus.
|
|
76
|
+
- Removable tags include a focusable close button that can be activated with `Enter` or `Space`.
|
|
77
|
+
- Disabled tags expose `aria-disabled="true"` and ignore close button activation.
|
|
80
78
|
|
|
81
|
-
|
|
79
|
+
### Developer responsibilities
|
|
80
|
+
- Always provide a text label unless the icon is universally understood and accessible.
|
|
81
|
+
- Communicate meaning through the tag's label or an accessible icon, rather than relying on color alone.
|
package/tag/src/tag-theme.scss
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
// stylelint-disable selector-class-pattern
|
|
1
2
|
@use '../../scss/theming' as *;
|
|
2
3
|
|
|
3
4
|
@mixin daff-tag-theme($theme) {
|
|
@@ -18,119 +19,215 @@
|
|
|
18
19
|
background: daff-color($neutral, 20);
|
|
19
20
|
color: $black;
|
|
20
21
|
|
|
22
|
+
&::after {
|
|
23
|
+
background: daff-color($neutral, 30);
|
|
24
|
+
}
|
|
25
|
+
|
|
21
26
|
&.daff-primary {
|
|
22
27
|
background: daff-color($primary, 10);
|
|
23
28
|
color: daff-color($primary, 70);
|
|
29
|
+
|
|
30
|
+
&::after {
|
|
31
|
+
background: daff-color($primary, 20);
|
|
32
|
+
}
|
|
24
33
|
}
|
|
25
34
|
|
|
26
35
|
&.daff-secondary {
|
|
27
36
|
background: daff-color($secondary, 10);
|
|
28
37
|
color: daff-color($secondary, 70);
|
|
38
|
+
|
|
39
|
+
&::after {
|
|
40
|
+
background: daff-color($secondary, 20);
|
|
41
|
+
}
|
|
29
42
|
}
|
|
30
43
|
|
|
31
44
|
&.daff-tertiary {
|
|
32
45
|
background: daff-color($tertiary, 10);
|
|
33
46
|
color: daff-color($tertiary, 70);
|
|
47
|
+
|
|
48
|
+
&::after {
|
|
49
|
+
background: daff-color($tertiary, 20);
|
|
50
|
+
}
|
|
34
51
|
}
|
|
35
52
|
|
|
36
53
|
&.daff-dark {
|
|
37
54
|
background: daff-color($neutral, 90);
|
|
38
55
|
color: daff-color($neutral, 10);
|
|
56
|
+
|
|
57
|
+
&::after {
|
|
58
|
+
background: daff-color($neutral, 100);
|
|
59
|
+
}
|
|
39
60
|
}
|
|
40
61
|
|
|
41
62
|
&.daff-light {
|
|
42
63
|
background: daff-color($neutral, 10);
|
|
43
64
|
color: daff-color($neutral, 90);
|
|
65
|
+
|
|
66
|
+
&::after {
|
|
67
|
+
background: daff-color($neutral, 20);
|
|
68
|
+
}
|
|
44
69
|
}
|
|
45
70
|
|
|
46
71
|
&.daff-theme {
|
|
47
72
|
background: $white;
|
|
48
73
|
color: $black;
|
|
74
|
+
|
|
75
|
+
&::after {
|
|
76
|
+
background: daff-color($neutral, 20);
|
|
77
|
+
}
|
|
49
78
|
}
|
|
50
79
|
|
|
51
80
|
&.daff-theme-contrast {
|
|
52
81
|
background: $black;
|
|
53
82
|
color: $white;
|
|
83
|
+
|
|
84
|
+
&::after {
|
|
85
|
+
background: daff-color($neutral, 90);
|
|
86
|
+
}
|
|
54
87
|
}
|
|
55
88
|
|
|
56
89
|
&.daff-warn {
|
|
57
90
|
background: daff-color($warn, 10);
|
|
58
91
|
color: daff-color($warn, 70);
|
|
92
|
+
|
|
93
|
+
&::after {
|
|
94
|
+
background: daff-color($warn, 20);
|
|
95
|
+
}
|
|
59
96
|
}
|
|
60
97
|
|
|
61
98
|
&.daff-success {
|
|
62
99
|
background: daff-color($success, 10);
|
|
63
100
|
color: daff-color($success, 70);
|
|
101
|
+
|
|
102
|
+
&::after {
|
|
103
|
+
background: daff-color($success, 20);
|
|
104
|
+
}
|
|
64
105
|
}
|
|
65
106
|
|
|
66
107
|
&.daff-critical {
|
|
67
108
|
background: daff-color($critical, 10);
|
|
68
109
|
color: daff-color($critical, 70);
|
|
110
|
+
|
|
111
|
+
&::after {
|
|
112
|
+
background: daff-color($critical, 20);
|
|
113
|
+
}
|
|
69
114
|
}
|
|
70
115
|
|
|
71
116
|
&.daff-info {
|
|
72
117
|
background: daff-color($info, 10);
|
|
73
|
-
color: daff-color($info,
|
|
118
|
+
color: daff-color($info, 90);
|
|
119
|
+
|
|
120
|
+
&::after {
|
|
121
|
+
background: daff-color($info, 20);
|
|
122
|
+
}
|
|
74
123
|
}
|
|
75
124
|
}
|
|
76
125
|
|
|
77
126
|
@include dark($mode) {
|
|
78
|
-
background: daff-color($neutral,
|
|
127
|
+
background: daff-color($neutral, 80);
|
|
79
128
|
color: daff-color($neutral, 20);
|
|
80
129
|
|
|
130
|
+
&::after {
|
|
131
|
+
background: daff-color($neutral, 90);
|
|
132
|
+
}
|
|
133
|
+
|
|
81
134
|
&.daff-primary {
|
|
82
135
|
background: daff-color($primary, 90);
|
|
83
136
|
color: daff-color($primary, 10);
|
|
137
|
+
|
|
138
|
+
&::after {
|
|
139
|
+
background: daff-color($primary, 100);
|
|
140
|
+
}
|
|
84
141
|
}
|
|
85
142
|
|
|
86
143
|
&.daff-secondary {
|
|
87
144
|
background: daff-color($secondary, 90);
|
|
88
145
|
color: daff-color($secondary, 10);
|
|
146
|
+
|
|
147
|
+
&::after {
|
|
148
|
+
background: daff-color($secondary, 100);
|
|
149
|
+
}
|
|
89
150
|
}
|
|
90
151
|
|
|
91
152
|
&.daff-tertiary {
|
|
92
153
|
background: daff-color($tertiary, 90);
|
|
93
154
|
color: daff-color($tertiary, 10);
|
|
155
|
+
|
|
156
|
+
&::after {
|
|
157
|
+
background: daff-color($tertiary, 100);
|
|
158
|
+
}
|
|
94
159
|
}
|
|
95
160
|
|
|
96
161
|
&.daff-dark {
|
|
97
162
|
background: daff-color($neutral, 90);
|
|
98
163
|
color: daff-color($neutral, 10);
|
|
164
|
+
|
|
165
|
+
&::after {
|
|
166
|
+
background: daff-color($neutral, 100);
|
|
167
|
+
}
|
|
99
168
|
}
|
|
100
169
|
|
|
101
170
|
&.daff-light {
|
|
102
171
|
background: daff-color($neutral, 10);
|
|
103
172
|
color: daff-color($neutral, 90);
|
|
173
|
+
|
|
174
|
+
&::after {
|
|
175
|
+
background: daff-color($neutral, 30);
|
|
176
|
+
}
|
|
104
177
|
}
|
|
105
178
|
|
|
106
179
|
&.daff-theme {
|
|
107
180
|
background: $black;
|
|
108
181
|
color: $white;
|
|
182
|
+
|
|
183
|
+
&::after {
|
|
184
|
+
background: daff-color($neutral, 100);
|
|
185
|
+
}
|
|
109
186
|
}
|
|
110
187
|
|
|
111
188
|
&.daff-theme-contrast {
|
|
112
189
|
background: $white;
|
|
113
190
|
color: $black;
|
|
191
|
+
|
|
192
|
+
&::after {
|
|
193
|
+
background: daff-color($neutral, 20);
|
|
194
|
+
}
|
|
114
195
|
}
|
|
115
196
|
|
|
116
197
|
&.daff-warn {
|
|
117
198
|
background: daff-color($warn, 90);
|
|
118
199
|
color: daff-color($warn, 10);
|
|
200
|
+
|
|
201
|
+
&::after {
|
|
202
|
+
background: daff-color($warn, 100);
|
|
203
|
+
}
|
|
119
204
|
}
|
|
120
205
|
|
|
121
206
|
&.daff-success {
|
|
122
207
|
background: daff-color($success, 90);
|
|
123
208
|
color: daff-color($success, 10);
|
|
209
|
+
|
|
210
|
+
&::after {
|
|
211
|
+
background: daff-color($success, 100);
|
|
212
|
+
}
|
|
124
213
|
}
|
|
125
214
|
|
|
126
215
|
&.daff-critical {
|
|
127
216
|
background: daff-color($critical, 90);
|
|
128
217
|
color: daff-color($critical, 10);
|
|
218
|
+
|
|
219
|
+
&::after {
|
|
220
|
+
background: daff-color($critical, 100);
|
|
221
|
+
}
|
|
129
222
|
}
|
|
130
223
|
|
|
131
224
|
&.daff-info {
|
|
132
|
-
background: daff-color($info,
|
|
225
|
+
background: daff-color($info, 80);
|
|
133
226
|
color: daff-color($info, 10);
|
|
227
|
+
|
|
228
|
+
&::after {
|
|
229
|
+
background: daff-color($neutral, 80);
|
|
230
|
+
}
|
|
134
231
|
}
|
|
135
232
|
}
|
|
136
233
|
}
|