@hashicorp/design-system-components 0.7.1 → 0.8.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.
- package/CHANGELOG.md +6 -0
- package/addon/components/hds/button/index.js +0 -1
- package/addon/components/hds/link/cta.hbs +50 -0
- package/addon/components/hds/link/cta.js +150 -0
- package/addon/components/hds/link-to/cta.hbs +51 -0
- package/addon/components/hds/link-to/cta.js +165 -0
- package/app/components/hds/link/cta.js +1 -0
- package/app/components/hds/link-to/cta.js +1 -0
- package/app/styles/@hashicorp/design-system-components.scss +1 -0
- package/app/styles/components/link/cta.scss +28 -0
- package/package.json +2 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @hashicorp/design-system-components
|
|
2
2
|
|
|
3
|
+
## 0.8.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#115](https://github.com/hashicorp/design-system/pull/115) [`caff569b`](https://github.com/hashicorp/design-system/commit/caff569b46a9a46940eab94d263816dd7d046c56) Thanks [@didoo](https://github.com/didoo)! - added “Link::CTA“ and “LinkTo::CTA” components
|
|
8
|
+
|
|
3
9
|
## 0.7.1
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
|
@@ -160,7 +160,6 @@ export default class HdsButtonIndexComponent extends Component {
|
|
|
160
160
|
* @method Button#classNames
|
|
161
161
|
* @return {string} The "class" attribute to apply to the component.
|
|
162
162
|
*/
|
|
163
|
-
// "hds-button {{this.sizeClass}} {{this.colorClass}} {{this.widthClass}}"
|
|
164
163
|
get classNames() {
|
|
165
164
|
let classes = ['hds-button'];
|
|
166
165
|
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
{{!
|
|
2
|
+
// ██ ██ █████ ██████ ███ ██ ██ ███ ██ ██████
|
|
3
|
+
// ██ ██ ██ ██ ██ ██ ████ ██ ██ ████ ██ ██
|
|
4
|
+
// ██ █ ██ ███████ ██████ ██ ██ ██ ██ ██ ██ ██ ██ ███
|
|
5
|
+
// ██ ███ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██
|
|
6
|
+
// ███ ███ ██ ██ ██ ██ ██ ████ ██ ██ ████ ██████
|
|
7
|
+
//
|
|
8
|
+
// Notice: in this component we're using directly the styles from the `Hds::Button` component
|
|
9
|
+
// using the `hds-button` class names (and adding a specialized class for the "cta", see below)
|
|
10
|
+
// If you need to change the styling of the `Button` component, remember that this will impact also
|
|
11
|
+
// this component too.
|
|
12
|
+
// If instead you need to change only the styling of the `CTA` component, you can do it
|
|
13
|
+
// in the CSS file using the specialized class declared there.
|
|
14
|
+
// This is NOT a standard approach that we use in the HDS design system implementation, but it's been
|
|
15
|
+
// the least worst option we could find to solve the problem of sharing the exact same style of the
|
|
16
|
+
// `Button (primary)` with other components.
|
|
17
|
+
}}
|
|
18
|
+
|
|
19
|
+
{{! template-lint-disable link-href-attributes }}
|
|
20
|
+
{{! we can disable this linting rule because the developer will add the html attribute themselves }}
|
|
21
|
+
<a
|
|
22
|
+
class={{this.classNames}}
|
|
23
|
+
target="_blank"
|
|
24
|
+
rel="noopener noreferrer"
|
|
25
|
+
...attributes
|
|
26
|
+
{{did-insert this.didInsert}}
|
|
27
|
+
{{on-key "Space" this.onKeySpace}}
|
|
28
|
+
>
|
|
29
|
+
{{#if this.icon}}
|
|
30
|
+
{{#if (eq this.iconPosition "leading")}}
|
|
31
|
+
<div class="hds-button__icon">
|
|
32
|
+
<FlightIcon @name={{this.icon}} @size={{this.iconSize}} @stretched={{true}} />
|
|
33
|
+
</div>
|
|
34
|
+
<div class="hds-button__text">
|
|
35
|
+
{{this.text}}
|
|
36
|
+
</div>
|
|
37
|
+
{{else}}
|
|
38
|
+
<div class="hds-button__text">
|
|
39
|
+
{{this.text}}
|
|
40
|
+
</div>
|
|
41
|
+
<div class="hds-button__icon">
|
|
42
|
+
<FlightIcon @name={{this.icon}} @size={{this.iconSize}} @stretched={{true}} />
|
|
43
|
+
</div>
|
|
44
|
+
{{/if}}
|
|
45
|
+
{{else}}
|
|
46
|
+
<div class="hds-button__text">
|
|
47
|
+
{{this.text}}
|
|
48
|
+
</div>
|
|
49
|
+
{{/if}}
|
|
50
|
+
</a>
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
// ██ ██ █████ ██████ ███ ██ ██ ███ ██ ██████
|
|
2
|
+
// ██ ██ ██ ██ ██ ██ ████ ██ ██ ████ ██ ██
|
|
3
|
+
// ██ █ ██ ███████ ██████ ██ ██ ██ ██ ██ ██ ██ ██ ███
|
|
4
|
+
// ██ ███ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██
|
|
5
|
+
// ███ ███ ██ ██ ██ ██ ██ ████ ██ ██ ████ ██████
|
|
6
|
+
//
|
|
7
|
+
// Notice: in this component we're using directly the styles from the `Hds::Button` component
|
|
8
|
+
// using the `hds-button` class names (and adding a specialized class for the "cta", see below)
|
|
9
|
+
// If you need to change the styling of the `Button` component, remember that this will impact also
|
|
10
|
+
// this component too.
|
|
11
|
+
// If instead you need to change only the styling of the `CTA` component, you can do it
|
|
12
|
+
// in the CSS file using the specialized class declared there.
|
|
13
|
+
// This is NOT a standard approach that we use in the HDS design system implementation, but it's been
|
|
14
|
+
// the least worst option we could find to solve the problem of sharing the exact same style of the
|
|
15
|
+
// `Button (primary)` with other components.
|
|
16
|
+
|
|
17
|
+
import Component from '@glimmer/component';
|
|
18
|
+
import { assert } from '@ember/debug';
|
|
19
|
+
import { action } from '@ember/object';
|
|
20
|
+
|
|
21
|
+
export const DEFAULT_SIZE = 'medium';
|
|
22
|
+
export const DEFAULT_ICONPOSITION = 'leading';
|
|
23
|
+
export const SIZES = ['small', 'medium', 'large'];
|
|
24
|
+
export const ICONPOSITIONS = ['leading', 'trailing'];
|
|
25
|
+
|
|
26
|
+
export default class HdsLinkCtaComponent extends Component {
|
|
27
|
+
/**
|
|
28
|
+
* @param text
|
|
29
|
+
* @type {string}
|
|
30
|
+
* @description The text of the component. If no text value is defined an error will be thrown.
|
|
31
|
+
*/
|
|
32
|
+
get text() {
|
|
33
|
+
let { text } = this.args;
|
|
34
|
+
|
|
35
|
+
assert(
|
|
36
|
+
'@text for "Hds::Link::Cta" must have a valid value',
|
|
37
|
+
text !== undefined
|
|
38
|
+
);
|
|
39
|
+
|
|
40
|
+
return text;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* @param size
|
|
45
|
+
* @type {string}
|
|
46
|
+
* @default medium
|
|
47
|
+
* @description The size of the component; acceptable values are `small`, `medium`, and `large`
|
|
48
|
+
*/
|
|
49
|
+
get size() {
|
|
50
|
+
let { size = DEFAULT_SIZE } = this.args;
|
|
51
|
+
|
|
52
|
+
assert(
|
|
53
|
+
`@size for "Hds::Link::Cta" must be one of the following: ${SIZES.join(
|
|
54
|
+
', '
|
|
55
|
+
)}; received: ${size}`,
|
|
56
|
+
SIZES.includes(size)
|
|
57
|
+
);
|
|
58
|
+
|
|
59
|
+
return size;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* @param icon
|
|
64
|
+
* @type {string}
|
|
65
|
+
* @default null
|
|
66
|
+
* @description The name of the icon to be used.
|
|
67
|
+
*/
|
|
68
|
+
get icon() {
|
|
69
|
+
return this.args.icon ?? null;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* @param iconPosition
|
|
74
|
+
* @type {string}
|
|
75
|
+
* @default leading
|
|
76
|
+
* @description Positions the icon before or after the text; allowed values are `leading` or `trailing`
|
|
77
|
+
*/
|
|
78
|
+
get iconPosition() {
|
|
79
|
+
let { iconPosition = DEFAULT_ICONPOSITION } = this.args;
|
|
80
|
+
|
|
81
|
+
assert(
|
|
82
|
+
`@iconPosition for "Hds::Link::Cta" must be one of the following: ${ICONPOSITIONS.join(
|
|
83
|
+
', '
|
|
84
|
+
)}; received: ${iconPosition}`,
|
|
85
|
+
ICONPOSITIONS.includes(iconPosition)
|
|
86
|
+
);
|
|
87
|
+
|
|
88
|
+
return iconPosition;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* @param iconSize
|
|
93
|
+
* @type {string}
|
|
94
|
+
* @default 16
|
|
95
|
+
* @description ensures that the correct icon size is used. Automatically calculated.
|
|
96
|
+
*/
|
|
97
|
+
get iconSize() {
|
|
98
|
+
if (this.args.size === 'large') {
|
|
99
|
+
return '24';
|
|
100
|
+
} else {
|
|
101
|
+
return '16';
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* @param isFullWidth
|
|
107
|
+
* @type {boolean}
|
|
108
|
+
* @default false
|
|
109
|
+
* @description Indicates that the component should take up the full width of the parent container. The default is false.
|
|
110
|
+
*/
|
|
111
|
+
get isFullWidth() {
|
|
112
|
+
return this.args.isFullWidth ?? false;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
@action
|
|
116
|
+
didInsert(el) {
|
|
117
|
+
// we need to register the element to compare it with the one that triggered the "key/space" event
|
|
118
|
+
this.el = el;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
@action
|
|
122
|
+
onKeySpace(event) {
|
|
123
|
+
if (event.target === this.el) {
|
|
124
|
+
event.target.click();
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* Get the class names to apply to the component.
|
|
130
|
+
* @method classNames
|
|
131
|
+
* @return {string} The "class" attribute to apply to the component.
|
|
132
|
+
*/
|
|
133
|
+
get classNames() {
|
|
134
|
+
let classes = [
|
|
135
|
+
'hds-button',
|
|
136
|
+
'hds-button--color-primary',
|
|
137
|
+
'hds-link-cta--inherit-button-styles',
|
|
138
|
+
];
|
|
139
|
+
|
|
140
|
+
// add a class based on the @size argument
|
|
141
|
+
classes.push(`hds-button--size-${this.size}`);
|
|
142
|
+
|
|
143
|
+
// add a class based on the @isFullWidth argument
|
|
144
|
+
if (this.isFullWidth) {
|
|
145
|
+
classes.push('hds-button--width-full');
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
return classes.join(' ');
|
|
149
|
+
}
|
|
150
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
{{!
|
|
2
|
+
// ██ ██ █████ ██████ ███ ██ ██ ███ ██ ██████
|
|
3
|
+
// ██ ██ ██ ██ ██ ██ ████ ██ ██ ████ ██ ██
|
|
4
|
+
// ██ █ ██ ███████ ██████ ██ ██ ██ ██ ██ ██ ██ ██ ███
|
|
5
|
+
// ██ ███ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██
|
|
6
|
+
// ███ ███ ██ ██ ██ ██ ██ ████ ██ ██ ████ ██████
|
|
7
|
+
//
|
|
8
|
+
// Notice: in this component we're using directly the styles from the `Hds::Button` component
|
|
9
|
+
// using the `hds-button` class names (and adding a specialized class for the "cta", see below)
|
|
10
|
+
// If you need to change the styling of the `Button` component, remember that this will impact also
|
|
11
|
+
// this component too.
|
|
12
|
+
// If instead you need to change only the styling of the `CTA` component, you can do it
|
|
13
|
+
// in the CSS file using the specialized class declared there.
|
|
14
|
+
// This is NOT a standard approach that we use in the HDS design system implementation, but it's been
|
|
15
|
+
// the least worst option we could find to solve the problem of sharing the exact same style of the
|
|
16
|
+
// `Button (primary)` with other components.
|
|
17
|
+
}}
|
|
18
|
+
|
|
19
|
+
<LinkTo
|
|
20
|
+
class={{this.classNames}}
|
|
21
|
+
@current-when={{@current-when}}
|
|
22
|
+
@models={{hds-link-to-models @model @models}}
|
|
23
|
+
@query={{hds-link-to-query @query}}
|
|
24
|
+
@replace={{@replace}}
|
|
25
|
+
@route={{this.route}}
|
|
26
|
+
...attributes
|
|
27
|
+
{{did-insert this.didInsert}}
|
|
28
|
+
{{on-key "Space" this.onKeySpace}}
|
|
29
|
+
>
|
|
30
|
+
{{#if this.icon}}
|
|
31
|
+
{{#if (eq this.iconPosition "leading")}}
|
|
32
|
+
<div class="hds-button__icon">
|
|
33
|
+
<FlightIcon @name={{this.icon}} @size={{this.iconSize}} @stretched={{true}} />
|
|
34
|
+
</div>
|
|
35
|
+
<div class="hds-button__text">
|
|
36
|
+
{{this.text}}
|
|
37
|
+
</div>
|
|
38
|
+
{{else}}
|
|
39
|
+
<div class="hds-button__text">
|
|
40
|
+
{{this.text}}
|
|
41
|
+
</div>
|
|
42
|
+
<div class="hds-button__icon">
|
|
43
|
+
<FlightIcon @name={{this.icon}} @size={{this.iconSize}} @stretched={{true}} />
|
|
44
|
+
</div>
|
|
45
|
+
{{/if}}
|
|
46
|
+
{{else}}
|
|
47
|
+
<div class="hds-button__text">
|
|
48
|
+
{{this.text}}
|
|
49
|
+
</div>
|
|
50
|
+
{{/if}}
|
|
51
|
+
</LinkTo>
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
// ██ ██ █████ ██████ ███ ██ ██ ███ ██ ██████
|
|
2
|
+
// ██ ██ ██ ██ ██ ██ ████ ██ ██ ████ ██ ██
|
|
3
|
+
// ██ █ ██ ███████ ██████ ██ ██ ██ ██ ██ ██ ██ ██ ███
|
|
4
|
+
// ██ ███ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██
|
|
5
|
+
// ███ ███ ██ ██ ██ ██ ██ ████ ██ ██ ████ ██████
|
|
6
|
+
//
|
|
7
|
+
// Notice: in this component we're using directly the styles from the `Hds::Button` component
|
|
8
|
+
// using the `hds-button` class names (and adding a specialized class for the "cta", see below)
|
|
9
|
+
// If you need to change the styling of the `Button` component, remember that this will impact also
|
|
10
|
+
// this component too.
|
|
11
|
+
// If instead you need to change only the styling of the `CTA` component, you can do it
|
|
12
|
+
// in the CSS file using the specialized class declared there.
|
|
13
|
+
// This is NOT a standard approach that we use in the HDS design system implementation, but it's been
|
|
14
|
+
// the least worst option we could find to solve the problem of sharing the exact same style of the
|
|
15
|
+
// `Button (primary)` with other components.
|
|
16
|
+
|
|
17
|
+
import Component from '@glimmer/component';
|
|
18
|
+
import { assert } from '@ember/debug';
|
|
19
|
+
import { action } from '@ember/object';
|
|
20
|
+
|
|
21
|
+
export const DEFAULT_SIZE = 'medium';
|
|
22
|
+
export const DEFAULT_ICONPOSITION = 'leading';
|
|
23
|
+
export const SIZES = ['small', 'medium', 'large'];
|
|
24
|
+
export const ICONPOSITIONS = ['leading', 'trailing'];
|
|
25
|
+
|
|
26
|
+
export default class HdsLinkToCtaComponent extends Component {
|
|
27
|
+
/**
|
|
28
|
+
* @param text
|
|
29
|
+
* @type {string}
|
|
30
|
+
* @description The text of the component. If no text value is defined an error will be thrown.
|
|
31
|
+
*/
|
|
32
|
+
get text() {
|
|
33
|
+
let { text } = this.args;
|
|
34
|
+
|
|
35
|
+
assert(
|
|
36
|
+
'@text for "Hds::LinkTo::Cta" must have a valid value',
|
|
37
|
+
text !== undefined
|
|
38
|
+
);
|
|
39
|
+
|
|
40
|
+
return text;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* @param size
|
|
45
|
+
* @type {string}
|
|
46
|
+
* @default medium
|
|
47
|
+
* @description The size of the component; acceptable values are `small`, `medium`, and `large`
|
|
48
|
+
*/
|
|
49
|
+
get size() {
|
|
50
|
+
let { size = DEFAULT_SIZE } = this.args;
|
|
51
|
+
|
|
52
|
+
assert(
|
|
53
|
+
`@size for "Hds::LinkTo::Cta" must be one of the following: ${SIZES.join(
|
|
54
|
+
', '
|
|
55
|
+
)}; received: ${size}`,
|
|
56
|
+
SIZES.includes(size)
|
|
57
|
+
);
|
|
58
|
+
|
|
59
|
+
return size;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* @param icon
|
|
64
|
+
* @type {string}
|
|
65
|
+
* @default null
|
|
66
|
+
* @description The name of the icon to be used.
|
|
67
|
+
*/
|
|
68
|
+
get icon() {
|
|
69
|
+
return this.args.icon ?? null;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* @param iconPosition
|
|
74
|
+
* @type {string}
|
|
75
|
+
* @default leading
|
|
76
|
+
* @description Positions the icon before or after the text; allowed values are `leading` or `trailing`
|
|
77
|
+
*/
|
|
78
|
+
get iconPosition() {
|
|
79
|
+
let { iconPosition = DEFAULT_ICONPOSITION } = this.args;
|
|
80
|
+
|
|
81
|
+
assert(
|
|
82
|
+
`@iconPosition for "Hds::LinkTo::Cta" must be one of the following: ${ICONPOSITIONS.join(
|
|
83
|
+
', '
|
|
84
|
+
)}; received: ${iconPosition}`,
|
|
85
|
+
ICONPOSITIONS.includes(iconPosition)
|
|
86
|
+
);
|
|
87
|
+
|
|
88
|
+
return iconPosition;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* @param iconSize
|
|
93
|
+
* @type {string}
|
|
94
|
+
* @default 16
|
|
95
|
+
* @description ensures that the correct icon size is used. Automatically calculated.
|
|
96
|
+
*/
|
|
97
|
+
get iconSize() {
|
|
98
|
+
if (this.args.size === 'large') {
|
|
99
|
+
return '24';
|
|
100
|
+
} else {
|
|
101
|
+
return '16';
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* @param isFullWidth
|
|
107
|
+
* @type {boolean}
|
|
108
|
+
* @default false
|
|
109
|
+
* @description Indicates that the component should take up the full width of the parent container. The default is false.
|
|
110
|
+
*/
|
|
111
|
+
get isFullWidth() {
|
|
112
|
+
return this.args.isFullWidth ?? false;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* @param route
|
|
117
|
+
* @type {string|null}
|
|
118
|
+
* @description Checks to make sure route is defined.
|
|
119
|
+
*/
|
|
120
|
+
get route() {
|
|
121
|
+
let { route } = this.args;
|
|
122
|
+
assert(
|
|
123
|
+
'@route must be defined for "Hds::LinkTo::Cta"',
|
|
124
|
+
route !== undefined
|
|
125
|
+
);
|
|
126
|
+
|
|
127
|
+
return route;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
@action
|
|
131
|
+
didInsert(el) {
|
|
132
|
+
// we need to register the element to compare it with the one that triggered the "key/space" event
|
|
133
|
+
this.el = el;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
@action
|
|
137
|
+
onKeySpace(event) {
|
|
138
|
+
if (event.target === this.el) {
|
|
139
|
+
event.target.click();
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* Get the class names to apply to the component.
|
|
145
|
+
* @method classNames
|
|
146
|
+
* @return {string} The "class" attribute to apply to the component.
|
|
147
|
+
*/
|
|
148
|
+
get classNames() {
|
|
149
|
+
let classes = [
|
|
150
|
+
'hds-button',
|
|
151
|
+
'hds-button--color-primary',
|
|
152
|
+
'hds-link-cta--inherit-button-styles',
|
|
153
|
+
];
|
|
154
|
+
|
|
155
|
+
// add a class based on the @size argument
|
|
156
|
+
classes.push(`hds-button--size-${this.size}`);
|
|
157
|
+
|
|
158
|
+
// add a class based on the @isFullWidth argument
|
|
159
|
+
if (this.isFullWidth) {
|
|
160
|
+
classes.push('hds-button--width-full');
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
return classes.join(' ');
|
|
164
|
+
}
|
|
165
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from '@hashicorp/design-system-components/components/hds/link/cta';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from '@hashicorp/design-system-components/components/hds/link-to/cta';
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
// ██ ██ █████ ██████ ███ ██ ██ ███ ██ ██████
|
|
2
|
+
// ██ ██ ██ ██ ██ ██ ████ ██ ██ ████ ██ ██
|
|
3
|
+
// ██ █ ██ ███████ ██████ ██ ██ ██ ██ ██ ██ ██ ██ ███
|
|
4
|
+
// ██ ███ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██
|
|
5
|
+
// ███ ███ ██ ██ ██ ██ ██ ████ ██ ██ ████ ██████
|
|
6
|
+
//
|
|
7
|
+
// Notice: in this component we're using directly the styles from the `Hds::Button` component
|
|
8
|
+
// using the `hds-button` class names (and adding a specialized class for the "cta", see below)
|
|
9
|
+
// If you need to change the styling of the `Button` component, remember that this will impact also
|
|
10
|
+
// this component too.
|
|
11
|
+
// If instead you need to change only the styling of the `CTA` component, you can do it here using
|
|
12
|
+
// the specialized class declared below.
|
|
13
|
+
// This is NOT a standard approach that we use in the HDS design system implementation, but it's been
|
|
14
|
+
// the least worst option we could find to solve the problem of sharing the exact same style of the
|
|
15
|
+
// `Button (primary)` with other components.
|
|
16
|
+
|
|
17
|
+
//
|
|
18
|
+
// LINK > CTA COMPONENT
|
|
19
|
+
//
|
|
20
|
+
// properties within each class are sorted alphabetically
|
|
21
|
+
//
|
|
22
|
+
//
|
|
23
|
+
|
|
24
|
+
.hds-link-cta--inherit-button-styles {
|
|
25
|
+
isolation: isolate;
|
|
26
|
+
text-decoration: none;
|
|
27
|
+
width: fit-content;
|
|
28
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hashicorp/design-system-components",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.0",
|
|
4
4
|
"description": "HashiCorp Design System Components",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"hashicorp",
|
|
@@ -41,6 +41,7 @@
|
|
|
41
41
|
"ember-cli-htmlbars": "^5.7.1",
|
|
42
42
|
"ember-cli-sass": "^10.0.1",
|
|
43
43
|
"ember-focus-trap": "^1.0.1",
|
|
44
|
+
"ember-keyboard": "^8.0.0",
|
|
44
45
|
"ember-named-blocks-polyfill": "^0.2.5",
|
|
45
46
|
"sass": "^1.43.4"
|
|
46
47
|
},
|