@hashicorp/design-system-components 2.15.0 → 3.0.0

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 (76) hide show
  1. package/CHANGELOG-FIGMA-COMPONENTS.md +177 -0
  2. package/CHANGELOG-FIGMA-FOUNDATIONS.md +2 -0
  3. package/CHANGELOG.md +359 -59
  4. package/README.md +1 -1
  5. package/addon/components/hds/accordion/item/index.hbs +16 -5
  6. package/addon/components/hds/application-state/body.hbs +2 -2
  7. package/addon/components/hds/application-state/header.hbs +4 -4
  8. package/addon/components/hds/button/{index.js → index.ts} +29 -4
  9. package/addon/components/hds/copy/button/index.hbs +1 -1
  10. package/addon/components/hds/copy/button/index.js +14 -2
  11. package/addon/components/hds/copy/snippet/index.hbs +3 -3
  12. package/addon/components/hds/copy/snippet/index.js +19 -2
  13. package/addon/components/hds/dropdown/index.js +0 -3
  14. package/addon/components/hds/dropdown/list-item/checkmark.hbs +9 -3
  15. package/addon/components/hds/dropdown/list-item/copy-item.hbs +8 -4
  16. package/addon/components/hds/dropdown/list-item/copy-item.js +13 -0
  17. package/addon/components/hds/dropdown/list-item/description.hbs +9 -2
  18. package/addon/components/hds/dropdown/list-item/description.js +0 -18
  19. package/addon/components/hds/dropdown/list-item/interactive.hbs +4 -4
  20. package/addon/components/hds/dropdown/list-item/radio.hbs +6 -1
  21. package/addon/components/hds/dropdown/list-item/title.hbs +9 -2
  22. package/addon/components/hds/dropdown/list-item/title.js +0 -18
  23. package/addon/components/hds/flyout/description.hbs +2 -2
  24. package/addon/components/hds/flyout/header.hbs +4 -4
  25. package/addon/components/hds/form/error/index.hbs +2 -2
  26. package/addon/components/hds/form/error/index.js +0 -3
  27. package/addon/components/hds/form/error/message.hbs +2 -2
  28. package/addon/components/hds/form/helper-text/index.hbs +10 -2
  29. package/addon/components/hds/form/helper-text/index.js +0 -3
  30. package/addon/components/hds/form/indicator/index.hbs +1 -1
  31. package/addon/components/hds/form/indicator/index.js +0 -3
  32. package/addon/components/hds/form/masked-input/base.hbs +8 -10
  33. package/addon/components/hds/form/masked-input/base.js +14 -14
  34. package/addon/components/hds/form/masked-input/field.hbs +3 -1
  35. package/addon/components/hds/form/radio-card/description.hbs +6 -1
  36. package/addon/components/hds/form/radio-card/group.hbs +1 -2
  37. package/addon/components/hds/form/radio-card/index.js +5 -33
  38. package/addon/components/hds/form/radio-card/label.hbs +7 -1
  39. package/addon/components/hds/form/text-input/base.js +5 -0
  40. package/addon/components/hds/form/text-input/field.hbs +23 -11
  41. package/addon/components/hds/form/text-input/field.js +59 -0
  42. package/addon/components/hds/form/visibility-toggle/index.hbs +8 -0
  43. package/addon/components/hds/interactive/{index.js → index.ts} +28 -3
  44. package/addon/components/hds/modal/header.hbs +4 -4
  45. package/addon/components/hds/page-header/description.hbs +7 -1
  46. package/addon/components/hds/page-header/subtitle.hbs +7 -1
  47. package/addon/components/hds/page-header/title.hbs +7 -1
  48. package/addon/components/hds/pagination/info/index.hbs +2 -2
  49. package/addon/components/hds/pagination/nav/arrow.hbs +16 -4
  50. package/addon/components/hds/pagination/nav/arrow.js +0 -2
  51. package/addon/components/hds/pagination/nav/number.hbs +2 -1
  52. package/addon/components/hds/pagination/nav/number.js +1 -6
  53. package/addon/components/hds/side-nav/list/index.hbs +2 -2
  54. package/addon/components/hds/stepper/step/indicator.hbs +6 -1
  55. package/addon/components/hds/tag/index.hbs +2 -2
  56. package/addon/modifiers/hds-clipboard.js +163 -0
  57. package/addon/template-registry.ts +12 -0
  58. package/app/components/hds/form/visibility-toggle/index.js +6 -0
  59. package/app/modifiers/hds-clipboard.js +6 -0
  60. package/app/styles/components/button.scss +2 -0
  61. package/app/styles/components/copy/snippet.scss +22 -14
  62. package/app/styles/components/dropdown.scss +2 -5
  63. package/app/styles/components/flyout.scss +0 -2
  64. package/app/styles/components/form/group.scss +5 -0
  65. package/app/styles/components/form/index.scss +1 -0
  66. package/app/styles/components/form/masked-input.scss +0 -9
  67. package/app/styles/components/form/radio-card.scss +2 -4
  68. package/app/styles/components/form/text-input.scss +17 -0
  69. package/app/styles/components/form/visibility-toggle.scss +23 -0
  70. package/app/styles/components/stepper/step-indicator.scss +0 -3
  71. package/app/styles/components/tag.scss +1 -5
  72. package/index.js +3 -0
  73. package/package.json +33 -4
  74. package/tsconfig.json +46 -0
  75. package/types/dummy/index.d.ts +6 -0
  76. package/types/global.d.ts +12 -0
@@ -5,15 +5,33 @@
5
5
 
6
6
  import Component from '@glimmer/component';
7
7
  import { assert } from '@ember/debug';
8
+ import { HdsInteractiveSignature } from '../interactive';
8
9
 
9
10
  export const DEFAULT_SIZE = 'medium';
10
11
  export const DEFAULT_COLOR = 'primary';
11
12
  export const DEFAULT_ICONPOSITION = 'leading';
12
- export const SIZES = ['small', 'medium', 'large'];
13
- export const COLORS = ['primary', 'secondary', 'tertiary', 'critical'];
14
- export const ICONPOSITIONS = ['leading', 'trailing'];
13
+ export const SIZES = ['small', 'medium', 'large'] as const;
14
+ export const COLORS = ['primary', 'secondary', 'tertiary', 'critical'] as const;
15
+ export const ICONPOSITIONS = ['leading', 'trailing'] as const;
16
+
17
+ export type HdsButtonSize = typeof SIZES[number];
18
+ export type HdsButtonColor = typeof COLORS[number];
19
+ export type HdsButtonIconPosition = typeof ICONPOSITIONS[number];
20
+
21
+ export interface HdsButtonSignature {
22
+ Args: HdsInteractiveSignature['Args'] & {
23
+ size?: HdsButtonSize;
24
+ color?: HdsButtonColor;
25
+ text: string;
26
+ icon?: string;
27
+ iconPosition?: HdsButtonIconPosition;
28
+ isIconOnly?: boolean;
29
+ isFullWidth?: boolean;
30
+ };
31
+ Element: HdsInteractiveSignature['Element'];
32
+ }
15
33
 
16
- export default class HdsButtonIndexComponent extends Component {
34
+ export default class HdsButtonIndexComponent extends Component<HdsButtonSignature> {
17
35
  /**
18
36
  * @param text
19
37
  * @type {string}
@@ -166,3 +184,10 @@ export default class HdsButtonIndexComponent extends Component {
166
184
  return classes.join(' ');
167
185
  }
168
186
  }
187
+
188
+ declare module '@glint/environment-ember-loose/registry' {
189
+ export default interface Registry {
190
+ 'Hds::Button': typeof HdsButtonIndexComponent;
191
+ 'hds/button': typeof HdsButtonIndexComponent;
192
+ }
193
+ }
@@ -11,6 +11,6 @@
11
11
  @isIconOnly={{@isIconOnly}}
12
12
  @color="secondary"
13
13
  @iconPosition="trailing"
14
- {{clipboard text=@textToCopy target=@targetToCopy container=@container onError=this.onError onSuccess=this.onSuccess}}
14
+ {{hds-clipboard text=@textToCopy target=@targetToCopy onSuccess=this.onSuccess onError=this.onError}}
15
15
  ...attributes
16
16
  />
@@ -70,15 +70,27 @@ export default class HdsCopyButtonComponent extends Component {
70
70
  }
71
71
 
72
72
  @action
73
- onSuccess() {
73
+ onSuccess(args) {
74
74
  this.status = 'success';
75
75
  this.resetStatusDelayed();
76
+
77
+ let { onSuccess } = this.args;
78
+
79
+ if (typeof onSuccess === 'function') {
80
+ onSuccess(args);
81
+ }
76
82
  }
77
83
 
78
84
  @action
79
- onError() {
85
+ onError(args) {
80
86
  this.status = 'error';
81
87
  this.resetStatusDelayed();
88
+
89
+ let { onError } = this.args;
90
+
91
+ if (typeof onError === 'function') {
92
+ onError(args);
93
+ }
82
94
  }
83
95
 
84
96
  resetStatusDelayed() {
@@ -5,11 +5,11 @@
5
5
  <button
6
6
  type="button"
7
7
  class={{this.classNames}}
8
- {{clipboard text=@textToCopy container=@container onError=this.onError onSuccess=this.onSuccess}}
8
+ {{hds-clipboard text=@textToCopy onSuccess=this.onSuccess onError=this.onError}}
9
9
  ...attributes
10
10
  >
11
- <span class="hds-copy-snippet__text hds-typography-code-100 {{if @isTruncated 'hds-copy-snippet__text--truncated'}}">
11
+ <Hds::Text::Code class="hds-copy-snippet__text" @tag="span" @size="100">
12
12
  {{@textToCopy}}
13
- </span>
13
+ </Hds::Text::Code>
14
14
  <FlightIcon @name={{this.icon}} class="hds-copy-snippet__icon" />
15
15
  </button>
@@ -88,6 +88,11 @@ export default class HdsCopySnippetIndexComponent extends Component {
88
88
  // add a class based on the tracked status (idle/success/error)
89
89
  classes.push(`hds-copy-snippet--status-${this.status}`);
90
90
 
91
+ // add a class based on the @isTruncated argument
92
+ if (this.isTruncated) {
93
+ classes.push('hds-copy-snippet--is-truncated');
94
+ }
95
+
91
96
  // add a class based on the @isFullWidth argument
92
97
  if (this.isFullWidth) {
93
98
  classes.push('hds-copy-snippet--width-full');
@@ -97,15 +102,27 @@ export default class HdsCopySnippetIndexComponent extends Component {
97
102
  }
98
103
 
99
104
  @action
100
- onSuccess() {
105
+ onSuccess(args) {
101
106
  this.status = 'success';
102
107
  this.resetStatusDelayed();
108
+
109
+ let { onSuccess } = this.args;
110
+
111
+ if (typeof onSuccess === 'function') {
112
+ onSuccess(args);
113
+ }
103
114
  }
104
115
 
105
116
  @action
106
- onError() {
117
+ onError(args) {
107
118
  this.status = 'error';
108
119
  this.resetStatusDelayed();
120
+
121
+ let { onError } = this.args;
122
+
123
+ if (typeof onError === 'function') {
124
+ onError(args);
125
+ }
109
126
  }
110
127
 
111
128
  resetStatusDelayed() {
@@ -8,10 +8,7 @@ import { action } from '@ember/object';
8
8
  import { assert } from '@ember/debug';
9
9
 
10
10
  export const DEFAULT_POSITION = 'bottom-right';
11
- // TODO: retire 'right' and 'left' in favor of `bottom-right` and `bottom-left` https://github.com/hashicorp/design-system/pull/1262
12
11
  export const POSITIONS = [
13
- 'right',
14
- 'left',
15
12
  'bottom-left',
16
13
  'bottom-right',
17
14
  'top-left',
@@ -24,11 +24,17 @@
24
24
  <FlightIcon @name={{@icon}} @isInlineBlock={{false}} />
25
25
  </div>
26
26
  {{/if}}
27
- <div class="hds-dropdown-list-item__interactive-text hds-typography-body-200 hds-font-weight-medium">
27
+ <Hds::Text::Body @tag="div" @size="200" @weight="medium" class="hds-dropdown-list-item__interactive-text">
28
28
  {{yield}}
29
- </div>
29
+ </Hds::Text::Body>
30
30
  {{#if @count}}
31
- <span class="hds-dropdown-list-item__count hds-typography-body-100 hds-font-weight-medium">{{@count}}</span>
31
+ <Hds::Text::Body
32
+ class="hds-dropdown-list-item__count"
33
+ @tag="span"
34
+ @size="100"
35
+ @weight="medium"
36
+ @color="faint"
37
+ >{{@count}}</Hds::Text::Body>
32
38
  {{/if}}
33
39
  <span class="hds-dropdown-list-item__checkmark">
34
40
  {{#if @selected}}
@@ -4,9 +4,13 @@
4
4
  }}
5
5
  <li class={{this.classNames}} ...attributes>
6
6
  {{#if @copyItemTitle}}
7
- <div
8
- class="hds-dropdown-list-item__copy-item-title hds-typography-body-100 hds-font-weight-semibold"
9
- >{{@copyItemTitle}}</div>
7
+ <Hds::Text::Body
8
+ class="hds-dropdown-list-item__copy-item-title"
9
+ @tag="div"
10
+ @size="100"
11
+ @weight="semibold"
12
+ @color="faint"
13
+ >{{@copyItemTitle}}</Hds::Text::Body>
10
14
  {{/if}}
11
- <Hds::Copy::Snippet @textToCopy={{this.text}} @isTruncated={{@isTruncated}} />
15
+ <Hds::Copy::Snippet @color="secondary" @textToCopy={{this.text}} @isTruncated={{this.isTruncated}} />
12
16
  </li>
@@ -22,6 +22,19 @@ export default class HdsDropdownListItemCopyItemComponent extends Component {
22
22
 
23
23
  return text;
24
24
  }
25
+
26
+ /**
27
+ * @param isTruncated
28
+ * @type {boolean}
29
+ * @default true
30
+ * @description Indicates that the text should be truncated instead of wrapping and using multiple lines.
31
+ */
32
+ get isTruncated() {
33
+ let { isTruncated = true } = this.args;
34
+
35
+ return isTruncated;
36
+ }
37
+
25
38
  /**
26
39
  * Get the class names to apply to the component.
27
40
  * @method classNames
@@ -2,6 +2,13 @@
2
2
  Copyright (c) HashiCorp, Inc.
3
3
  SPDX-License-Identifier: MPL-2.0
4
4
  }}
5
- <li class={{this.classNames}} ...attributes>
5
+ <Hds::Text::Body
6
+ class="hds-dropdown-list-item hds-dropdown-list-item--variant-description"
7
+ @tag="li"
8
+ @size="100"
9
+ @weight="regular"
10
+ @color="faint"
11
+ ...attributes
12
+ >
6
13
  {{this.text}}
7
- </li>
14
+ </Hds::Text::Body>
@@ -22,22 +22,4 @@ export default class HdsDropdownListItemDescriptionComponent extends Component {
22
22
 
23
23
  return text;
24
24
  }
25
-
26
- /**
27
- * Get the class names to apply to the component.
28
- * @method classNames
29
- * @return {string} The "class" attribute to apply to the component.
30
- */
31
- get classNames() {
32
- let classes = [
33
- 'hds-dropdown-list-item',
34
- 'hds-dropdown-list-item--variant-description',
35
- ];
36
-
37
- // add classes for the typographic style
38
- classes.push('hds-typography-body-100');
39
- classes.push('hds-font-weight-regular');
40
-
41
- return classes.join(' ');
42
- }
43
25
  }
@@ -8,9 +8,9 @@
8
8
  <div class="hds-dropdown-list-item__interactive-icon">
9
9
  <FlightIcon @name="loading" @isInlineBlock={{false}} />
10
10
  </div>
11
- <div class="hds-dropdown-list-item__interactive-text hds-typography-body-100 hds-font-weight-regular">
11
+ <Hds::Text::Body @tag="div" @size="100" @weight="regular" class="hds-dropdown-list-item__interactive-text">
12
12
  {{this.text}}
13
- </div>
13
+ </Hds::Text::Body>
14
14
  </div>
15
15
  {{else}}
16
16
  <Hds::Interactive
@@ -29,9 +29,9 @@
29
29
  <FlightIcon @name={{@icon}} @isInlineBlock={{false}} />
30
30
  </div>
31
31
  {{/if}}
32
- <div class="hds-dropdown-list-item__interactive-text hds-typography-body-200 hds-font-weight-medium">
32
+ <Hds::Text::Body class="hds-dropdown-list-item__interactive-text" @tag="div" @size="200" @weight="medium">
33
33
  {{this.text}}
34
- </div>
34
+ </Hds::Text::Body>
35
35
  </Hds::Interactive>
36
36
  {{/if}}
37
37
  </li>
@@ -14,7 +14,12 @@
14
14
  <span class="hds-dropdown-list-item__text-content">{{yield}}</span>
15
15
 
16
16
  {{#if @count}}
17
- <span class="hds-dropdown-list-item__count hds-typography-body-100 hds-font-weight-medium">{{@count}}</span>
17
+ <Hds::Text::Body
18
+ class="hds-dropdown-list-item__count"
19
+ @tag="span"
20
+ @size="100"
21
+ @weight="medium"
22
+ >{{@count}}</Hds::Text::Body>
18
23
  {{/if}}
19
24
  </label>
20
25
  </li>
@@ -2,6 +2,13 @@
2
2
  Copyright (c) HashiCorp, Inc.
3
3
  SPDX-License-Identifier: MPL-2.0
4
4
  }}
5
- <li class={{this.classNames}} ...attributes>
5
+ <Hds::Text::Body
6
+ class="hds-dropdown-list-item hds-dropdown-list-item--variant-title"
7
+ @tag="li"
8
+ @size="100"
9
+ @weight="semibold"
10
+ @color="strong"
11
+ ...attributes
12
+ >
6
13
  {{this.text}}
7
- </li>
14
+ </Hds::Text::Body>
@@ -22,22 +22,4 @@ export default class HdsDropdownListItemTitleComponent extends Component {
22
22
 
23
23
  return text;
24
24
  }
25
-
26
- /**
27
- * Get the class names to apply to the component.
28
- * @method classNames
29
- * @return {string} The "class" attribute to apply to the component.
30
- */
31
- get classNames() {
32
- let classes = [
33
- 'hds-dropdown-list-item',
34
- 'hds-dropdown-list-item--variant-title',
35
- ];
36
-
37
- // add classes for the typographic style
38
- classes.push('hds-typography-body-100');
39
- classes.push('hds-font-weight-semibold');
40
-
41
- return classes.join(' ');
42
- }
43
25
  }
@@ -2,6 +2,6 @@
2
2
  Copyright (c) HashiCorp, Inc.
3
3
  SPDX-License-Identifier: MPL-2.0
4
4
  }}
5
- <div class="hds-flyout__description hds-typography-body-200" ...attributes>
5
+ <Hds::Text::Body class="hds-flyout__description" @tag="div" @size="200" @color="primary" ...attributes>
6
6
  {{yield}}
7
- </div>
7
+ </Hds::Text::Body>
@@ -6,13 +6,13 @@
6
6
  {{#if @icon}}
7
7
  <FlightIcon class="hds-flyout__icon" @name={{@icon}} @size="24" @isInlineBlock={{false}} />
8
8
  {{/if}}
9
- <div class="hds-flyout__title hds-typography-display-300 hds-font-weight-semibold" id={{@id}}>
9
+ <Hds::Text::Display class="hds-flyout__title" @tag="div" @size="300" @weight="semibold" id={{@id}}>
10
10
  {{#if @tagline}}
11
- <div class="hds-flyout__tagline hds-typography-body-100 hds-font-weight-regular">
11
+ <Hds::Text::Body class="hds-flyout__tagline" @tag="div" @size="100" @weight="regular" @color="faint">
12
12
  {{@tagline}}
13
- </div>
13
+ </Hds::Text::Body>
14
14
  {{/if}}
15
15
  {{yield}}
16
- </div>
16
+ </Hds::Text::Display>
17
17
  <Hds::DismissButton class="hds-flyout__dismiss" {{on "click" @onDismiss}} />
18
18
  </div>
@@ -4,7 +4,7 @@
4
4
  }}
5
5
  <div class={{this.classNames}} id={{this.id}} {{did-insert this.onInsert}} ...attributes>
6
6
  <FlightIcon class="hds-form-error__icon" @name="alert-diamond-fill" />
7
- <div class="hds-form-error__content">
7
+ <Hds::Text::Body class="hds-form-error__content" @tag="div" @size="100" @weight="medium">
8
8
  {{yield (hash Message=(component "hds/form/error/message"))}}
9
- </div>
9
+ </Hds::Text::Body>
10
10
  </div>
@@ -46,9 +46,6 @@ export default class HdsFormErrorIndexComponent extends Component {
46
46
  get classNames() {
47
47
  let classes = ['hds-form-error'];
48
48
 
49
- // add typographic classes
50
- classes.push('hds-typography-body-100', 'hds-font-weight-medium');
51
-
52
49
  // add a class based on the @contextualClass argument
53
50
  // notice: this will *not* be documented for public use
54
51
  // the reason for this is that the contextual component declarations don't pass attributes to the component
@@ -2,6 +2,6 @@
2
2
  Copyright (c) HashiCorp, Inc.
3
3
  SPDX-License-Identifier: MPL-2.0
4
4
  }}
5
- <p class="hds-form-error__message" ...attributes>
5
+ <Hds::Text::Body class="hds-form-error__message" @tag="p" @size="100" @weight="medium" ...attributes>
6
6
  {{yield}}
7
- </p>
7
+ </Hds::Text::Body>
@@ -2,6 +2,14 @@
2
2
  Copyright (c) HashiCorp, Inc.
3
3
  SPDX-License-Identifier: MPL-2.0
4
4
  }}
5
- <div class={{this.classNames}} id={{this.id}} {{did-insert this.onInsert}} ...attributes>
5
+ <Hds::Text::Body
6
+ class={{this.classNames}}
7
+ @tag="div"
8
+ @size="100"
9
+ @weight="regular"
10
+ id={{this.id}}
11
+ {{did-insert this.onInsert}}
12
+ ...attributes
13
+ >
6
14
  {{yield}}
7
- </div>
15
+ </Hds::Text::Body>
@@ -46,9 +46,6 @@ export default class HdsFormHelperTextIndexComponent extends Component {
46
46
  get classNames() {
47
47
  let classes = ['hds-form-helper-text'];
48
48
 
49
- // add typographic classes
50
- classes.push('hds-typography-body-100', 'hds-font-weight-regular');
51
-
52
49
  // add a class based on the @contextualClass argument
53
50
  // notice: this will *not* be documented for public use
54
51
  // the reason for this is that the contextual component declarations don't pass attributes to the component
@@ -3,7 +3,7 @@
3
3
  SPDX-License-Identifier: MPL-2.0
4
4
  }}
5
5
  {{#if @isOptional}}
6
- <span class={{this.classNames}}>(Optional)</span>
6
+ <Hds::Text::Body class={{this.classNames}} tag="span" @size="100" @weight="regular">(Optional)</Hds::Text::Body>
7
7
  {{/if}}
8
8
  {{#if @isRequired}}
9
9
  &nbsp;<Hds::Badge aria-hidden="true" class={{this.classNames}} @size="small" @color="neutral" @text="Required" />
@@ -17,9 +17,6 @@ export default class HdsFormIndicatorIndexComponent extends Component {
17
17
  if (this.args.isOptional) {
18
18
  // add speficic class for "optional" indicator
19
19
  classes.push('hds-form-indicator--optional');
20
-
21
- // add typographic classes
22
- classes.push('hds-typography-body-100', 'hds-font-weight-regular');
23
20
  }
24
21
 
25
22
  return classes.join(' ');
@@ -21,22 +21,20 @@
21
21
  ...attributes
22
22
  />
23
23
  {{/if}}
24
- <button
25
- class="hds-form-masked-input__toggle-button"
26
- type="button"
27
- aria-label={{this.ariaLabel}}
24
+ <Hds::Form::VisibilityToggle
25
+ @isVisible={{this.isContentMasked}}
26
+ @ariaLabel={{this.visibilityToggleAriaLabel}}
27
+ @ariaMessageText={{this.visibilityToggleAriaMessageText}}
28
28
  aria-controls={{this.id}}
29
- {{on "click" this.onClickToggle}}
30
- >
31
- <FlightIcon @name={{if this.isMasked "eye" "eye-off"}} @size="16" @isInlineBlock={{false}} />
32
- <span class="sr-only" aria-live="polite">{{this.ariaMessageText}}</span>
33
- </button>
29
+ class="hds-form-masked-input__toggle-button"
30
+ {{on "click" this.onClickToggleMasking}}
31
+ />
34
32
  {{#if @hasCopyButton}}
35
33
  <Hds::Copy::Button
36
34
  class="hds-form-masked-input__copy-button"
37
35
  @text={{this.copyButtonText}}
38
36
  @isIconOnly={{true}}
39
- @textToCopy="{{@value}}"
37
+ @targetToCopy="#{{this.id}}"
40
38
  />
41
39
  {{/if}}
42
40
  </div>
@@ -9,11 +9,11 @@ import { action } from '@ember/object';
9
9
  import { getElementId } from '@hashicorp/design-system-components/utils/hds-get-element-id';
10
10
 
11
11
  export default class HdsFormMaskedInputBaseComponent extends Component {
12
- @tracked isMasked = this.args.isMasked ?? true;
12
+ @tracked isContentMasked = this.args.isContentMasked ?? true;
13
13
 
14
14
  @action
15
- onClickToggle() {
16
- this.isMasked = !this.isMasked;
15
+ onClickToggleMasking() {
16
+ this.isContentMasked = !this.isContentMasked;
17
17
  }
18
18
 
19
19
  /**
@@ -28,10 +28,10 @@ export default class HdsFormMaskedInputBaseComponent extends Component {
28
28
  * @type {string}
29
29
  * @default 'Show masked content'
30
30
  */
31
- get ariaLabel() {
32
- if (this.args.ariaLabel) {
33
- return this.args.ariaLabel;
34
- } else if (this.isMasked) {
31
+ get visibilityToggleAriaLabel() {
32
+ if (this.args.visibilityToggleAriaLabel) {
33
+ return this.args.visibilityToggleAriaLabel;
34
+ } else if (this.isContentMasked) {
35
35
  return 'Show masked content';
36
36
  } else {
37
37
  return 'Hide masked content';
@@ -43,13 +43,13 @@ export default class HdsFormMaskedInputBaseComponent extends Component {
43
43
  * @type {string}
44
44
  * @default 'Input content is now hidden'
45
45
  */
46
- get ariaMessageText() {
47
- if (this.args.ariaMessageText) {
48
- return this.args.ariaMessageText;
49
- } else if (this.isMasked) {
50
- return 'Input content is now hidden';
46
+ get visibilityToggleAriaMessageText() {
47
+ if (this.args.visibilityToggleAriaMessageText) {
48
+ return this.args.visibilityToggleAriaMessageText;
49
+ } else if (this.isContentMasked) {
50
+ return 'Input content is hidden';
51
51
  } else {
52
- return 'Input content is now visible';
52
+ return 'Input content is visible';
53
53
  }
54
54
  }
55
55
 
@@ -74,7 +74,7 @@ export default class HdsFormMaskedInputBaseComponent extends Component {
74
74
  get classNames() {
75
75
  let classes = ['hds-form-masked-input'];
76
76
 
77
- if (this.isMasked) {
77
+ if (this.isContentMasked) {
78
78
  classes.push(`hds-form-masked-input--is-masked`);
79
79
  } else {
80
80
  classes.push(`hds-form-masked-input--is-not-masked`);
@@ -17,7 +17,9 @@
17
17
  <Hds::Form::MaskedInput::Base
18
18
  @hasCopyButton={{@hasCopyButton}}
19
19
  @isMultiline={{@isMultiline}}
20
- @isMasked={{@isMasked}}
20
+ @isContentMasked={{@isContentMasked}}
21
+ @visibilityToggleAriaLabel={{@visibilityToggleAriaLabel}}
22
+ @visibilityToggleAriaMessageText={{@visibilityToggleAriaMessageText}}
21
23
  @value={{@value}}
22
24
  @isInvalid={{@isInvalid}}
23
25
  @width={{@width}}
@@ -2,4 +2,9 @@
2
2
  Copyright (c) HashiCorp, Inc.
3
3
  SPDX-License-Identifier: MPL-2.0
4
4
  }}
5
- <span class="hds-form-radio-card__description hds-typography-body-100" ...attributes>{{yield}}</span>
5
+ <Hds::Text::Body
6
+ class="hds-form-radio-card__description"
7
+ @tag="span"
8
+ @size="100"
9
+ ...attributes
10
+ >{{yield}}</Hds::Text::Body>
@@ -4,7 +4,7 @@
4
4
  }}
5
5
  <Hds::Form::Fieldset
6
6
  class="hds-form-group--radio-cards"
7
- @layout="horizontal"
7
+ @layout={{if (eq @layout "vertical") "vertical" "horizontal"}}
8
8
  @name={{@name}}
9
9
  @isRequired={{@isRequired}}
10
10
  @isOptional={{@isOptional}}
@@ -22,7 +22,6 @@
22
22
  name=@name
23
23
  alignment=@alignment
24
24
  controlPosition=@controlPosition
25
- layout=@layout
26
25
  extraAriaDescribedBy=F.ariaDescribedBy
27
26
  )
28
27
  )
@@ -12,10 +12,8 @@ import { setAriaDescribedBy } from '@hashicorp/design-system-components/utils/hd
12
12
 
13
13
  export const DEFAULT_CONTROL_POSITION = 'bottom';
14
14
  export const DEFAULT_ALIGNMENT = 'left';
15
- export const DEFAULT_LAYOUT = 'fluid';
16
15
  export const CONTROL_POSITIONS = ['bottom', 'left'];
17
16
  export const ALIGNMENTS = ['left', 'center'];
18
- export const LAYOUTS = ['fluid', 'fixed'];
19
17
 
20
18
  export default class HdsFormRadioCardIndexComponent extends Component {
21
19
  @tracked ariaDescribedBy = this.args.extraAriaDescribedBy;
@@ -71,34 +69,6 @@ export default class HdsFormRadioCardIndexComponent extends Component {
71
69
  return alignment;
72
70
  }
73
71
 
74
- /**
75
- * Sets the layout of the card within the group
76
- * Accepted values: fluid, fixed
77
- *
78
- * @param layout
79
- * @type {string}
80
- * @default 'fluid'
81
- */
82
- get layout() {
83
- let { layout = DEFAULT_LAYOUT } = this.args;
84
-
85
- assert(
86
- `@layout for "Hds::Form::RadioCard" must be one of the following: ${LAYOUTS.join(
87
- ', '
88
- )}; received: ${layout}`,
89
- LAYOUTS.includes(layout)
90
- );
91
-
92
- // if the `@layout` is set to 'fixed' we need a `@maxWidth` value to constrain the card to
93
- if (layout === 'fixed') {
94
- assert(
95
- `@maxWidth for "Hds::Form::RadioCard" with @layout "fixed" is required`,
96
- this.args.maxWidth
97
- );
98
- }
99
- return layout;
100
- }
101
-
102
72
  /**
103
73
  * Get the class names to apply to the component.
104
74
  * @method classNames
@@ -113,6 +83,11 @@ export default class HdsFormRadioCardIndexComponent extends Component {
113
83
  if (this.args.disabled) {
114
84
  classes.push('hds-form-radio-card--disabled');
115
85
  }
86
+ if (this.args.maxWidth) {
87
+ classes.push('hds-form-radio-card--has-fixed-width');
88
+ } else {
89
+ classes.push('hds-form-radio-card--has-fluid-width');
90
+ }
116
91
 
117
92
  // add a class based on the @controlPosition argument
118
93
  classes.push(`hds-form-radio-card--control-${this.controlPosition}`);
@@ -120,9 +95,6 @@ export default class HdsFormRadioCardIndexComponent extends Component {
120
95
  // add a class based on the @alignment argument
121
96
  classes.push(`hds-form-radio-card--align-${this.alignment}`);
122
97
 
123
- // add a class based on the @layout argument
124
- classes.push(`hds-form-radio-card--layout-${this.layout}`);
125
-
126
98
  return classes.join(' ');
127
99
  }
128
100
  }