@hashicorp/design-system-components 0.11.1 → 0.11.2
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/CHANGELOG.md +6 -0
- package/addon/components/hds/breadcrumb/truncation.hbs +1 -0
- package/addon/components/hds/disclosure/index.hbs +2 -2
- package/addon/components/hds/disclosure/index.js +4 -4
- package/addon/components/hds/dropdown/index.hbs +2 -2
- package/addon/components/hds/dropdown/toggle/button.hbs +1 -0
- package/addon/components/hds/dropdown/toggle/icon.hbs +8 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @hashicorp/design-system-components
|
|
2
2
|
|
|
3
|
+
## 0.11.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#301](https://github.com/hashicorp/design-system/pull/301) [`4976379e`](https://github.com/hashicorp/design-system/commit/4976379e1b080c7753ceee2affe8cadc053296e5) Thanks [@alex-ju](https://github.com/alex-ju)! - Convey the disclosure state to assistive tech for dropdown and truncated breadcrumbs
|
|
8
|
+
|
|
3
9
|
## 0.11.1
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
|
@@ -7,9 +7,9 @@
|
|
|
7
7
|
{{on "keyup" this.onKeyUp}}
|
|
8
8
|
>
|
|
9
9
|
<div class="hds-disclosure__toggle" tabindex="-1">
|
|
10
|
-
{{yield (hash onClickToggle=this.onClickToggle
|
|
10
|
+
{{yield (hash onClickToggle=this.onClickToggle isOpen=this.isOpen) to="toggle"}}
|
|
11
11
|
</div>
|
|
12
|
-
{{#if this.
|
|
12
|
+
{{#if this.isOpen}}
|
|
13
13
|
<div class="hds-disclosure__content" tabindex="-1">
|
|
14
14
|
{{yield to="content"}}
|
|
15
15
|
</div>
|
|
@@ -3,7 +3,7 @@ import { tracked } from '@glimmer/tracking';
|
|
|
3
3
|
import { action } from '@ember/object';
|
|
4
4
|
|
|
5
5
|
export default class HdsDisclosureComponent extends Component {
|
|
6
|
-
@tracked
|
|
6
|
+
@tracked isOpen; // notice: if in the future we need to add a "@isOpen" prop to control the status from outside (eg to have the Disclosure opened on render) just add "this.args.isOpen" here to initalize the variable
|
|
7
7
|
@tracked toggleRef;
|
|
8
8
|
@tracked isToggleClicked;
|
|
9
9
|
|
|
@@ -18,7 +18,7 @@ export default class HdsDisclosureComponent extends Component {
|
|
|
18
18
|
if (!this.toggleRef) {
|
|
19
19
|
this.toggleRef = event.currentTarget;
|
|
20
20
|
}
|
|
21
|
-
this.
|
|
21
|
+
this.isOpen = !this.isOpen;
|
|
22
22
|
// we explicitly apply a focus state to the toggle element to overcome a bug in WebKit (see b8abfcf)
|
|
23
23
|
this.toggleRef.focus();
|
|
24
24
|
}
|
|
@@ -43,8 +43,8 @@ export default class HdsDisclosureComponent extends Component {
|
|
|
43
43
|
|
|
44
44
|
@action
|
|
45
45
|
deactivate() {
|
|
46
|
-
if (this.
|
|
47
|
-
this.
|
|
46
|
+
if (this.isOpen) {
|
|
47
|
+
this.isOpen = false;
|
|
48
48
|
}
|
|
49
49
|
// we call the "onClose" callback if it exists (and is a function)
|
|
50
50
|
if (this.args.onClose && typeof this.args.onClose === 'function') {
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
<:toggle as |t|>
|
|
3
3
|
{{yield
|
|
4
4
|
(hash
|
|
5
|
-
ToggleButton=(component "hds/dropdown/toggle/button" isOpen=t.
|
|
6
|
-
ToggleIcon=(component "hds/dropdown/toggle/icon" isOpen=t.
|
|
5
|
+
ToggleButton=(component "hds/dropdown/toggle/button" isOpen=t.isOpen onClick=t.onClickToggle)
|
|
6
|
+
ToggleIcon=(component "hds/dropdown/toggle/icon" isOpen=t.isOpen onClick=t.onClickToggle)
|
|
7
7
|
)
|
|
8
8
|
}}
|
|
9
9
|
</:toggle>
|
|
@@ -1,4 +1,11 @@
|
|
|
1
|
-
<button
|
|
1
|
+
<button
|
|
2
|
+
class={{this.classNames}}
|
|
3
|
+
aria-label={{this.text}}
|
|
4
|
+
...attributes
|
|
5
|
+
aria-expanded={{if @isOpen "true" "false"}}
|
|
6
|
+
{{on "click" this.onClick}}
|
|
7
|
+
type="button"
|
|
8
|
+
>
|
|
2
9
|
<div class="hds-dropdown-toggle-icon__wrapper">
|
|
3
10
|
{{#if @imageSrc}}
|
|
4
11
|
<img src={{@imageSrc}} alt="" role="presentation" height="32" width="32" />
|