@daffodil/design 0.91.0 → 0.92.3-rc.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 +26 -38
- package/accordion/index.d.ts +2 -2
- package/article/README.md +66 -46
- package/article/index.d.ts +22 -1
- package/article/src/article-theme.scss +12 -0
- package/breadcrumb/README.md +6 -1
- package/breadcrumb/index.d.ts +65 -11
- package/breadcrumb/src/breadcrumb-theme.scss +1 -1
- package/button/README.md +36 -33
- package/button/index.d.ts +26 -5
- package/button/src/button/basic/button-theme.scss +4 -2
- package/button/src/button/button-base.scss +26 -3
- package/button/src/button/icon/icon-theme.scss +10 -6
- package/button/src/button/raised/raised-theme.scss +4 -2
- package/callout/README.md +15 -27
- package/card/README.md +36 -61
- package/container/README.md +18 -23
- package/fesm2022/daffodil-design-accordion.mjs +13 -13
- package/fesm2022/daffodil-design-accordion.mjs.map +1 -1
- package/fesm2022/daffodil-design-article.mjs +168 -26
- package/fesm2022/daffodil-design-article.mjs.map +1 -1
- package/fesm2022/daffodil-design-breadcrumb.mjs +180 -28
- package/fesm2022/daffodil-design-breadcrumb.mjs.map +1 -1
- package/fesm2022/daffodil-design-button.mjs +83 -42
- package/fesm2022/daffodil-design-button.mjs.map +1 -1
- package/fesm2022/daffodil-design-callout.mjs +23 -23
- package/fesm2022/daffodil-design-callout.mjs.map +1 -1
- package/fesm2022/daffodil-design-card.mjs +33 -33
- package/fesm2022/daffodil-design-card.mjs.map +1 -1
- package/fesm2022/daffodil-design-checkbox.mjs +13 -13
- package/fesm2022/daffodil-design-checkbox.mjs.map +1 -1
- package/fesm2022/daffodil-design-container.mjs +8 -8
- package/fesm2022/daffodil-design-container.mjs.map +1 -1
- package/fesm2022/daffodil-design-form-field.mjs +26 -26
- package/fesm2022/daffodil-design-form-field.mjs.map +1 -1
- package/fesm2022/daffodil-design-form.mjs +9 -9
- package/fesm2022/daffodil-design-form.mjs.map +1 -1
- package/fesm2022/daffodil-design-hero.mjs +23 -23
- package/fesm2022/daffodil-design-hero.mjs.map +1 -1
- package/fesm2022/daffodil-design-image.mjs +8 -8
- package/fesm2022/daffodil-design-image.mjs.map +1 -1
- package/fesm2022/daffodil-design-input.mjs +18 -14
- package/fesm2022/daffodil-design-input.mjs.map +1 -1
- package/fesm2022/daffodil-design-link-set.mjs +25 -17
- package/fesm2022/daffodil-design-link-set.mjs.map +1 -1
- package/fesm2022/daffodil-design-list.mjs +16 -16
- package/fesm2022/daffodil-design-list.mjs.map +1 -1
- package/fesm2022/daffodil-design-loading-icon.mjs +8 -8
- package/fesm2022/daffodil-design-loading-icon.mjs.map +1 -1
- package/fesm2022/daffodil-design-media-gallery.mjs +13 -13
- package/fesm2022/daffodil-design-media-gallery.mjs.map +1 -1
- package/fesm2022/daffodil-design-menu.mjs +223 -60
- package/fesm2022/daffodil-design-menu.mjs.map +1 -1
- package/fesm2022/daffodil-design-modal.mjs +33 -29
- package/fesm2022/daffodil-design-modal.mjs.map +1 -1
- package/fesm2022/daffodil-design-native-select.mjs +47 -41
- package/fesm2022/daffodil-design-native-select.mjs.map +1 -1
- package/fesm2022/daffodil-design-navbar.mjs +25 -21
- package/fesm2022/daffodil-design-navbar.mjs.map +1 -1
- package/fesm2022/daffodil-design-notification.mjs +16 -16
- package/fesm2022/daffodil-design-notification.mjs.map +1 -1
- package/fesm2022/daffodil-design-paginator.mjs +7 -7
- package/fesm2022/daffodil-design-paginator.mjs.map +1 -1
- package/fesm2022/daffodil-design-progress-bar.mjs +10 -10
- package/fesm2022/daffodil-design-progress-bar.mjs.map +1 -1
- package/fesm2022/daffodil-design-quantity-field.mjs +17 -14
- package/fesm2022/daffodil-design-quantity-field.mjs.map +1 -1
- package/fesm2022/daffodil-design-radio.mjs +16 -16
- package/fesm2022/daffodil-design-radio.mjs.map +1 -1
- package/fesm2022/daffodil-design-select.mjs +6 -6
- package/fesm2022/daffodil-design-select.mjs.map +1 -1
- package/fesm2022/daffodil-design-sidebar.mjs +25 -25
- package/fesm2022/daffodil-design-sidebar.mjs.map +1 -1
- package/fesm2022/daffodil-design-spinner.mjs +99 -0
- package/fesm2022/daffodil-design-spinner.mjs.map +1 -0
- package/fesm2022/daffodil-design-switch.mjs +3 -3
- package/fesm2022/daffodil-design-switch.mjs.map +1 -1
- package/fesm2022/daffodil-design-tabs.mjs +15 -15
- package/fesm2022/daffodil-design-tabs.mjs.map +1 -1
- package/fesm2022/daffodil-design-tag.mjs +7 -7
- package/fesm2022/daffodil-design-tag.mjs.map +1 -1
- package/fesm2022/daffodil-design-text-snippet.mjs +6 -8
- package/fesm2022/daffodil-design-text-snippet.mjs.map +1 -1
- package/fesm2022/daffodil-design-textarea.mjs +6 -3
- package/fesm2022/daffodil-design-textarea.mjs.map +1 -1
- package/fesm2022/daffodil-design-toast.mjs +23 -25
- package/fesm2022/daffodil-design-toast.mjs.map +1 -1
- package/fesm2022/daffodil-design-tree.mjs +152 -103
- package/fesm2022/daffodil-design-tree.mjs.map +1 -1
- package/fesm2022/daffodil-design-youtube-player.mjs +6 -6
- package/fesm2022/daffodil-design-youtube-player.mjs.map +1 -1
- package/fesm2022/daffodil-design.mjs +385 -326
- package/fesm2022/daffodil-design.mjs.map +1 -1
- package/form-field/README.md +50 -85
- package/form-field/index.d.ts +11 -9
- package/hero/README.md +5 -5
- package/image/README.md +2 -2
- package/index.d.ts +184 -270
- package/input/README.md +4 -4
- package/input/index.d.ts +4 -3
- package/link-set/index.d.ts +9 -1
- package/list/README.md +2 -2
- package/loading-icon/README.md +1 -1
- package/loading-icon/index.d.ts +1 -1
- package/media-gallery/README.md +3 -3
- package/menu/README.md +107 -10
- package/menu/index.d.ts +143 -11
- package/modal/README.md +1 -1
- package/modal/index.d.ts +23 -15
- package/native-select/README.md +4 -4
- package/native-select/index.d.ts +8 -7
- package/navbar/README.md +23 -17
- package/navbar/index.d.ts +12 -2
- package/navbar/src/navbar-theme.scss +4 -46
- package/notification/README.md +4 -4
- package/package.json +1 -1
- package/paginator/README.md +42 -6
- package/paginator/index.d.ts +4 -2
- package/progress-bar/README.md +3 -3
- package/quantity-field/README.md +4 -4
- package/quantity-field/index.d.ts +4 -1
- package/radio/README.md +1 -1
- package/scss/theme.scss +7 -1
- package/scss/theming/_color-palettes.scss +0 -6
- package/select/README.md +4 -4
- package/sidebar/README.md +6 -6
- package/spinner/README.md +57 -0
- package/spinner/index.d.ts +53 -0
- package/spinner/src/spinner-theme.scss +62 -0
- package/switch/README.md +4 -4
- package/switch/index.d.ts +2 -2
- package/tabs/README.md +1 -1
- package/tabs/index.d.ts +2 -2
- package/tag/README.md +24 -30
- package/tag/index.d.ts +1 -1
- package/text-snippet/README.md +1 -1
- package/text-snippet/src/text-snippet-theme.scss +12 -0
- package/textarea/README.md +4 -4
- package/textarea/index.d.ts +4 -4
- package/toast/README.md +4 -4
- package/tree/README.md +39 -22
- package/tree/index.d.ts +57 -90
package/accordion/README.md
CHANGED
|
@@ -4,7 +4,7 @@ An accordion is a group of vertically stacked, collapsible sections that allow u
|
|
|
4
4
|
## Overview
|
|
5
5
|
Accordions help reduce scrolling by hiding non-essential information until it's needed. They organize content into collapsible sections, making it easier for users to find and focus on information relevant to them. This is especially useful for long pages where not all information needs to be visible at once.
|
|
6
6
|
|
|
7
|
-
<
|
|
7
|
+
<daff-docs-example-viewer example="basic-accordion"></daff-docs-example-viewer>
|
|
8
8
|
|
|
9
9
|
## Best practices
|
|
10
10
|
|
|
@@ -17,7 +17,7 @@ Accordions help reduce scrolling by hiding non-essential information until it's
|
|
|
17
17
|
- The content is very short and hiding it adds unnecessary complexity (use [list](/libs/design/list/README.md) instead)
|
|
18
18
|
|
|
19
19
|
## Usage
|
|
20
|
-
|
|
20
|
+
Import `DAFF_ACCORDION_COMPONENTS` into your component:
|
|
21
21
|
|
|
22
22
|
```ts
|
|
23
23
|
import { DAFF_ACCORDION_COMPONENTS } from '@daffodil/design/accordion';
|
|
@@ -33,60 +33,48 @@ export class CustomComponent {}
|
|
|
33
33
|
```
|
|
34
34
|
|
|
35
35
|
## Anatomy
|
|
36
|
-
An accordion
|
|
36
|
+
An accordion is composed of a container, items, titles, and content:
|
|
37
37
|
|
|
38
|
-
### Container
|
|
39
|
-
**`<daff-accordion>`**: The wrapper component that groups all accordion items together.
|
|
40
|
-
|
|
41
|
-
### Item
|
|
42
|
-
**`<daff-accordion-item>`**: Individual collapsible section containing a title and content. Handles expansion and collapse on user interaction.
|
|
43
|
-
|
|
44
|
-
### Title
|
|
45
|
-
**`[daffAccordionItemTitle]`**: The clickable header that toggles the accordion item's visibility.
|
|
46
|
-
|
|
47
|
-
### Content
|
|
48
|
-
Content placed inside `<daff-accordion-item>` (excluding the title) forms the collapsible panel content that is shown or hidden when toggled.
|
|
49
|
-
|
|
50
|
-
### Basic structure
|
|
51
38
|
```html
|
|
52
39
|
<daff-accordion>
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
40
|
+
<daff-accordion-item>
|
|
41
|
+
<h3 daffAccordionItemTitle>Title</h3>
|
|
42
|
+
<div>Expandable content</div>
|
|
43
|
+
</daff-accordion-item>
|
|
57
44
|
</daff-accordion>
|
|
58
45
|
```
|
|
59
46
|
|
|
47
|
+
- **`<daff-accordion>`**: The wrapper component that groups all accordion items together.
|
|
48
|
+
- **`<daff-accordion-item>`**: Individual collapsible section containing a title and content. Handles expansion and collapse on user interaction.
|
|
49
|
+
- **`[daffAccordionItemTitle]`**: The clickable header that toggles the accordion item's visibility.
|
|
50
|
+
- **Content**: Content placed inside `<daff-accordion-item>` (excluding the title) forms the collapsible panel content that is shown or hidden when toggled.
|
|
51
|
+
|
|
60
52
|
## Features
|
|
61
53
|
|
|
62
|
-
###
|
|
54
|
+
### Expanding by default
|
|
63
55
|
Use the `initiallyExpanded` property on the accordion item to have an item open by default.
|
|
64
56
|
|
|
65
|
-
<
|
|
57
|
+
<daff-docs-example-viewer example="initially-expanded-accordion"></daff-docs-example-viewer>
|
|
66
58
|
|
|
67
|
-
###
|
|
59
|
+
### Disabling an item
|
|
68
60
|
Use the `disabled` property on the accordion item to disable and prevent it from being expanded or collapsed.
|
|
69
61
|
|
|
70
|
-
<
|
|
62
|
+
<daff-docs-example-viewer example="disabled-accordion"></daff-docs-example-viewer>
|
|
71
63
|
|
|
72
64
|
## Accessibility
|
|
73
65
|
Accordion follows the [Accordion WAI-ARIA design pattern](https://www.w3.org/WAI/ARIA/apg/patterns/accordion/).
|
|
74
66
|
|
|
75
|
-
|
|
76
|
-
- `role="button"`
|
|
77
|
-
-
|
|
78
|
-
- `
|
|
79
|
-
- `aria-controls` property linked to the associated panel content.
|
|
80
|
-
|
|
81
|
-
Content blocks include:
|
|
82
|
-
- `role="region"`
|
|
83
|
-
- A unique `id`, defined by the `itemId` property.
|
|
84
|
-
- `aria-labelledby` property linked to the corresponding title.
|
|
67
|
+
### Daffodil provides
|
|
68
|
+
- `role="button"` on titles with `aria-expanded` to indicate current state and `aria-controls` linking to the associated panel
|
|
69
|
+
- `role="region"` on content panels with `aria-labelledby` linking back to the corresponding title
|
|
70
|
+
- Unique IDs autogenerated for titles and panels (overridable via the `contentId` and `itemId` inputs on `<daff-accordion-item>`)
|
|
85
71
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
### Keyboard interactions
|
|
72
|
+
#### Keyboard interactions
|
|
89
73
|
| Key | Action |
|
|
90
74
|
| --- | ------ |
|
|
91
75
|
| `Tab` | Moves focus to the next focusable element. |
|
|
92
|
-
| `
|
|
76
|
+
| `Enter` / `Space` | Expands or collapses the focused accordion item's panel content. |
|
|
77
|
+
|
|
78
|
+
### Developer responsibilities
|
|
79
|
+
- Wrap titles in an appropriate heading element (`<h2>`, `<h3>`, etc.) so the accordion contributes to the page's heading structure
|
|
80
|
+
- Provide concise, descriptive title text
|
package/accordion/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import * as i0 from '@angular/core';
|
|
|
2
2
|
import { OnInit } from '@angular/core';
|
|
3
3
|
import * as i1$1 from '@angular/common';
|
|
4
4
|
import * as i1 from '@daffodil/design';
|
|
5
|
-
import { DaffOpenable, DaffOpenableDirective, DaffDisableableDirective } from '@daffodil/design';
|
|
5
|
+
import { DaffOpenable, DaffDisableable, DaffOpenableDirective, DaffDisableableDirective } from '@daffodil/design';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* Groups accordion items.
|
|
@@ -37,7 +37,7 @@ declare class DaffAccordionComponent {
|
|
|
37
37
|
* </daff-accordion-item>
|
|
38
38
|
* ```
|
|
39
39
|
*/
|
|
40
|
-
declare class DaffAccordionItemComponent implements OnInit, DaffOpenable {
|
|
40
|
+
declare class DaffAccordionItemComponent implements OnInit, DaffOpenable, DaffDisableable {
|
|
41
41
|
private openDirective;
|
|
42
42
|
private disabledDirective;
|
|
43
43
|
/**
|
package/article/README.md
CHANGED
|
@@ -1,52 +1,8 @@
|
|
|
1
1
|
# Article
|
|
2
|
-
Article provides styles
|
|
2
|
+
Article provides styles for common HTML elements to create readable, well-formatted content pages.
|
|
3
3
|
|
|
4
4
|
## Overview
|
|
5
|
-
Article
|
|
6
|
-
|
|
7
|
-
## Supported elements
|
|
8
|
-
|
|
9
|
-
### Headings
|
|
10
|
-
<design-land-example-viewer-container example="article-headings"></design-land-example-viewer-container>
|
|
11
|
-
|
|
12
|
-
### Article Meta
|
|
13
|
-
Meta is used if there is metadata information about your article (i.e. author name, date, etc). Meta is a custom directive of article and is not a native element selector. To use it, add `daffArticleMeta` to a paragraph (`<p>`).
|
|
14
|
-
|
|
15
|
-
<design-land-example-viewer-container example="article-meta"></design-land-example-viewer-container>
|
|
16
|
-
|
|
17
|
-
### Link
|
|
18
|
-
The link style in an article uses the default browser link style.
|
|
19
|
-
|
|
20
|
-
<design-land-example-viewer-container example="article-link"></design-land-example-viewer-container>
|
|
21
|
-
|
|
22
|
-
### Table
|
|
23
|
-
<design-land-example-viewer-container example="article-table"></design-land-example-viewer-container>
|
|
24
|
-
|
|
25
|
-
### Lists
|
|
26
|
-
|
|
27
|
-
#### Unordered list
|
|
28
|
-
<design-land-example-viewer-container example="article-ul"></design-land-example-viewer-container>
|
|
29
|
-
|
|
30
|
-
#### Ordered list
|
|
31
|
-
<design-land-example-viewer-container example="article-ol"></design-land-example-viewer-container>
|
|
32
|
-
|
|
33
|
-
### Code
|
|
34
|
-
These are styles for inline and multiline blocks of code. By default, a copy button is added to all code blocks. Disable this by adding a `nocopy` attribute to the `pre` element.
|
|
35
|
-
|
|
36
|
-
#### Inline code
|
|
37
|
-
<design-land-example-viewer-container example="article-code-inline"></design-land-example-viewer-container>
|
|
38
|
-
|
|
39
|
-
#### Code blocks
|
|
40
|
-
<design-land-example-viewer-container example="article-code-block"></design-land-example-viewer-container>
|
|
41
|
-
|
|
42
|
-
### Horizontal rules
|
|
43
|
-
<design-land-example-viewer-container example="article-hr"></design-land-example-viewer-container>
|
|
44
|
-
|
|
45
|
-
### Blockquote
|
|
46
|
-
<design-land-example-viewer-container example="article-blockquote"></design-land-example-viewer-container>
|
|
47
|
-
|
|
48
|
-
## Encapsulation
|
|
49
|
-
Articles also support other custom "non-native" components like [accordions](/libs/design/accordion/README.md), [media galleries](/libs/design/media-gallery/README.md), and [lists](/libs/design/list/README.md). Unlike typical HTML (`<p>`, `<ol>`, `<ul>`, etc) content, these components must be style encaspulated to prevent article styles bleeding down from the article into their content. Many Daffodil components support this out of the box. If you have a custom component that you would like to place inside an article, you can use the `DaffArticleEncapsulatedDirective` on your component to prevent article styles bleeding into your component.
|
|
5
|
+
Article is designed for content pages that display large blocks of text-driven information.
|
|
50
6
|
|
|
51
7
|
## Usage
|
|
52
8
|
|
|
@@ -88,4 +44,68 @@ import { CustomComponent } from './custom.component';
|
|
|
88
44
|
export class CustomComponentModule { }
|
|
89
45
|
```
|
|
90
46
|
|
|
47
|
+
> **Warning**
|
|
48
|
+
>
|
|
91
49
|
> This method is deprecated. It's recommended to update all custom components to standalone.
|
|
50
|
+
|
|
51
|
+
## Custom elements
|
|
52
|
+
|
|
53
|
+
### Meta
|
|
54
|
+
Meta displays article metadata such as author name and date. It's a custom directive, not a native element selector. To use it, add `daffArticleMeta` to a paragraph (`<p>`).
|
|
55
|
+
|
|
56
|
+
<daff-docs-example-viewer example="article-meta"></daff-docs-example-viewer>
|
|
57
|
+
|
|
58
|
+
## Features
|
|
59
|
+
|
|
60
|
+
### Heading anchor
|
|
61
|
+
`<h2>`, `<h3>`, and `<h4>` headings include an anchor link that directs users to that section and a copy button that copies the heading URL to the clipboard. To disable this, add a `nolink` attribute to the heading element.
|
|
62
|
+
|
|
63
|
+
<daff-docs-example-viewer example="article-headings"></daff-docs-example-viewer>
|
|
64
|
+
|
|
65
|
+
### Code copy
|
|
66
|
+
Code blocks include a copy button by default. To disable this, add a `nocopy` attribute to the `pre` element.
|
|
67
|
+
|
|
68
|
+
#### Inline code
|
|
69
|
+
<daff-docs-example-viewer example="article-code-inline"></daff-docs-example-viewer>
|
|
70
|
+
|
|
71
|
+
#### Code blocks
|
|
72
|
+
<daff-docs-example-viewer example="article-code-block"></daff-docs-example-viewer>
|
|
73
|
+
|
|
74
|
+
### Encapsulation
|
|
75
|
+
Articles support custom components like [accordion](/libs/design/accordion/README.md), [hero](/libs/design/hero/README.md), or [callout](/libs/design/callout/README.md). Unlike typical HTML elements (`<p>`, `<ol>`, `<ul>`, etc), these components must be style encapsulated to prevent article styles from bleeding into their content.
|
|
76
|
+
|
|
77
|
+
The following Daffodil Design components are already encapsulated and can be used directiy:
|
|
78
|
+
- Accordion
|
|
79
|
+
- Breadcrumb
|
|
80
|
+
- Button
|
|
81
|
+
- Callout
|
|
82
|
+
- Card
|
|
83
|
+
- Hero
|
|
84
|
+
- Link Set
|
|
85
|
+
- List
|
|
86
|
+
- Media Gallery
|
|
87
|
+
- Notification
|
|
88
|
+
- Tag
|
|
89
|
+
- Toast
|
|
90
|
+
- Tree
|
|
91
|
+
|
|
92
|
+
For custom components, use the `DaffArticleEncapsulatedDirective` to prevent article styles from bleeding in.
|
|
93
|
+
|
|
94
|
+
## Styled HTML elements
|
|
95
|
+
|
|
96
|
+
### Table
|
|
97
|
+
<daff-docs-example-viewer example="article-table"></daff-docs-example-viewer>
|
|
98
|
+
|
|
99
|
+
### Lists
|
|
100
|
+
|
|
101
|
+
#### Unordered list
|
|
102
|
+
<daff-docs-example-viewer example="article-ul"></daff-docs-example-viewer>
|
|
103
|
+
|
|
104
|
+
#### Ordered list
|
|
105
|
+
<daff-docs-example-viewer example="article-ol"></daff-docs-example-viewer>
|
|
106
|
+
|
|
107
|
+
### Horizontal rules
|
|
108
|
+
<daff-docs-example-viewer example="article-hr"></daff-docs-example-viewer>
|
|
109
|
+
|
|
110
|
+
### Blockquote
|
|
111
|
+
<daff-docs-example-viewer example="article-blockquote"></daff-docs-example-viewer>
|
package/article/index.d.ts
CHANGED
|
@@ -19,12 +19,33 @@ declare class DaffArticleCopyButtonService {
|
|
|
19
19
|
static ɵprov: i0.ɵɵInjectableDeclaration<DaffArticleCopyButtonService>;
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
+
declare class DaffArticleHeadingLinkService {
|
|
23
|
+
private links;
|
|
24
|
+
/**
|
|
25
|
+
* Finds all h2, h3, and h4 elements and wraps their text content with heading link components.
|
|
26
|
+
* @param hostElement - The host element to search for heading elements.
|
|
27
|
+
* @param viewContainerRef - The view container to create the heading link components.
|
|
28
|
+
*/
|
|
29
|
+
addLinksToHeadings(hostElement: HTMLElement, viewContainerRef: ViewContainerRef): void;
|
|
30
|
+
/**
|
|
31
|
+
* Cleanup heading link references
|
|
32
|
+
*/
|
|
33
|
+
cleanup(): void;
|
|
34
|
+
/**
|
|
35
|
+
* Generates a URL-friendly fragment from heading text
|
|
36
|
+
*/
|
|
37
|
+
private generateFragment;
|
|
38
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DaffArticleHeadingLinkService, never>;
|
|
39
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<DaffArticleHeadingLinkService>;
|
|
40
|
+
}
|
|
41
|
+
|
|
22
42
|
/**
|
|
23
43
|
* A component for creating articles within your page.
|
|
24
44
|
*/
|
|
25
45
|
declare class DaffArticleComponent {
|
|
26
46
|
private copyButtonService;
|
|
27
|
-
|
|
47
|
+
private headingLinkService;
|
|
48
|
+
constructor(copyButtonService: DaffArticleCopyButtonService, headingLinkService: DaffArticleHeadingLinkService);
|
|
28
49
|
static ɵfac: i0.ɵɵFactoryDeclaration<DaffArticleComponent, never>;
|
|
29
50
|
static ɵcmp: i0.ɵɵComponentDeclaration<DaffArticleComponent, "daff-article", never, {}, {}, never, ["*"], true, never>;
|
|
30
51
|
}
|
|
@@ -90,6 +90,12 @@
|
|
|
90
90
|
}
|
|
91
91
|
}
|
|
92
92
|
}
|
|
93
|
+
|
|
94
|
+
.daff-article-heading-link {
|
|
95
|
+
&__button {
|
|
96
|
+
color: daff-color($neutral, 70);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
93
99
|
}
|
|
94
100
|
|
|
95
101
|
@include dark($mode) {
|
|
@@ -168,6 +174,12 @@
|
|
|
168
174
|
}
|
|
169
175
|
}
|
|
170
176
|
}
|
|
177
|
+
|
|
178
|
+
.daff-article-heading-link {
|
|
179
|
+
&__button {
|
|
180
|
+
color: daff-color($neutral, 30);
|
|
181
|
+
}
|
|
182
|
+
}
|
|
171
183
|
}
|
|
172
184
|
}
|
|
173
185
|
}
|
package/breadcrumb/README.md
CHANGED
|
@@ -4,7 +4,7 @@ A breadcrumb is a secondary navigation pattern that shows users their current lo
|
|
|
4
4
|
## Overview
|
|
5
5
|
Breadcrumbs visually represent the navigational structure of a site or app and help users navigate to parent levels with ease. Each breadcrumb item corresponds to a level in the hierarchy, with the last item indicating the current page or context.
|
|
6
6
|
|
|
7
|
-
<
|
|
7
|
+
<daff-docs-example-viewer example="basic-breadcrumb"></daff-docs-example-viewer>
|
|
8
8
|
|
|
9
9
|
## Best practices
|
|
10
10
|
|
|
@@ -79,6 +79,11 @@ A breadcrumb consists of the following components:
|
|
|
79
79
|
</ol>
|
|
80
80
|
```
|
|
81
81
|
|
|
82
|
+
## Features
|
|
83
|
+
|
|
84
|
+
### Truncation
|
|
85
|
+
Breadcrumbs are automatically truncated into an overflow menu on mobile viewports. On desktop, truncation occurs when more than five items are present.
|
|
86
|
+
|
|
82
87
|
## Accessibility
|
|
83
88
|
Breadcrumb follows the [Breadcrumb WAI-ARIA design pattern](https://www.w3.org/WAI/ARIA/apg/patterns/breadcrumb/).
|
|
84
89
|
|
package/breadcrumb/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { ChangeDetectorRef, AfterContentInit, DestroyRef, QueryList } from '@angular/core';
|
|
2
|
+
import { TemplateRef, ChangeDetectorRef, AfterContentInit, DestroyRef, QueryList } from '@angular/core';
|
|
3
|
+
import { BreakpointObserver } from '@angular/cdk/layout';
|
|
3
4
|
import * as i1 from '@daffodil/design';
|
|
4
5
|
|
|
5
6
|
/**
|
|
@@ -12,15 +13,32 @@ import * as i1 from '@daffodil/design';
|
|
|
12
13
|
* </li>
|
|
13
14
|
* ```
|
|
14
15
|
*/
|
|
15
|
-
declare class
|
|
16
|
+
declare class DaffBreadcrumbItemComponent {
|
|
16
17
|
private cdRef;
|
|
17
|
-
|
|
18
|
+
/**
|
|
19
|
+
* @docs-private
|
|
20
|
+
*/
|
|
21
|
+
itemRef: TemplateRef<any>;
|
|
22
|
+
/**
|
|
23
|
+
* @docs-private
|
|
24
|
+
*/
|
|
25
|
+
_active: boolean;
|
|
18
26
|
constructor(cdRef: ChangeDetectorRef);
|
|
19
27
|
/** Called by the DaffBreadcrumbComponent to set the active state */
|
|
20
28
|
setActive(value: boolean): void;
|
|
21
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<
|
|
22
|
-
static
|
|
29
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DaffBreadcrumbItemComponent, never>;
|
|
30
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<DaffBreadcrumbItemComponent, "li[daffBreadcrumbItem]", never, {}, {}, never, ["*"], true, never>;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
interface DaffBreadcrumbRenderItem {
|
|
34
|
+
item: DaffBreadcrumbItemComponent;
|
|
35
|
+
type: 'breadcrumb';
|
|
36
|
+
}
|
|
37
|
+
interface DaffBreadcrumbRenderMenu {
|
|
38
|
+
type: 'menu';
|
|
39
|
+
target: 'mobileMenu' | 'desktopMenu';
|
|
23
40
|
}
|
|
41
|
+
type DaffBreadcrumbRender = DaffBreadcrumbRenderItem | DaffBreadcrumbRenderMenu;
|
|
24
42
|
|
|
25
43
|
/**
|
|
26
44
|
* Groups breadcrumb items. Must be applied to a native `<ol>` element.
|
|
@@ -39,32 +57,68 @@ declare class DaffBreadcrumbItemDirective {
|
|
|
39
57
|
*/
|
|
40
58
|
declare class DaffBreadcrumbComponent implements AfterContentInit {
|
|
41
59
|
private destroyRef;
|
|
42
|
-
|
|
60
|
+
private breakpointObserver;
|
|
61
|
+
constructor(destroyRef: DestroyRef, breakpointObserver: BreakpointObserver);
|
|
62
|
+
/**
|
|
63
|
+
* @docs-private
|
|
64
|
+
*/
|
|
65
|
+
_isMobile: i0.WritableSignal<boolean>;
|
|
66
|
+
/**
|
|
67
|
+
* @docs-private
|
|
68
|
+
*/
|
|
69
|
+
breadcrumbItems: QueryList<DaffBreadcrumbItemComponent>;
|
|
70
|
+
/**
|
|
71
|
+
* @docs-private
|
|
72
|
+
*/
|
|
73
|
+
fullMenu: TemplateRef<unknown>;
|
|
74
|
+
/**
|
|
75
|
+
* @docs-private
|
|
76
|
+
*/
|
|
77
|
+
partialMenu: TemplateRef<unknown>;
|
|
78
|
+
/**
|
|
79
|
+
* @docs-private
|
|
80
|
+
*/
|
|
81
|
+
_breadcrumbItems: i0.Signal<readonly DaffBreadcrumbItemComponent[]>;
|
|
82
|
+
/**
|
|
83
|
+
* @docs-private
|
|
84
|
+
*/
|
|
85
|
+
_partition: i0.Signal<{
|
|
86
|
+
visible: DaffBreadcrumbRender[];
|
|
87
|
+
menu: DaffBreadcrumbItemComponent[];
|
|
88
|
+
}>;
|
|
89
|
+
/**
|
|
90
|
+
* @docs-private
|
|
91
|
+
*/
|
|
92
|
+
_computedBreadcrumbItems: i0.Signal<DaffBreadcrumbRender[]>;
|
|
93
|
+
/**
|
|
94
|
+
* @docs-private
|
|
95
|
+
*/
|
|
96
|
+
_desktopMenuItems: i0.Signal<DaffBreadcrumbItemComponent[]>;
|
|
43
97
|
/**
|
|
44
98
|
* @docs-private
|
|
45
99
|
*/
|
|
46
|
-
|
|
100
|
+
_mobileMenuItems: i0.Signal<DaffBreadcrumbItemComponent[]>;
|
|
47
101
|
/**
|
|
48
102
|
* @docs-private
|
|
49
103
|
*/
|
|
50
104
|
ngAfterContentInit(): void;
|
|
51
105
|
private updateActiveState;
|
|
52
106
|
static ɵfac: i0.ɵɵFactoryDeclaration<DaffBreadcrumbComponent, never>;
|
|
53
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<DaffBreadcrumbComponent, "ol[daff-breadcrumb]", never, {}, {}, ["
|
|
107
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<DaffBreadcrumbComponent, "ol[daff-breadcrumb]", never, {}, {}, ["_breadcrumbItems", "breadcrumbItems"], never, true, [{ directive: typeof i1.DaffArticleEncapsulatedDirective; inputs: {}; outputs: {}; }, { directive: typeof i1.DaffSkeletonableDirective; inputs: { "skeleton": "skeleton"; }; outputs: {}; }]>;
|
|
54
108
|
}
|
|
55
109
|
|
|
56
110
|
/**
|
|
57
111
|
* @docs-private
|
|
58
112
|
*/
|
|
59
|
-
declare const DAFF_BREADCRUMB_COMPONENTS: readonly [typeof DaffBreadcrumbComponent, typeof
|
|
113
|
+
declare const DAFF_BREADCRUMB_COMPONENTS: readonly [typeof DaffBreadcrumbComponent, typeof DaffBreadcrumbItemComponent];
|
|
60
114
|
|
|
61
115
|
/**
|
|
62
116
|
* @deprecated in favor of {@link DAFF_BREADCRUMB_COMPONENTS}. Deprecated in version 0.78.0. Will be removed in version 1.0.0.
|
|
63
117
|
*/
|
|
64
118
|
declare class DaffBreadcrumbModule {
|
|
65
119
|
static ɵfac: i0.ɵɵFactoryDeclaration<DaffBreadcrumbModule, never>;
|
|
66
|
-
static ɵmod: i0.ɵɵNgModuleDeclaration<DaffBreadcrumbModule, never, [typeof DaffBreadcrumbComponent, typeof
|
|
120
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<DaffBreadcrumbModule, never, [typeof DaffBreadcrumbComponent, typeof DaffBreadcrumbItemComponent], [typeof DaffBreadcrumbComponent, typeof DaffBreadcrumbItemComponent]>;
|
|
67
121
|
static ɵinj: i0.ɵɵInjectorDeclaration<DaffBreadcrumbModule>;
|
|
68
122
|
}
|
|
69
123
|
|
|
70
|
-
export { DAFF_BREADCRUMB_COMPONENTS, DaffBreadcrumbComponent,
|
|
124
|
+
export { DAFF_BREADCRUMB_COMPONENTS, DaffBreadcrumbComponent, DaffBreadcrumbItemComponent, DaffBreadcrumbModule };
|
package/button/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Buttons make actions apparent to users and can navigate to different pages or perform actions. They can display text, icons, or both.
|
|
3
3
|
|
|
4
4
|
## Overview
|
|
5
|
-
Button supports
|
|
5
|
+
Button supports four variants that change its visual style, each applied as an attribute:
|
|
6
6
|
|
|
7
7
|
| Attribute | Description |
|
|
8
8
|
| --------- | ----------- |
|
|
@@ -10,7 +10,6 @@ Button supports five variants that change its visual style, each applied as an a
|
|
|
10
10
|
| `daff-flat-button`| Rectangular button with no outline or background color |
|
|
11
11
|
| `daff-icon-button` | Icon only button used with icon fonts |
|
|
12
12
|
| `daff-stroked-button` | Rectangular button with oultline, no background color |
|
|
13
|
-
| `daff-underline-button` | Text button with underline styling |
|
|
14
13
|
|
|
15
14
|
Native `<button>` or `<a>` elements should always be used in order to provide an easy, accessible experience for users.
|
|
16
15
|
|
|
@@ -18,24 +17,21 @@ Native `<button>` or `<a>` elements should always be used in order to provide an
|
|
|
18
17
|
- Use `<button>` for actions performed within the same page.
|
|
19
18
|
|
|
20
19
|
**Basic button**
|
|
21
|
-
<
|
|
20
|
+
<daff-docs-example-viewer example="basic-button"></daff-docs-example-viewer>
|
|
22
21
|
|
|
23
22
|
**Flat button**
|
|
24
|
-
<
|
|
23
|
+
<daff-docs-example-viewer example="flat-button"></daff-docs-example-viewer>
|
|
25
24
|
|
|
26
25
|
**Stroked button**
|
|
27
|
-
<
|
|
26
|
+
<daff-docs-example-viewer example="stroked-button"></daff-docs-example-viewer>
|
|
28
27
|
|
|
29
28
|
> `dark`, `light`, and `theme` should be used with caution to ensure that there is sufficient contrast.
|
|
30
29
|
|
|
31
30
|
**Icon button**
|
|
32
|
-
<
|
|
31
|
+
<daff-docs-example-viewer example="icon-button"></daff-docs-example-viewer>
|
|
33
32
|
|
|
34
33
|
> `dark`, `light`, and `theme` should be used with caution to ensure that there is sufficient contrast.
|
|
35
34
|
|
|
36
|
-
**Underline button**
|
|
37
|
-
<design-land-example-viewer-container example="underline-button"></design-land-example-viewer-container>
|
|
38
|
-
|
|
39
35
|
## Usage
|
|
40
36
|
|
|
41
37
|
### Within a standalone component
|
|
@@ -46,7 +42,6 @@ Available imports:
|
|
|
46
42
|
- `DAFF_FLAT_BUTTON_COMPONENTS`
|
|
47
43
|
- `DAFF_ICON_BUTTON_COMPONENTS`
|
|
48
44
|
- `DAFF_STROKED_BUTTON_COMPONENTS`
|
|
49
|
-
- `DAFF_UNDERLINE_BUTTON_COMPONENTS`
|
|
50
45
|
- `DAFF_BUTTON_COMPONENTS` (all types)
|
|
51
46
|
|
|
52
47
|
```ts
|
|
@@ -92,43 +87,51 @@ Buttons should always have a label, unless you are only using an icon that is un
|
|
|
92
87
|
### Icon support
|
|
93
88
|
An icon can be rendered on either side of the button text content with the `daffPrefix` and `daffSuffix` selectors. Avoid using both simultaneously.
|
|
94
89
|
|
|
95
|
-
|
|
96
|
-
<button daff-button>
|
|
97
|
-
<fa-icon [faIcon]="faUser" daffPrefix></fa-icon>
|
|
98
|
-
Button label
|
|
99
|
-
</button>
|
|
100
|
-
|
|
101
|
-
<button daff-button>
|
|
102
|
-
Button label
|
|
103
|
-
<fa-icon [faIcon]="faArrowRight" daffPrefix></fa-icon>
|
|
104
|
-
</button>
|
|
105
|
-
```
|
|
106
|
-
|
|
107
|
-
## Sizes
|
|
108
|
-
Use the `size` property to control button dimensions. The default size is `md`.
|
|
90
|
+
<daff-docs-example-viewer example="button-with-icon"></daff-docs-example-viewer>
|
|
109
91
|
|
|
110
|
-
|
|
92
|
+
## Features
|
|
111
93
|
|
|
112
|
-
|
|
94
|
+
### Colors
|
|
113
95
|
Use the `color` property to change the color of a button.
|
|
114
96
|
|
|
115
97
|
> Note: `dark`, `light`, and `theme` should be used on appropriate backgrounds for sufficient contrast.
|
|
116
98
|
|
|
117
|
-
|
|
99
|
+
### Elevation
|
|
100
|
+
Add shadows to buttons with the `elevated` property.
|
|
101
|
+
|
|
102
|
+
> Note: The `elevated` property is not supported for flat, icon, and underline buttons.
|
|
103
|
+
|
|
104
|
+
<daff-docs-example-viewer example="elevated-button"></daff-docs-example-viewer>
|
|
105
|
+
|
|
106
|
+
### Sizes
|
|
107
|
+
Use the `size` property to control button dimensions. The default size is `md`.
|
|
108
|
+
|
|
109
|
+
<daff-docs-example-viewer example="button-sizes"></daff-docs-example-viewer>
|
|
110
|
+
|
|
111
|
+
### Status indicators
|
|
118
112
|
Status indicators help users understand the type of action a button performs and its importance relative to other buttons in the same context. Use the `status` property to convey different semantic meanings.
|
|
119
113
|
|
|
120
|
-
<
|
|
114
|
+
<daff-docs-example-viewer example="statusable-button"></daff-docs-example-viewer>
|
|
121
115
|
|
|
122
|
-
##
|
|
123
|
-
Add shadows to buttons with the `elevated` property.
|
|
116
|
+
## States
|
|
124
117
|
|
|
125
|
-
|
|
118
|
+
### Disabled
|
|
119
|
+
Use the `disabled` property to disable a button that shouldn't be actionable. The button will appear faded and won't respond to user interaction.
|
|
120
|
+
|
|
121
|
+
<daff-docs-example-viewer example="disabled-button"></daff-docs-example-viewer>
|
|
126
122
|
|
|
127
|
-
|
|
123
|
+
### Loading
|
|
124
|
+
Use the `loading` property to indicate that an action is being processed. When `loading` is set to `true`, the button displays a spinner.
|
|
125
|
+
|
|
126
|
+
<daff-docs-example-viewer example="loading-button"></daff-docs-example-viewer>
|
|
128
127
|
|
|
129
128
|
## Accessbility
|
|
130
129
|
Daffodil uses native `<a>` and `<button>` HTML elements to ensure an accessible experience by default.
|
|
131
130
|
|
|
132
131
|
- Use `<a>` for navigation to new pages or different sections.
|
|
133
132
|
- Use `<button>` for actions performed within the same page.
|
|
134
|
-
- Icon only buttons (`<daff-icon-button>`) need to be given meaningful labels using `aria-label` or `aria-labelledby`.
|
|
133
|
+
- Icon only buttons (`<daff-icon-button>`) need to be given meaningful labels using `aria-label` or `aria-labelledby`.
|
|
134
|
+
|
|
135
|
+
## Deprecations
|
|
136
|
+
- `<daff-raised-button>` is deprecated and will be removed in v1.0.0. Use the `elevated` property instead.
|
|
137
|
+
- `<daff-underline-button>` is deprecated and will be removed in v1.0.0.
|