@hashicorp/design-system-components 0.12.5 → 0.12.6

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 CHANGED
@@ -1,5 +1,11 @@
1
1
  # @hashicorp/design-system-components
2
2
 
3
+ ## 0.12.6
4
+
5
+ ### Patch Changes
6
+
7
+ - [#399](https://github.com/hashicorp/design-system/pull/399) [`62e3077e`](https://github.com/hashicorp/design-system/commit/62e3077e5cf40e93852e9fa3489d3d1970d45070) Thanks [@alex-ju](https://github.com/alex-ju)! - Enable programmatic close on dropdown component
8
+
3
9
  ## 0.12.5
4
10
 
5
11
  ### Patch Changes
@@ -11,7 +11,7 @@
11
11
  </div>
12
12
  {{#if this.isOpen}}
13
13
  <div class="hds-disclosure__content" tabindex="-1">
14
- {{yield to="content"}}
14
+ {{yield (hash close=this.close) to="content"}}
15
15
  </div>
16
16
  {{/if}}
17
17
  </div>
@@ -29,20 +29,20 @@ export default class HdsDisclosureComponent extends Component {
29
29
  !event.relatedTarget || // click or tap a non-related target (e.g. outside the element)
30
30
  !this.element.contains(event.relatedTarget) // move focus to a target outside the element
31
31
  ) {
32
- this.deactivate();
32
+ this.close();
33
33
  }
34
34
  }
35
35
 
36
36
  @action
37
37
  onKeyUp(event) {
38
38
  if (event.key === 'Escape') {
39
- this.deactivate();
39
+ this.close();
40
40
  this.toggleRef.focus();
41
41
  }
42
42
  }
43
43
 
44
44
  @action
45
- deactivate() {
45
+ close() {
46
46
  if (this.isOpen) {
47
47
  this.isOpen = false;
48
48
  }
@@ -7,10 +7,11 @@
7
7
  )
8
8
  }}
9
9
  </:toggle>
10
- <:content>
10
+ <:content as |c|>
11
11
  <ul class={{this.listClassNames}} {{style width=@width}}>
12
12
  {{yield
13
13
  (hash
14
+ close=c.close
14
15
  CopyItem=(component "hds/dropdown/list-item/copy-item")
15
16
  Description=(component "hds/dropdown/list-item/description")
16
17
  Generic=(component "hds/dropdown/list-item/generic")
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hashicorp/design-system-components",
3
- "version": "0.12.5",
3
+ "version": "0.12.6",
4
4
  "description": "HashiCorp Design System Components",
5
5
  "keywords": [
6
6
  "hashicorp",
@@ -50,7 +50,7 @@
50
50
  "@embroider/test-setup": "^1.5.0",
51
51
  "@glimmer/component": "^1.0.4",
52
52
  "@glimmer/tracking": "^1.0.4",
53
- "@percy/cli": "^1.3.0",
53
+ "@percy/cli": "^1.3.1",
54
54
  "@percy/ember": "^3.0.0",
55
55
  "babel-eslint": "^10.1.0",
56
56
  "broccoli-asset-rev": "^3.0.0",