@hashicorp/design-system-components 2.3.3 → 2.4.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.
Files changed (44) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/README.md +1 -1
  3. package/addon/components/hds/breadcrumb/index.hbs +1 -1
  4. package/addon/components/hds/breadcrumb/index.js +9 -0
  5. package/addon/components/hds/breadcrumb/truncation.hbs +3 -3
  6. package/addon/components/hds/breadcrumb/truncation.js +12 -0
  7. package/addon/components/hds/disclosure-primitive/index.hbs +14 -0
  8. package/addon/components/hds/disclosure-primitive/index.js +30 -0
  9. package/addon/components/hds/dismiss-button/index.hbs +1 -1
  10. package/addon/components/hds/dismiss-button/index.js +12 -0
  11. package/addon/components/hds/dropdown/index.hbs +2 -2
  12. package/addon/components/hds/dropdown/list-item/checkbox.js +1 -1
  13. package/addon/components/hds/dropdown/list-item/checkmark.hbs +2 -1
  14. package/addon/components/hds/dropdown/list-item/radio.js +1 -1
  15. package/addon/components/hds/flyout/index.js +2 -2
  16. package/addon/components/hds/form/field/index.js +2 -2
  17. package/addon/components/hds/form/fieldset/index.js +2 -2
  18. package/addon/components/hds/form/radio-card/index.js +1 -1
  19. package/addon/components/hds/{disclosure → menu-primitive}/index.hbs +5 -4
  20. package/addon/components/hds/{disclosure → menu-primitive}/index.js +3 -3
  21. package/addon/components/hds/modal/index.js +2 -2
  22. package/addon/components/hds/pagination/compact/index.hbs +1 -1
  23. package/addon/components/hds/pagination/compact/index.js +9 -0
  24. package/addon/components/hds/pagination/numbered/index.hbs +1 -1
  25. package/addon/components/hds/pagination/numbered/index.js +11 -2
  26. package/addon/components/hds/side-nav/index.hbs +1 -2
  27. package/addon/components/hds/side-nav/index.js +13 -1
  28. package/addon/components/hds/table/index.js +1 -1
  29. package/addon/components/hds/tabs/index.hbs +2 -1
  30. package/addon/components/hds/tabs/tab.hbs +2 -1
  31. package/addon/components/hds/tag/index.hbs +1 -1
  32. package/addon/components/hds/tag/index.js +10 -0
  33. package/app/components/hds/disclosure-primitive/index.js +6 -0
  34. package/app/components/hds/{disclosure → menu-primitive}/index.js +1 -1
  35. package/app/styles/@hashicorp/design-system-components.scss +2 -1
  36. package/app/styles/components/disclosure-primitive.scss +13 -0
  37. package/app/styles/components/dropdown.scss +1 -1
  38. package/app/styles/components/{disclosure.scss → menu-primitive.scss} +2 -2
  39. package/app/styles/components/tooltip.scss +3 -0
  40. package/app/utils/hds-get-element-id.js +6 -0
  41. package/app/utils/hds-set-aria-described-by.js +6 -0
  42. package/package.json +2 -2
  43. /package/addon/{components/hds/form/utils/getElementId.js → utils/hds-get-element-id.js} +0 -0
  44. /package/addon/{components/hds/form/utils/setAriaDescribedBy.js → utils/hds-set-aria-described-by.js} +0 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,26 @@
1
1
  # @hashicorp/design-system-components
2
2
 
3
+ ## 2.4.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [[`2c7d70868`](https://github.com/hashicorp/design-system/commit/2c7d70868b0fa000618214589e2422e07db68b22)]:
8
+ - @hashicorp/ember-flight-icons@3.0.3
9
+
10
+ ## 2.4.0
11
+
12
+ ### Minor Changes
13
+
14
+ - [#1371](https://github.com/hashicorp/design-system/pull/1371) [`aa2be65cf`](https://github.com/hashicorp/design-system/commit/aa2be65cf3df7742c09d772b4f14b2b56f549b53) Thanks [@KristinLBradley](https://github.com/KristinLBradley)! - Refactor `Hds::Disclosure` internal utility component into two new components:
15
+ - Rename the original `Hds::Disclosure` component to `Hds::MenuPrimitive`
16
+ - Add a new `Hds::DisclosurePrimitive` component stripped of the “click outside/unfocus/esc to close” functionality
17
+
18
+ ### Patch Changes
19
+
20
+ - [#1373](https://github.com/hashicorp/design-system/pull/1373) [`b2949f208`](https://github.com/hashicorp/design-system/commit/b2949f2087b0e52574a927bb095dc748a6aa81c3) Thanks [@MelSumner](https://github.com/MelSumner)! - Updates aria-label support for consistency. Consumers can now see in the component API docs where `@ariaLabel` is supported for a custom value, and what the fallback value is.
21
+
22
+ - [#1364](https://github.com/hashicorp/design-system/pull/1364) [`3e1543077`](https://github.com/hashicorp/design-system/commit/3e1543077960d682c9e16d335a894186cf2ef6ad) Thanks [@alex-ju](https://github.com/alex-ju)! - Prevent `Tooltip` content from overflowing
23
+
3
24
  ## 2.3.3
4
25
 
5
26
  ### Patch Changes
package/README.md CHANGED
@@ -53,7 +53,7 @@ Finally, add this line to the top of your app's style file (`app.scss` or simila
53
53
  Usage
54
54
  ------------------------------------------------------------------------------
55
55
 
56
- See the dedicated components website: https://design-system-components-hashicorp.vercel.app/
56
+ See the dedicated components website: https://helios.hashicorp.design/components
57
57
 
58
58
 
59
59
  Contributing
@@ -2,7 +2,7 @@
2
2
  Copyright (c) HashiCorp, Inc.
3
3
  SPDX-License-Identifier: MPL-2.0
4
4
  }}
5
- <nav class={{this.classNames}} aria-label="breadcrumbs" ...attributes>
5
+ <nav class={{this.classNames}} aria-label={{this.ariaLabel}} ...attributes>
6
6
  <ol class="hds-breadcrumb__list" {{did-insert this.didInsert}}>
7
7
  {{yield}}
8
8
  </ol>
@@ -32,6 +32,15 @@ export default class HdsBreadcrumbComponent extends Component {
32
32
  return this.args.itemsCanWrap ?? true;
33
33
  }
34
34
 
35
+ /**
36
+ * @param ariaLabel
37
+ * @type {string}
38
+ * @default 'breadcrumbs'
39
+ */
40
+ get ariaLabel() {
41
+ return this.args.ariaLabel ?? 'breadcrumbs';
42
+ }
43
+
35
44
  /**
36
45
  * Get the class names to apply to the component.
37
46
  * @method Breadcrumb#classNames
@@ -3,12 +3,12 @@
3
3
  SPDX-License-Identifier: MPL-2.0
4
4
  }}
5
5
  <li class="hds-breadcrumb__item hds-breadcrumb__item--is-truncation" ...attributes>
6
- <Hds::Disclosure>
6
+ <Hds::MenuPrimitive>
7
7
  <:toggle as |t|>
8
8
  <button
9
9
  type="button"
10
10
  class="hds-breadcrumb__truncation-toggle"
11
- aria-label="show more"
11
+ aria-label={{this.ariaLabel}}
12
12
  aria-expanded={{if t.isOpen "true" "false"}}
13
13
  {{on "click" t.onClickToggle}}
14
14
  >
@@ -22,5 +22,5 @@
22
22
  </ol>
23
23
  </div>
24
24
  </:content>
25
- </Hds::Disclosure>
25
+ </Hds::MenuPrimitive>
26
26
  </li>
@@ -0,0 +1,12 @@
1
+ import Component from '@glimmer/component';
2
+
3
+ export default class HdsBreadcrumbTruncationComponent extends Component {
4
+ /**
5
+ * @param ariaLabel
6
+ * @type {string}
7
+ * @default 'show more'
8
+ */
9
+ get ariaLabel() {
10
+ return this.args.ariaLabel ?? 'show more';
11
+ }
12
+ }
@@ -0,0 +1,14 @@
1
+ {{!
2
+ Copyright (c) HashiCorp, Inc.
3
+ SPDX-License-Identifier: MPL-2.0
4
+ }}
5
+ <div class="hds-disclosure-primitive" ...attributes>
6
+ <div class="hds-disclosure-primitive__toggle">
7
+ {{yield (hash onClickToggle=this.onClickToggle isOpen=this.isOpen) to="toggle"}}
8
+ </div>
9
+ {{#if this.isOpen}}
10
+ <div class="hds-disclosure-primitive__content">
11
+ {{yield (hash close=this.close) to="content"}}
12
+ </div>
13
+ {{/if}}
14
+ </div>
@@ -0,0 +1,30 @@
1
+ /**
2
+ * Copyright (c) HashiCorp, Inc.
3
+ * SPDX-License-Identifier: MPL-2.0
4
+ */
5
+
6
+ import Component from '@glimmer/component';
7
+ import { tracked } from '@glimmer/tracking';
8
+ import { action } from '@ember/object';
9
+ import { schedule } from '@ember/runloop';
10
+
11
+ export default class HdsDisclosurePrimitiveComponent extends Component {
12
+ @tracked isOpen; // notice: if in the future we need to add a "@isOpen" prop to control the status from outside (eg to have the DisclosurePrimitive opened on render) just add "this.args.isOpen" here to initalize the variable
13
+
14
+ @action
15
+ onClickToggle() {
16
+ this.isOpen = !this.isOpen;
17
+ }
18
+
19
+ @action
20
+ close() {
21
+ // we schedule this afterRender to avoid an error in tests caused by updating `isOpen` multiple times in the same computation
22
+ schedule('afterRender', () => {
23
+ this.isOpen = false;
24
+ // we call the "onClose" callback if it exists (and is a function)
25
+ if (this.args.onClose && typeof this.args.onClose === 'function') {
26
+ this.args.onClose();
27
+ }
28
+ });
29
+ }
30
+ }
@@ -2,6 +2,6 @@
2
2
  Copyright (c) HashiCorp, Inc.
3
3
  SPDX-License-Identifier: MPL-2.0
4
4
  }}
5
- <button class="hds-dismiss-button" type="button" aria-label="Dismiss" ...attributes>
5
+ <button class="hds-dismiss-button" type="button" aria-label={{this.ariaLabel}} ...attributes>
6
6
  <FlightIcon @name="x" @size="16" @isInlineBlock={{false}} />
7
7
  </button>
@@ -0,0 +1,12 @@
1
+ import Component from '@glimmer/component';
2
+
3
+ export default class HdsDismissButtonIndexComponent extends Component {
4
+ /**
5
+ * @param ariaLabel
6
+ * @type {string}
7
+ * @default 'Dismiss'
8
+ */
9
+ get ariaLabel() {
10
+ return this.args.ariaLabel ?? 'Dismiss';
11
+ }
12
+ }
@@ -2,7 +2,7 @@
2
2
  Copyright (c) HashiCorp, Inc.
3
3
  SPDX-License-Identifier: MPL-2.0
4
4
  }}
5
- <Hds::Disclosure class={{this.classNames}} @onClose={{@onClose}} ...attributes>
5
+ <Hds::MenuPrimitive class={{this.classNames}} @onClose={{@onClose}} ...attributes>
6
6
  <:toggle as |t|>
7
7
  {{yield
8
8
  (hash
@@ -33,4 +33,4 @@
33
33
  {{yield (hash close=c.close Footer=(component "hds/dropdown/footer"))}}
34
34
  </div>
35
35
  </:content>
36
- </Hds::Disclosure>
36
+ </Hds::MenuPrimitive>
@@ -4,7 +4,7 @@
4
4
  */
5
5
 
6
6
  import Component from '@glimmer/component';
7
- import { getElementId } from '../../form/utils/getElementId';
7
+ import { getElementId } from '@hashicorp/design-system-components/utils/hds-get-element-id';
8
8
 
9
9
  export default class HdsDropdownListItemCheckboxComponent extends Component {
10
10
  /**
@@ -36,4 +36,5 @@
36
36
  {{/if}}
37
37
  </span>
38
38
  </Hds::Interactive>
39
- </li>
39
+ </li>
40
+ {{! template-lint-enable require-context-role require-presentational-children }}
@@ -4,7 +4,7 @@
4
4
  */
5
5
 
6
6
  import Component from '@glimmer/component';
7
- import { getElementId } from '../../form/utils/getElementId';
7
+ import { getElementId } from '@hashicorp/design-system-components/utils/hds-get-element-id';
8
8
 
9
9
  export default class HdsDropdownListItemRadioComponent extends Component {
10
10
  /**
@@ -4,10 +4,10 @@
4
4
  */
5
5
 
6
6
  import Component from '@glimmer/component';
7
+ import { tracked } from '@glimmer/tracking';
7
8
  import { action } from '@ember/object';
8
9
  import { assert } from '@ember/debug';
9
- import { getElementId } from '../form/utils/getElementId';
10
- import { tracked } from '@glimmer/tracking';
10
+ import { getElementId } from '@hashicorp/design-system-components/utils/hds-get-element-id';
11
11
 
12
12
  export const DEFAULT_SIZE = 'medium';
13
13
  export const DEFAULT_HAS_OVERLAY = true;
@@ -7,9 +7,9 @@ import Component from '@glimmer/component';
7
7
  import { tracked } from '@glimmer/tracking';
8
8
  import { assert } from '@ember/debug';
9
9
  import { action } from '@ember/object';
10
- import { getElementId } from '../utils/getElementId';
11
- import { setAriaDescribedBy } from '../utils/setAriaDescribedBy';
12
10
  import { schedule } from '@ember/runloop';
11
+ import { getElementId } from '@hashicorp/design-system-components/utils/hds-get-element-id';
12
+ import { setAriaDescribedBy } from '@hashicorp/design-system-components/utils/hds-set-aria-described-by';
13
13
 
14
14
  export const LAYOUT_TYPES = ['vertical', 'flag'];
15
15
 
@@ -6,8 +6,8 @@
6
6
  import Component from '@glimmer/component';
7
7
  import { tracked } from '@glimmer/tracking';
8
8
  import { action } from '@ember/object';
9
- import { getElementId } from '../utils/getElementId';
10
- import { setAriaDescribedBy } from '../utils/setAriaDescribedBy';
9
+ import { getElementId } from '@hashicorp/design-system-components/utils/hds-get-element-id';
10
+ import { setAriaDescribedBy } from '@hashicorp/design-system-components/utils/hds-set-aria-described-by';
11
11
 
12
12
  export default class HdsFormFieldsetIndexComponent extends Component {
13
13
  @tracked ariaDescribedBy = this.args.extraAriaDescribedBy;
@@ -7,8 +7,8 @@ import Component from '@glimmer/component';
7
7
  import { tracked } from '@glimmer/tracking';
8
8
  import { action } from '@ember/object';
9
9
  import { assert } from '@ember/debug';
10
- import { setAriaDescribedBy } from '../utils/setAriaDescribedBy';
11
10
  import { schedule } from '@ember/runloop';
11
+ import { setAriaDescribedBy } from '@hashicorp/design-system-components/utils/hds-set-aria-described-by';
12
12
 
13
13
  export const DEFAULT_CONTROL_POSITION = 'bottom';
14
14
  export const DEFAULT_ALIGNMENT = 'left';
@@ -4,18 +4,19 @@
4
4
  }}
5
5
  {{! template-lint-disable no-invalid-interactive }}
6
6
  <div
7
- class="hds-disclosure"
7
+ class="hds-menu-primitive"
8
8
  ...attributes
9
9
  {{did-insert this.didInsert}}
10
10
  {{on "focusout" this.onFocusOut}}
11
11
  {{on "keyup" this.onKeyUp}}
12
12
  >
13
- <div class="hds-disclosure__toggle" tabindex="-1">
13
+ <div class="hds-menu-primitive__toggle" tabindex="-1">
14
14
  {{yield (hash onClickToggle=this.onClickToggle isOpen=this.isOpen) to="toggle"}}
15
15
  </div>
16
16
  {{#if this.isOpen}}
17
- <div class="hds-disclosure__content" tabindex="-1">
17
+ <div class="hds-menu-primitive__content" tabindex="-1">
18
18
  {{yield (hash close=this.close) to="content"}}
19
19
  </div>
20
20
  {{/if}}
21
- </div>
21
+ </div>
22
+ {{! template-lint-enable no-invalid-interactive }}
@@ -8,8 +8,8 @@ import { tracked } from '@glimmer/tracking';
8
8
  import { action } from '@ember/object';
9
9
  import { schedule } from '@ember/runloop';
10
10
 
11
- export default class HdsDisclosureComponent extends Component {
12
- @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
11
+ export default class HdsMenuPrimitiveComponent extends Component {
12
+ @tracked isOpen; // notice: if in the future we need to add a "@isOpen" prop to control the status from outside (eg to have the MenuPrimitive opened on render) just add "this.args.isOpen" here to initalize the variable
13
13
  @tracked toggleRef;
14
14
 
15
15
  @action
@@ -24,7 +24,7 @@ export default class HdsDisclosureComponent extends Component {
24
24
  this.toggleRef = event.currentTarget;
25
25
  }
26
26
  this.isOpen = !this.isOpen;
27
- // we explicitly apply a focus state to the toggle element to overcome a bug in WebKit (see b8abfcf)
27
+ // we explicitly apply a focus state to the toggle element to overcome a bug in WebKit (see https://github.com/hashicorp/design-system/commit/40cd7f6b3cb15c45f9a1235fafd0fb3ed58e6e62)
28
28
  this.toggleRef.focus();
29
29
  }
30
30
 
@@ -4,10 +4,10 @@
4
4
  */
5
5
 
6
6
  import Component from '@glimmer/component';
7
+ import { tracked } from '@glimmer/tracking';
7
8
  import { action } from '@ember/object';
8
9
  import { assert } from '@ember/debug';
9
- import { getElementId } from '../form/utils/getElementId';
10
- import { tracked } from '@glimmer/tracking';
10
+ import { getElementId } from '@hashicorp/design-system-components/utils/hds-get-element-id';
11
11
 
12
12
  export const DEFAULT_SIZE = 'medium';
13
13
  export const DEFAULT_COLOR = 'neutral';
@@ -3,7 +3,7 @@
3
3
  SPDX-License-Identifier: MPL-2.0
4
4
  }}
5
5
  <div class="hds-pagination" ...attributes>
6
- <nav class="hds-pagination-nav" aria-label="Pagination navigation">
6
+ <nav class="hds-pagination-nav" aria-label={{this.ariaLabel}}>
7
7
  <Hds::Pagination::Nav::Arrow
8
8
  @direction="prev"
9
9
  @showLabel={{this.showLabels}}
@@ -47,6 +47,15 @@ export default class HdsPaginationCompactIndexComponent extends Component {
47
47
  return showLabels;
48
48
  }
49
49
 
50
+ /**
51
+ * @param ariaLabel
52
+ * @type {string}
53
+ * @default 'Pagination navigation'
54
+ */
55
+ get ariaLabel() {
56
+ return this.args.ariaLabel ?? 'Pagination navigation';
57
+ }
58
+
50
59
  get routeQueryParams() {
51
60
  return this.router.currentRoute?.queryParams || {};
52
61
  }
@@ -12,7 +12,7 @@
12
12
  />
13
13
  {{/if}}
14
14
 
15
- <nav class="hds-pagination-nav" aria-label="Pagination navigation">
15
+ <nav class="hds-pagination-nav" aria-label={{this.ariaLabel}}>
16
16
  <Hds::Pagination::Nav::Arrow
17
17
  @direction="prev"
18
18
  @showLabel={{this.showLabels}}
@@ -4,8 +4,8 @@
4
4
  */
5
5
 
6
6
  import Component from '@glimmer/component';
7
- import { action } from '@ember/object';
8
7
  import { tracked } from '@glimmer/tracking';
8
+ import { action } from '@ember/object';
9
9
  import { assert } from '@ember/debug';
10
10
  import { inject as service } from '@ember/service';
11
11
 
@@ -127,6 +127,15 @@ export default class HdsPaginationNumberedIndexComponent extends Component {
127
127
  );
128
128
  }
129
129
 
130
+ /**
131
+ * @param ariaLabel
132
+ * @type {string}
133
+ * @default 'Pagination navigation'
134
+ */
135
+ get ariaLabel() {
136
+ return this.args.ariaLabel ?? 'Pagination navigation';
137
+ }
138
+
130
139
  // This very specific `get/set` pattern is used to handle the two different use cases of the component
131
140
  // being "controlled" (when it has routing, meaning it needs to support links as controls)
132
141
  // vs being "uncontrolled" (see comments above for details).
@@ -258,7 +267,7 @@ export default class HdsPaginationNumberedIndexComponent extends Component {
258
267
  this.currentPage + 1,
259
268
  this.currentPageSize
260
269
  );
261
- // IMPORTANT: here we neeed to use an object and not an array
270
+ // IMPORTANT: here we need to use an object and not an array
262
271
  // otherwise the {{get object page}} will be shifted by one
263
272
  // (the pages are 1-based while the array would be zero-based)
264
273
  routing.queryPages = {};
@@ -21,8 +21,7 @@
21
21
  class="hds-side-nav__menu-toggle-button"
22
22
  type="button"
23
23
  {{on "click" this.toggleMinimizedStatus}}
24
- {{! To be localized - see: https://hashicorp.atlassian.net/browse/HDS-567 }}
25
- aria-label={{if this.isMinimized "Open menu" "Close menu"}}
24
+ aria-label={{this.ariaLabel}}
26
25
  >
27
26
  <FlightIcon @name={{if this.isMinimized "menu" "x"}} @size="24" @stretched={{true}} />
28
27
  </button>
@@ -4,8 +4,8 @@
4
4
  */
5
5
 
6
6
  import Component from '@glimmer/component';
7
- import { action } from '@ember/object';
8
7
  import { tracked } from '@glimmer/tracking';
8
+ import { action } from '@ember/object';
9
9
  import { assert } from '@ember/debug';
10
10
  import { registerDestructor } from '@ember/destroyable';
11
11
 
@@ -55,6 +55,18 @@ export default class HdsSideNavComponent extends Component {
55
55
  return this.isResponsive && !this.isDesktop && !this.isMinimized;
56
56
  }
57
57
 
58
+ /**
59
+ * @param ariaLabel
60
+ * @type {string}
61
+ * @default 'close menu'
62
+ */
63
+ get ariaLabel() {
64
+ if (this.isMinimized) {
65
+ return this.args.ariaLabel ?? 'Open menu';
66
+ }
67
+ return this.args.ariaLabel ?? 'Close menu';
68
+ }
69
+
58
70
  get classNames() {
59
71
  let classes = []; // `hds-side-nav` is already set by the "Hds::SideNav::Base" component
60
72
 
@@ -4,8 +4,8 @@
4
4
  */
5
5
 
6
6
  import Component from '@glimmer/component';
7
- import { action } from '@ember/object';
8
7
  import { tracked } from '@glimmer/tracking';
8
+ import { action } from '@ember/object';
9
9
  import { assert } from '@ember/debug';
10
10
 
11
11
  const DENSITIES = ['short', 'medium', 'tall'];
@@ -34,4 +34,5 @@
34
34
  )
35
35
  )
36
36
  }}
37
- </div>
37
+ </div>
38
+ {{! template-lint-enable no-invalid-role }}
@@ -26,4 +26,5 @@
26
26
  <Hds::BadgeCount @text={{@count}} @size="small" class="hds-tabs__tab-count" role="presentation" />
27
27
  {{/if}}
28
28
  </button>
29
- </li>
29
+ </li>
30
+ {{! template-lint-enable require-context-role no-invalid-role }}
@@ -4,7 +4,7 @@
4
4
  }}
5
5
  <span class={{this.classNames}} ...attributes>
6
6
  {{#if this.onDismiss}}
7
- <button class="hds-tag__dismiss" type="button" aria-label="Dismiss {{this.text}}" {{on "click" this.onDismiss}}>
7
+ <button class="hds-tag__dismiss" type="button" aria-label={{this.ariaLabel}} {{on "click" this.onDismiss}}>
8
8
  <FlightIcon class="hds-tag__dismiss-icon" @name="x" @size="16" @isInlineBlock={{false}} />
9
9
  </button>
10
10
  {{/if}}
@@ -38,6 +38,16 @@ export default class HdsTagIndexComponent extends Component {
38
38
  return text;
39
39
  }
40
40
 
41
+ /**
42
+ * @param ariaLabel
43
+ * @type {string}
44
+ * @default 'Dismiss'
45
+ */
46
+ get ariaLabel() {
47
+ let tagAriaLabel = this.args.ariaLabel ?? 'Dismiss';
48
+ return tagAriaLabel + ' ' + this.args.text;
49
+ }
50
+
41
51
  /**
42
52
  * @param color
43
53
  * @type {string}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Copyright (c) HashiCorp, Inc.
3
+ * SPDX-License-Identifier: MPL-2.0
4
+ */
5
+
6
+ export { default } from '@hashicorp/design-system-components/components/hds/disclosure-primitive/index';
@@ -3,4 +3,4 @@
3
3
  * SPDX-License-Identifier: MPL-2.0
4
4
  */
5
5
 
6
- export { default } from '@hashicorp/design-system-components/components/hds/disclosure/index';
6
+ export { default } from '@hashicorp/design-system-components/components/hds/menu-primitive/index';
@@ -22,13 +22,14 @@
22
22
  @use "../components/button";
23
23
  @use "../components/button-set";
24
24
  @use "../components/card";
25
- @use "../components/disclosure";
25
+ @use "../components/disclosure-primitive";
26
26
  @use "../components/dismiss-button";
27
27
  @use "../components/dropdown";
28
28
  @use "../components/flyout";
29
29
  @use "../components/form"; // multiple components
30
30
  @use "../components/icon-tile";
31
31
  @use "../components/link"; // multiple components
32
+ @use "../components/menu-primitive";
32
33
  @use "../components/modal";
33
34
  @use "../components/pagination";
34
35
  @use "../components/segmented-group";
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Copyright (c) HashiCorp, Inc.
3
+ * SPDX-License-Identifier: MPL-2.0
4
+ */
5
+
6
+ //
7
+ // DisclosurePrimitive COMPONENT
8
+ //
9
+
10
+ .hds-disclosure-primitive {
11
+ position: relative;
12
+ width: fit-content;
13
+ }
@@ -176,7 +176,7 @@ $hds-dropdown-toggle-border-radius: $hds-button-border-radius;
176
176
 
177
177
  // LIST
178
178
  // UL ELEMENT
179
- // GOES INSIDE HDS::DISCLOSURE's :content block
179
+ // GOES INSIDE HDS::MenuPrimitive's :content block
180
180
 
181
181
  .hds-dropdown__content {
182
182
  display: flex;
@@ -4,10 +4,10 @@
4
4
  */
5
5
 
6
6
  //
7
- // DISCLOSURE COMPONENT
7
+ // MenuPrimitive COMPONENT
8
8
  //
9
9
 
10
- .hds-disclosure {
10
+ .hds-menu-primitive {
11
11
  position: relative;
12
12
  width: fit-content;
13
13
  }
@@ -75,6 +75,9 @@
75
75
  // This needs to go here because Tippy generates a javascript
76
76
  // max-width on .tippy-box.
77
77
  max-width: var(--token-tooltip-max-width);
78
+ // prevent this container from potentially inheriting other values
79
+ // such as `white-space: nowrap` that would cause content overflow
80
+ white-space: normal;
78
81
  }
79
82
 
80
83
  // works with Tippy's custom SVG arrow variation:
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Copyright (c) HashiCorp, Inc.
3
+ * SPDX-License-Identifier: MPL-2.0
4
+ */
5
+
6
+ export { default } from '@hashicorp/design-system-components/utils/hds-get-element-id';
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Copyright (c) HashiCorp, Inc.
3
+ * SPDX-License-Identifier: MPL-2.0
4
+ */
5
+
6
+ export { default } from '@hashicorp/design-system-components/utils/hds-set-aria-described-by';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hashicorp/design-system-components",
3
- "version": "2.3.3",
3
+ "version": "2.4.1",
4
4
  "description": "Helios Design System Components",
5
5
  "keywords": [
6
6
  "hashicorp",
@@ -39,7 +39,7 @@
39
39
  "dependencies": {
40
40
  "@ember/render-modifiers": "^2.0.5",
41
41
  "@hashicorp/design-system-tokens": "^1.5.0",
42
- "@hashicorp/ember-flight-icons": "^3.0.2",
42
+ "@hashicorp/ember-flight-icons": "^3.0.3",
43
43
  "dialog-polyfill": "^0.5.6",
44
44
  "ember-a11y-refocus": "^3.0.2",
45
45
  "ember-auto-import": "^2.6.0",