@hashicorp/design-system-components 2.10.0 → 2.12.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 +41 -0
- package/addon/components/hds/dropdown/list-item/checkbox.hbs +11 -10
- package/addon/components/hds/dropdown/list-item/radio.hbs +13 -10
- package/addon/components/hds/form/indicator/index.hbs +1 -1
- package/addon/components/hds/form/masked-input/base.hbs +8 -0
- package/addon/components/hds/form/masked-input/base.js +14 -1
- package/addon/components/hds/form/masked-input/field.hbs +1 -0
- package/addon/components/hds/icon-tile/index.js +1 -0
- package/addon/components/hds/text/body.hbs +14 -0
- package/addon/components/hds/text/body.js +73 -0
- package/addon/components/hds/text/code.hbs +14 -0
- package/addon/components/hds/text/code.js +73 -0
- package/addon/components/hds/text/display.hbs +14 -0
- package/addon/components/hds/text/display.js +85 -0
- package/addon/components/hds/text/index.hbs +8 -0
- package/addon/components/hds/text/index.js +146 -0
- package/app/components/hds/text/body.js +6 -0
- package/app/components/hds/text/code.js +6 -0
- package/app/components/hds/text/display.js +6 -0
- package/app/components/hds/text/index.js +6 -0
- package/app/styles/@hashicorp/design-system-components.scss +1 -0
- package/app/styles/components/alert.scss +5 -5
- package/app/styles/components/dropdown.scss +6 -3
- package/app/styles/components/form/masked-input.scss +11 -0
- package/app/styles/components/icon-tile.scss +1 -1
- package/app/styles/components/link/standalone.scss +1 -1
- package/app/styles/components/stepper/step-indicator.scss +0 -7
- package/app/styles/components/text.scss +25 -0
- package/package.json +3 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,46 @@
|
|
|
1
1
|
# @hashicorp/design-system-components
|
|
2
2
|
|
|
3
|
+
## 2.12.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#1640](https://github.com/hashicorp/design-system/pull/1640) [`8001667d2`](https://github.com/hashicorp/design-system/commit/8001667d2b0b549b5c2743ebaa4b50b58344a87f) Thanks [@didoo](https://github.com/didoo)! - `Design tokens` - Added color tokens for “Vault Secrets” product
|
|
8
|
+
|
|
9
|
+
`IconTile` - updated component to include `vault-secrets` product option
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [#1615](https://github.com/hashicorp/design-system/pull/1615) [`d5d4402b2`](https://github.com/hashicorp/design-system/commit/d5d4402b2b7529d60ac693babc2a9187f8fbad36) Thanks [@didoo](https://github.com/didoo)! - `Text` - Removed leftover `console.log` from code
|
|
14
|
+
|
|
15
|
+
- [#1618](https://github.com/hashicorp/design-system/pull/1618) [`4e31014d5`](https://github.com/hashicorp/design-system/commit/4e31014d503d4b71e6b70b11ba750b75c0cb2d37) Thanks [@KristinLBradley](https://github.com/KristinLBradley)! - Refactor the layout of the `Dropdown` checkbox and radio inputs to make the gap between the inputs and the associated text, as well as the icon and count, clickable.
|
|
16
|
+
|
|
17
|
+
- [#1617](https://github.com/hashicorp/design-system/pull/1617) [`214f66e9e`](https://github.com/hashicorp/design-system/commit/214f66e9e8818da87e6d514b3808b40a0b7e56f5) Thanks [@KristinLBradley](https://github.com/KristinLBradley)! - Change font-weight of `Hds::Link::Standalone` from 500 to 400 to match font-weight of `Hds::Button`.
|
|
18
|
+
|
|
19
|
+
- [#1628](https://github.com/hashicorp/design-system/pull/1628) [`cc15349d3`](https://github.com/hashicorp/design-system/commit/cc15349d31c698d89540897570f76a5f2dc670ce) Thanks [@didoo](https://github.com/didoo)! - `Stepper` - removed some CSS declarations that were not used/applied
|
|
20
|
+
|
|
21
|
+
- Updated dependencies [[`8001667d2`](https://github.com/hashicorp/design-system/commit/8001667d2b0b549b5c2743ebaa4b50b58344a87f)]:
|
|
22
|
+
- @hashicorp/design-system-tokens@1.8.0
|
|
23
|
+
- @hashicorp/ember-flight-icons@3.1.2
|
|
24
|
+
|
|
25
|
+
## 2.11.0
|
|
26
|
+
|
|
27
|
+
### Minor Changes
|
|
28
|
+
|
|
29
|
+
- [#1490](https://github.com/hashicorp/design-system/pull/1490) [`4dafcb7d7`](https://github.com/hashicorp/design-system/commit/4dafcb7d7568027c495cb92d01026359a040507a) Thanks [@didoo](https://github.com/didoo)! - `Hds::Text` - Added new `Text` component
|
|
30
|
+
|
|
31
|
+
- [#1587](https://github.com/hashicorp/design-system/pull/1587) [`57e7a42cb`](https://github.com/hashicorp/design-system/commit/57e7a42cb8353af83d8be5be0a318f951b00d3e3) Thanks [@alex-ju](https://github.com/alex-ju)! - `Hds::Form::MaskedInput` - Add `hasCopyButton` argument
|
|
32
|
+
|
|
33
|
+
### Patch Changes
|
|
34
|
+
|
|
35
|
+
- [#1577](https://github.com/hashicorp/design-system/pull/1577) [`8aa9a5889`](https://github.com/hashicorp/design-system/commit/8aa9a5889cf14fc28100a462dfd42754a3bdb42b) Thanks [@DingoEatingFuzz](https://github.com/DingoEatingFuzz)! - Remove aria-hidden from the "optional" span in Form::Indicator
|
|
36
|
+
|
|
37
|
+
- [#1606](https://github.com/hashicorp/design-system/pull/1606) [`7ac4526db`](https://github.com/hashicorp/design-system/commit/7ac4526dbddda6bea0e6e9f542addc5c97914fa8) Thanks [@Dhaulagiri](https://github.com/Dhaulagiri)! - Remove `ember-named-blocks-polyfill` as all consumers of HDS are on Ember 3.25 or later now. This can be installed locally if it is still needed.
|
|
38
|
+
|
|
39
|
+
- [#1576](https://github.com/hashicorp/design-system/pull/1576) [`e16c88ba9`](https://github.com/hashicorp/design-system/commit/e16c88ba959dcd0b186fd823fc3fccacf39674e8) Thanks [@KristinLBradley](https://github.com/KristinLBradley)! - `Alert`, `Toast`: Fixed an issue with anchor tag color styles within Description that had been overriding `Hds::Link` color; changed the default color for HTML links within Description to "neutral" to better align with existing guidance for links in the actions and improve accessible contrast.
|
|
40
|
+
|
|
41
|
+
- Updated dependencies []:
|
|
42
|
+
- @hashicorp/ember-flight-icons@3.1.1
|
|
43
|
+
|
|
3
44
|
## 2.10.0
|
|
4
45
|
|
|
5
46
|
### Minor Changes
|
|
@@ -4,16 +4,17 @@
|
|
|
4
4
|
}}
|
|
5
5
|
|
|
6
6
|
<li class="hds-dropdown-list-item hds-dropdown-list-item--variant-checkbox">
|
|
7
|
-
<Hds::Form::Checkbox::Base class="hds-dropdown-list-item__control" id={{this.id}} @value={{@value}} ...attributes />
|
|
8
|
-
{{#if @icon}}
|
|
9
|
-
<div class="hds-dropdown-list-item__icon">
|
|
10
|
-
<FlightIcon @name={{@icon}} @isInlineBlock={{false}} />
|
|
11
|
-
</div>
|
|
12
|
-
{{/if}}
|
|
13
7
|
<label class="hds-dropdown-list-item__label hds-typography-body-200" for={{this.id}}>
|
|
14
|
-
{{
|
|
8
|
+
<Hds::Form::Checkbox::Base class="hds-dropdown-list-item__control" id={{this.id}} @value={{@value}} ...attributes />
|
|
9
|
+
{{#if @icon}}
|
|
10
|
+
<span class="hds-dropdown-list-item__icon">
|
|
11
|
+
<FlightIcon @name={{@icon}} @isInlineBlock={{false}} />
|
|
12
|
+
</span>
|
|
13
|
+
{{/if}}
|
|
14
|
+
<span class="hds-dropdown-list-item__text-content">{{yield}}</span>
|
|
15
|
+
|
|
16
|
+
{{#if @count}}
|
|
17
|
+
<span class="hds-dropdown-list-item__count hds-typography-body-100 hds-font-weight-medium">{{@count}}</span>
|
|
18
|
+
{{/if}}
|
|
15
19
|
</label>
|
|
16
|
-
{{#if @count}}
|
|
17
|
-
<span class="hds-dropdown-list-item__count hds-typography-body-100 hds-font-weight-medium">{{@count}}</span>
|
|
18
|
-
{{/if}}
|
|
19
20
|
</li>
|
|
@@ -4,14 +4,17 @@
|
|
|
4
4
|
}}
|
|
5
5
|
|
|
6
6
|
<li class="hds-dropdown-list-item hds-dropdown-list-item--variant-radio">
|
|
7
|
-
<
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
<
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
7
|
+
<label class="hds-dropdown-list-item__label hds-typography-body-200" for={{this.id}}>
|
|
8
|
+
<Hds::Form::Radio::Base class="hds-dropdown-list-item__control" id={{this.id}} @value={{@value}} ...attributes />
|
|
9
|
+
{{#if @icon}}
|
|
10
|
+
<div class="hds-dropdown-list-item__icon">
|
|
11
|
+
<FlightIcon @name={{@icon}} @isInlineBlock={{false}} />
|
|
12
|
+
</div>
|
|
13
|
+
{{/if}}
|
|
14
|
+
<span class="hds-dropdown-list-item__text-content">{{yield}}</span>
|
|
15
|
+
|
|
16
|
+
{{#if @count}}
|
|
17
|
+
<span class="hds-dropdown-list-item__count hds-typography-body-100 hds-font-weight-medium">{{@count}}</span>
|
|
18
|
+
{{/if}}
|
|
19
|
+
</label>
|
|
17
20
|
</li>
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
SPDX-License-Identifier: MPL-2.0
|
|
4
4
|
}}
|
|
5
5
|
{{#if @isOptional}}
|
|
6
|
-
<span
|
|
6
|
+
<span class={{this.classNames}}>(Optional)</span>
|
|
7
7
|
{{/if}}
|
|
8
8
|
{{#if @isRequired}}
|
|
9
9
|
<Hds::Badge aria-hidden="true" class={{this.classNames}} @size="small" @color="neutral" @text="Required" />
|
|
@@ -31,4 +31,12 @@
|
|
|
31
31
|
<FlightIcon @name={{if this.isMasked "eye" "eye-off"}} @size="16" @isInlineBlock={{false}} />
|
|
32
32
|
<span class="sr-only" aria-live="polite">{{this.ariaMessageText}}</span>
|
|
33
33
|
</button>
|
|
34
|
+
{{#if @hasCopyButton}}
|
|
35
|
+
<Hds::Copy::Button
|
|
36
|
+
class="hds-form-masked-input__copy-button"
|
|
37
|
+
@text={{this.copyButtonText}}
|
|
38
|
+
@isIconOnly={{true}}
|
|
39
|
+
@textToCopy="{{@value}}"
|
|
40
|
+
/>
|
|
41
|
+
{{/if}}
|
|
34
42
|
</div>
|
|
@@ -41,7 +41,7 @@ export default class HdsFormMaskedInputBaseComponent extends Component {
|
|
|
41
41
|
/**
|
|
42
42
|
* @param ariaMessageText
|
|
43
43
|
* @type {string}
|
|
44
|
-
* @default ''
|
|
44
|
+
* @default 'Input content is now hidden'
|
|
45
45
|
*/
|
|
46
46
|
get ariaMessageText() {
|
|
47
47
|
if (this.args.ariaMessageText) {
|
|
@@ -53,6 +53,19 @@ export default class HdsFormMaskedInputBaseComponent extends Component {
|
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
+
/**
|
|
57
|
+
* @param copyButtonText
|
|
58
|
+
* @type {string}
|
|
59
|
+
* @default 'Copy masked content'
|
|
60
|
+
*/
|
|
61
|
+
get copyButtonText() {
|
|
62
|
+
if (this.args.copyButtonText) {
|
|
63
|
+
return this.args.copyButtonText;
|
|
64
|
+
} else {
|
|
65
|
+
return 'Copy masked content';
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
56
69
|
/**
|
|
57
70
|
* Get the class names to apply to the component.
|
|
58
71
|
* @method classNames
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{{!
|
|
2
|
+
Copyright (c) HashiCorp, Inc.
|
|
3
|
+
SPDX-License-Identifier: MPL-2.0
|
|
4
|
+
}}
|
|
5
|
+
|
|
6
|
+
<Hds::Text
|
|
7
|
+
@group="body"
|
|
8
|
+
@size={{this.size}}
|
|
9
|
+
@weight={{this.weight}}
|
|
10
|
+
@align={{@align}}
|
|
11
|
+
@color={{@color}}
|
|
12
|
+
@tag={{@tag}}
|
|
13
|
+
...attributes
|
|
14
|
+
>{{yield}}</Hds::Text>
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) HashiCorp, Inc.
|
|
3
|
+
* SPDX-License-Identifier: MPL-2.0
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import Component from '@glimmer/component';
|
|
7
|
+
import { assert } from '@ember/debug';
|
|
8
|
+
|
|
9
|
+
// notice: only some combinations of size + font-weight are allowed (per design specs)
|
|
10
|
+
// see: https://www.figma.com/file/oQsMzMMnynfPWpMEt91OpH/HDS-Product---Foundations?node-id=1262%3A9192
|
|
11
|
+
|
|
12
|
+
export const DEFAULT_SIZE = '200';
|
|
13
|
+
export const AVAILABLE_SIZES = [300, 200, 100];
|
|
14
|
+
|
|
15
|
+
export const DEFAULT_WEIGHT = 'regular';
|
|
16
|
+
export const AVAILABLE_WEIGHTS_PER_SIZE = {
|
|
17
|
+
300: ['regular', 'medium', 'semibold'],
|
|
18
|
+
200: ['regular', 'medium', 'semibold'],
|
|
19
|
+
100: ['regular', 'medium', 'semibold'],
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export default class HdsTextBodyComponent extends Component {
|
|
23
|
+
/**
|
|
24
|
+
* Sets the "size" for the text
|
|
25
|
+
* Accepted values: see AVAILABLE_SIZES
|
|
26
|
+
*
|
|
27
|
+
* @type {string}
|
|
28
|
+
*
|
|
29
|
+
* @param size
|
|
30
|
+
*/
|
|
31
|
+
get size() {
|
|
32
|
+
let { size = DEFAULT_SIZE } = this.args;
|
|
33
|
+
|
|
34
|
+
// let's be a bit forgiving with the consumers
|
|
35
|
+
if (typeof size === 'string') {
|
|
36
|
+
size = parseInt(size, 10);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
assert(
|
|
40
|
+
`@size for "Hds::Text::Body" must be one of the following: ${AVAILABLE_SIZES.join(
|
|
41
|
+
', '
|
|
42
|
+
)}; received: ${size}`,
|
|
43
|
+
AVAILABLE_SIZES.includes(size)
|
|
44
|
+
);
|
|
45
|
+
|
|
46
|
+
return size;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Sets the "weight" for the text
|
|
51
|
+
* Accepted values: see AVAILABLE_WEIGHTS_PER_SIZE
|
|
52
|
+
*
|
|
53
|
+
* @type {string}
|
|
54
|
+
*
|
|
55
|
+
* @param variant
|
|
56
|
+
*/
|
|
57
|
+
get weight() {
|
|
58
|
+
let { weight = DEFAULT_WEIGHT } = this.args;
|
|
59
|
+
|
|
60
|
+
const availableWeights = AVAILABLE_WEIGHTS_PER_SIZE[this.size];
|
|
61
|
+
|
|
62
|
+
assert(
|
|
63
|
+
`@weight for "Hds::Text::Body" with @size=${
|
|
64
|
+
this.size
|
|
65
|
+
} must be one of the following: ${availableWeights.join(
|
|
66
|
+
', '
|
|
67
|
+
)}; received: ${weight}`,
|
|
68
|
+
availableWeights.includes(weight)
|
|
69
|
+
);
|
|
70
|
+
|
|
71
|
+
return weight;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{{!
|
|
2
|
+
Copyright (c) HashiCorp, Inc.
|
|
3
|
+
SPDX-License-Identifier: MPL-2.0
|
|
4
|
+
}}
|
|
5
|
+
|
|
6
|
+
<Hds::Text
|
|
7
|
+
@group="code"
|
|
8
|
+
@size={{this.size}}
|
|
9
|
+
@weight={{this.weight}}
|
|
10
|
+
@align={{@align}}
|
|
11
|
+
@color={{@color}}
|
|
12
|
+
@tag={{@tag}}
|
|
13
|
+
...attributes
|
|
14
|
+
>{{yield}}</Hds::Text>
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) HashiCorp, Inc.
|
|
3
|
+
* SPDX-License-Identifier: MPL-2.0
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import Component from '@glimmer/component';
|
|
7
|
+
import { assert } from '@ember/debug';
|
|
8
|
+
|
|
9
|
+
// notice: only some combinations of size + font-weight are allowed (per design specs)
|
|
10
|
+
// see: https://www.figma.com/file/oQsMzMMnynfPWpMEt91OpH/HDS-Product---Foundations?node-id=1262%3A9192
|
|
11
|
+
|
|
12
|
+
export const DEFAULT_SIZE = '200';
|
|
13
|
+
export const AVAILABLE_SIZES = [300, 200, 100];
|
|
14
|
+
|
|
15
|
+
export const DEFAULT_WEIGHT = 'regular';
|
|
16
|
+
export const AVAILABLE_WEIGHTS_PER_SIZE = {
|
|
17
|
+
300: ['regular', 'bold'],
|
|
18
|
+
200: ['regular', 'bold'],
|
|
19
|
+
100: ['regular', 'bold'],
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export default class HdsTextCodeComponent extends Component {
|
|
23
|
+
/**
|
|
24
|
+
* Sets the "size" for the text
|
|
25
|
+
* Accepted values: see AVAILABLE_SIZES
|
|
26
|
+
*
|
|
27
|
+
* @type {string}
|
|
28
|
+
*
|
|
29
|
+
* @param size
|
|
30
|
+
*/
|
|
31
|
+
get size() {
|
|
32
|
+
let { size = DEFAULT_SIZE } = this.args;
|
|
33
|
+
|
|
34
|
+
// let's be a bit forgiving with the consumers
|
|
35
|
+
if (typeof size === 'string') {
|
|
36
|
+
size = parseInt(size, 10);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
assert(
|
|
40
|
+
`@size for "Hds::Text::Code" must be one of the following: ${AVAILABLE_SIZES.join(
|
|
41
|
+
', '
|
|
42
|
+
)}; received: ${size}`,
|
|
43
|
+
AVAILABLE_SIZES.includes(size)
|
|
44
|
+
);
|
|
45
|
+
|
|
46
|
+
return size;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Sets the "weight" for the text
|
|
51
|
+
* Accepted values: see AVAILABLE_WEIGHTS_PER_SIZE
|
|
52
|
+
*
|
|
53
|
+
* @type {string}
|
|
54
|
+
*
|
|
55
|
+
* @param variant
|
|
56
|
+
*/
|
|
57
|
+
get weight() {
|
|
58
|
+
let { weight = DEFAULT_WEIGHT } = this.args;
|
|
59
|
+
|
|
60
|
+
const availableWeights = AVAILABLE_WEIGHTS_PER_SIZE[this.size];
|
|
61
|
+
|
|
62
|
+
assert(
|
|
63
|
+
`@weight for "Hds::Text::Code" with @size=${
|
|
64
|
+
this.size
|
|
65
|
+
} must be one of the following: ${availableWeights.join(
|
|
66
|
+
', '
|
|
67
|
+
)}; received: ${weight}`,
|
|
68
|
+
availableWeights.includes(weight)
|
|
69
|
+
);
|
|
70
|
+
|
|
71
|
+
return weight;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{{!
|
|
2
|
+
Copyright (c) HashiCorp, Inc.
|
|
3
|
+
SPDX-License-Identifier: MPL-2.0
|
|
4
|
+
}}
|
|
5
|
+
|
|
6
|
+
<Hds::Text
|
|
7
|
+
@group="display"
|
|
8
|
+
@size={{this.size}}
|
|
9
|
+
@weight={{this.weight}}
|
|
10
|
+
@align={{@align}}
|
|
11
|
+
@color={{@color}}
|
|
12
|
+
@tag={{@tag}}
|
|
13
|
+
...attributes
|
|
14
|
+
>{{yield}}</Hds::Text>
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) HashiCorp, Inc.
|
|
3
|
+
* SPDX-License-Identifier: MPL-2.0
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import Component from '@glimmer/component';
|
|
7
|
+
import { assert } from '@ember/debug';
|
|
8
|
+
|
|
9
|
+
// notice: only some combinations of size + font-weight are allowed (per design specs)
|
|
10
|
+
// see: https://www.figma.com/file/oQsMzMMnynfPWpMEt91OpH/HDS-Product---Foundations?node-id=1262%3A9192
|
|
11
|
+
|
|
12
|
+
export const DEFAULT_SIZE = '200';
|
|
13
|
+
export const AVAILABLE_SIZES = [500, 400, 300, 200, 100];
|
|
14
|
+
|
|
15
|
+
export const DEFAULT_WEIGHTS_PER_SIZE = {
|
|
16
|
+
500: ['bold'],
|
|
17
|
+
400: ['semibold'],
|
|
18
|
+
300: ['semibold'],
|
|
19
|
+
200: ['semibold'],
|
|
20
|
+
100: ['medium'],
|
|
21
|
+
};
|
|
22
|
+
export const AVAILABLE_WEIGHTS_PER_SIZE = {
|
|
23
|
+
500: ['bold'],
|
|
24
|
+
400: ['medium', 'semibold', 'bold'],
|
|
25
|
+
300: ['medium', 'semibold', 'bold'],
|
|
26
|
+
200: ['semibold'],
|
|
27
|
+
100: ['medium'],
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export default class HdsTextDisplayComponent extends Component {
|
|
31
|
+
/**
|
|
32
|
+
* Sets the "size" for the text
|
|
33
|
+
* Accepted values: see AVAILABLE_SIZES
|
|
34
|
+
*
|
|
35
|
+
* @type {string}
|
|
36
|
+
*
|
|
37
|
+
* @param size
|
|
38
|
+
*/
|
|
39
|
+
get size() {
|
|
40
|
+
let { size = DEFAULT_SIZE } = this.args;
|
|
41
|
+
|
|
42
|
+
// let's be a bit forgiving with the consumers
|
|
43
|
+
if (typeof size === 'string') {
|
|
44
|
+
size = parseInt(size, 10);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
assert(
|
|
48
|
+
`@size for "Hds::Text::Display" must be one of the following: ${AVAILABLE_SIZES.join(
|
|
49
|
+
', '
|
|
50
|
+
)}; received: ${size}`,
|
|
51
|
+
AVAILABLE_SIZES.includes(size)
|
|
52
|
+
);
|
|
53
|
+
|
|
54
|
+
return size;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Sets the "weight" for the text
|
|
59
|
+
* Accepted values: see AVAILABLE_WEIGHTS_PER_SIZE
|
|
60
|
+
*
|
|
61
|
+
* @type {string}
|
|
62
|
+
*
|
|
63
|
+
* @param variant
|
|
64
|
+
*/
|
|
65
|
+
get weight() {
|
|
66
|
+
let { weight } = this.args;
|
|
67
|
+
|
|
68
|
+
if (weight) {
|
|
69
|
+
const availableWeights = AVAILABLE_WEIGHTS_PER_SIZE[this.size];
|
|
70
|
+
assert(
|
|
71
|
+
`@weight for "Hds::Text::Display" with @size=${
|
|
72
|
+
this.size
|
|
73
|
+
} must be one of the following: ${availableWeights.join(
|
|
74
|
+
', '
|
|
75
|
+
)}; received: ${weight}`,
|
|
76
|
+
availableWeights.includes(weight)
|
|
77
|
+
);
|
|
78
|
+
} else {
|
|
79
|
+
// use the default (first item in the array)
|
|
80
|
+
weight = DEFAULT_WEIGHTS_PER_SIZE[this.size];
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
return weight;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) HashiCorp, Inc.
|
|
3
|
+
* SPDX-License-Identifier: MPL-2.0
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import Component from '@glimmer/component';
|
|
7
|
+
import { assert } from '@ember/debug';
|
|
8
|
+
|
|
9
|
+
export const AVAILABLE_ALIGNS = ['left', 'center', 'right'];
|
|
10
|
+
|
|
11
|
+
export const AVAILABLE_COLORS = [
|
|
12
|
+
'primary',
|
|
13
|
+
'strong',
|
|
14
|
+
'faint',
|
|
15
|
+
'disabled',
|
|
16
|
+
'high-contrast',
|
|
17
|
+
'action',
|
|
18
|
+
'action-hover',
|
|
19
|
+
'action-active',
|
|
20
|
+
'highlight',
|
|
21
|
+
'highlight-on-surface',
|
|
22
|
+
'highlight-high-contrast',
|
|
23
|
+
'success',
|
|
24
|
+
'success-on-surface',
|
|
25
|
+
'success-high-contrast',
|
|
26
|
+
'warning',
|
|
27
|
+
'warning-on-surface',
|
|
28
|
+
'warning-high-contrast',
|
|
29
|
+
'critical',
|
|
30
|
+
'critical-on-surface',
|
|
31
|
+
'critical-high-contrast',
|
|
32
|
+
];
|
|
33
|
+
|
|
34
|
+
export default class HdsTextIndexComponent extends Component {
|
|
35
|
+
/**
|
|
36
|
+
* Get a tag to render based on the `@tag` argument passed or the value of `this.size` (via mapping)
|
|
37
|
+
*
|
|
38
|
+
* @method #componentTag
|
|
39
|
+
* @return {string} The html tag to use in the dynamic render of the component
|
|
40
|
+
*/
|
|
41
|
+
get componentTag() {
|
|
42
|
+
let { tag = 'span' } = this.args;
|
|
43
|
+
|
|
44
|
+
return tag;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Sets the "variant" (style) for the text
|
|
49
|
+
* Accepted values: see AVAILABLE_VARIANTS
|
|
50
|
+
*
|
|
51
|
+
* @type {string}
|
|
52
|
+
*
|
|
53
|
+
* @param variant
|
|
54
|
+
*/
|
|
55
|
+
get variant() {
|
|
56
|
+
let { group, size } = this.args;
|
|
57
|
+
|
|
58
|
+
// notice: for performance reasons we don't do any other extra check on these values
|
|
59
|
+
// we assume they've already been validated by the "parent" components
|
|
60
|
+
return `${group}-${size}`;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Sets the alignment of the text
|
|
65
|
+
* Accepted values: see AVAILABLE_ALIGNS
|
|
66
|
+
*
|
|
67
|
+
* @param align
|
|
68
|
+
* @type {string}
|
|
69
|
+
*/
|
|
70
|
+
get align() {
|
|
71
|
+
let { align } = this.args;
|
|
72
|
+
|
|
73
|
+
if (align) {
|
|
74
|
+
assert(
|
|
75
|
+
`@align for "Hds::Text" must be one of the following: ${AVAILABLE_ALIGNS.join(
|
|
76
|
+
', '
|
|
77
|
+
)}; received: ${align}`,
|
|
78
|
+
AVAILABLE_ALIGNS.includes(align)
|
|
79
|
+
);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
return align;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Sets the color of the text as pre-defined value
|
|
87
|
+
* Accepted values: see AVAILABLE_COLORS
|
|
88
|
+
*
|
|
89
|
+
* @param color
|
|
90
|
+
* @type {string}
|
|
91
|
+
*/
|
|
92
|
+
get predefinedColor() {
|
|
93
|
+
let { color } = this.args;
|
|
94
|
+
|
|
95
|
+
if (AVAILABLE_COLORS.includes(color)) {
|
|
96
|
+
return color;
|
|
97
|
+
} else {
|
|
98
|
+
return undefined;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Sets the color of the text as custom value (via inline style)
|
|
104
|
+
*
|
|
105
|
+
* @param color
|
|
106
|
+
* @type {string}
|
|
107
|
+
*/
|
|
108
|
+
get customColor() {
|
|
109
|
+
let { color } = this.args;
|
|
110
|
+
|
|
111
|
+
if (!AVAILABLE_COLORS.includes(color)) {
|
|
112
|
+
return color;
|
|
113
|
+
} else {
|
|
114
|
+
return undefined;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* Get the class names to apply to the component.
|
|
120
|
+
* @method #classNames
|
|
121
|
+
* @return {string} The "class" attribute to apply to the component.
|
|
122
|
+
*/
|
|
123
|
+
get classNames() {
|
|
124
|
+
let classes = ['hds-text'];
|
|
125
|
+
|
|
126
|
+
// add a (helper) class based on the "group + size" variant
|
|
127
|
+
classes.push(`hds-typography-${this.variant}`);
|
|
128
|
+
|
|
129
|
+
// add a (helper) class based on the @weight argument
|
|
130
|
+
if (this.args.weight) {
|
|
131
|
+
classes.push(`hds-font-weight-${this.args.weight}`);
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
// add a class based on the @align argument
|
|
135
|
+
if (this.align) {
|
|
136
|
+
classes.push(`hds-text--align-${this.align}`);
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
// add a (helper) class based on the @color argument (if pre-defined)
|
|
140
|
+
if (this.predefinedColor) {
|
|
141
|
+
classes.push(`hds-foreground-${this.predefinedColor}`);
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
return classes.join(' ');
|
|
145
|
+
}
|
|
146
|
+
}
|
|
@@ -63,9 +63,9 @@
|
|
|
63
63
|
border-radius: 5px;
|
|
64
64
|
}
|
|
65
65
|
|
|
66
|
-
//
|
|
67
|
-
a {
|
|
68
|
-
color: var(--token-color-foreground-
|
|
66
|
+
// Default styling for bare HTML links not using HDS::Link components
|
|
67
|
+
a:not([class*="hds-"]) {
|
|
68
|
+
color: var(--token-color-foreground-strong);
|
|
69
69
|
|
|
70
70
|
&:focus,
|
|
71
71
|
&:focus-visible {
|
|
@@ -75,11 +75,11 @@
|
|
|
75
75
|
}
|
|
76
76
|
|
|
77
77
|
&:hover {
|
|
78
|
-
color: var(--token-color-foreground-
|
|
78
|
+
color: var(--token-color-foreground-primary);
|
|
79
79
|
}
|
|
80
80
|
|
|
81
81
|
&:active {
|
|
82
|
-
color: var(--token-color-foreground-
|
|
82
|
+
color: var(--token-color-foreground-faint);
|
|
83
83
|
}
|
|
84
84
|
}
|
|
85
85
|
}
|
|
@@ -530,15 +530,17 @@ $hds-dropdown-toggle-border-radius: $hds-button-border-radius;
|
|
|
530
530
|
margin-top: 2px;
|
|
531
531
|
margin-right: 8px;
|
|
532
532
|
|
|
533
|
-
&[disabled] ~ .hds-dropdown-list-item__label,
|
|
534
533
|
&[disabled] ~ .hds-dropdown-list-item__icon,
|
|
535
|
-
&[disabled] ~ .hds-dropdown-list-item__count
|
|
534
|
+
&[disabled] ~ .hds-dropdown-list-item__count,
|
|
535
|
+
&[disabled] ~ .hds-dropdown-list-item__text-content {
|
|
536
536
|
color: var(--token-color-foreground-disabled);
|
|
537
537
|
}
|
|
538
538
|
}
|
|
539
539
|
|
|
540
540
|
.hds-dropdown-list-item__label {
|
|
541
|
+
display: flex;
|
|
541
542
|
flex-grow: 1;
|
|
543
|
+
align-items: flex-start;
|
|
542
544
|
color: var(--token-color-foreground-primary);
|
|
543
545
|
}
|
|
544
546
|
|
|
@@ -551,7 +553,8 @@ $hds-dropdown-toggle-border-radius: $hds-button-border-radius;
|
|
|
551
553
|
|
|
552
554
|
// COUNT
|
|
553
555
|
.hds-dropdown-list-item__count {
|
|
554
|
-
margin-left:
|
|
556
|
+
margin-left: auto;
|
|
557
|
+
padding-left: 8px;
|
|
555
558
|
color: var(--token-color-foreground-faint);
|
|
556
559
|
line-height: 20px; // replicating the resulted height of the list item
|
|
557
560
|
}
|
|
@@ -11,9 +11,13 @@ $hds-form-masked-input-button-size: 24px;
|
|
|
11
11
|
|
|
12
12
|
.hds-form-masked-input {
|
|
13
13
|
position: relative;
|
|
14
|
+
display: grid;
|
|
15
|
+
grid-template-areas: "input copy-button";
|
|
16
|
+
grid-template-columns: 1fr auto;
|
|
14
17
|
width: 100%;
|
|
15
18
|
|
|
16
19
|
.hds-form-masked-input__control {
|
|
20
|
+
grid-area: input;
|
|
17
21
|
padding-right: calc(var(--token-form-control-padding) + $hds-form-masked-input-button-size);
|
|
18
22
|
}
|
|
19
23
|
}
|
|
@@ -36,6 +40,7 @@ $hds-form-masked-input-button-size: 24px;
|
|
|
36
40
|
position: absolute;
|
|
37
41
|
top: calc(var(--token-form-control-padding) - var(--token-form-control-border-width));
|
|
38
42
|
right: calc(var(--token-form-control-padding) - var(--token-form-control-border-width));
|
|
43
|
+
grid-area: input;
|
|
39
44
|
width: $hds-form-masked-input-button-size;
|
|
40
45
|
height: $hds-form-masked-input-button-size;
|
|
41
46
|
padding: 2px;
|
|
@@ -44,3 +49,9 @@ $hds-form-masked-input-button-size: 24px;
|
|
|
44
49
|
border-color: transparent;
|
|
45
50
|
cursor: pointer;
|
|
46
51
|
}
|
|
52
|
+
|
|
53
|
+
.hds-form-masked-input__copy-button {
|
|
54
|
+
grid-area: copy-button;
|
|
55
|
+
align-self: flex-start;
|
|
56
|
+
margin-left: 8px;
|
|
57
|
+
}
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
|
|
10
10
|
$hds-icon-tile-sizes: ( "small", "medium", "large" );
|
|
11
11
|
$hds-icon-tile-types: ( "object","resource","logo" );
|
|
12
|
-
$hds-icon-tile-colors-products: ( "boundary", "consul", "hcp", "nomad", "packer", "terraform", "vagrant", "vault", "waypoint" );
|
|
12
|
+
$hds-icon-tile-colors-products: ( "boundary", "consul", "hcp", "nomad", "packer", "terraform", "vagrant", "vault", "vault-secrets", "waypoint" );
|
|
13
13
|
$hds-icon-tile-border-width: 1px;
|
|
14
14
|
$hds-icon-tile-box-shadow: 0 1px 1px rgba(#656a76, 0.05);
|
|
15
15
|
|
|
@@ -21,7 +21,7 @@ $hds-link-standalone-border-width: 1px;
|
|
|
21
21
|
align-items: center;
|
|
22
22
|
justify-content: center;
|
|
23
23
|
width: fit-content;
|
|
24
|
-
font-weight: var(--token-typography-font-weight-
|
|
24
|
+
font-weight: var(--token-typography-font-weight-regular);
|
|
25
25
|
font-family: var(--token-typography-font-stack-text);
|
|
26
26
|
background-color: transparent; // needs to exist for a11y
|
|
27
27
|
border: $hds-link-standalone-border-width solid transparent; // needs to exist AND be transparent for a11y
|
|
@@ -21,11 +21,6 @@ $hds-stepper-indicator-step-size: 24px;
|
|
|
21
21
|
width: 100%;
|
|
22
22
|
height: 100%;
|
|
23
23
|
filter: drop-shadow(0 1px 1px rgba(101, 106, 118, 5%));
|
|
24
|
-
|
|
25
|
-
path {
|
|
26
|
-
fill: --status-fill-color;
|
|
27
|
-
stroke: --status-stroke-color;
|
|
28
|
-
}
|
|
29
24
|
}
|
|
30
25
|
|
|
31
26
|
.hds-stepper-indicator-step__status {
|
|
@@ -42,13 +37,11 @@ $hds-stepper-indicator-step-size: 24px;
|
|
|
42
37
|
.hds-stepper-indicator-step__icon {
|
|
43
38
|
width: 12px;
|
|
44
39
|
height: 12px;
|
|
45
|
-
color: --status-text-color;
|
|
46
40
|
}
|
|
47
41
|
|
|
48
42
|
.hds-stepper-indicator-step__text {
|
|
49
43
|
width: 20px;
|
|
50
44
|
overflow: hidden;
|
|
51
|
-
color: --status-text-color;
|
|
52
45
|
font-weight: var(--token-typography-font-weight-medium);
|
|
53
46
|
font-size: 0.8125rem;
|
|
54
47
|
font-family: var(--token-typography-font-stack-text);
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) HashiCorp, Inc.
|
|
3
|
+
* SPDX-License-Identifier: MPL-2.0
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
//
|
|
7
|
+
// TEXT
|
|
8
|
+
//
|
|
9
|
+
|
|
10
|
+
// .hds-text {}
|
|
11
|
+
|
|
12
|
+
// ALIGNMENT
|
|
13
|
+
|
|
14
|
+
.hds-text--align-left {
|
|
15
|
+
text-align: left;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.hds-text--align-center {
|
|
19
|
+
text-align: center;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.hds-text--align-right {
|
|
23
|
+
text-align: right;
|
|
24
|
+
}
|
|
25
|
+
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hashicorp/design-system-components",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.12.0",
|
|
4
4
|
"description": "Helios Design System Components",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"hashicorp",
|
|
@@ -41,8 +41,8 @@
|
|
|
41
41
|
"dependencies": {
|
|
42
42
|
"@ember/render-modifiers": "^2.0.5",
|
|
43
43
|
"@ember/test-waiters": "^3.0.2",
|
|
44
|
-
"@hashicorp/design-system-tokens": "^1.
|
|
45
|
-
"@hashicorp/ember-flight-icons": "^3.1.
|
|
44
|
+
"@hashicorp/design-system-tokens": "^1.8.0",
|
|
45
|
+
"@hashicorp/ember-flight-icons": "^3.1.2",
|
|
46
46
|
"dialog-polyfill": "^0.5.6",
|
|
47
47
|
"ember-a11y-refocus": "^3.0.2",
|
|
48
48
|
"ember-auto-import": "^2.6.3",
|
|
@@ -54,7 +54,6 @@
|
|
|
54
54
|
"ember-composable-helpers": "^4.5.0",
|
|
55
55
|
"ember-focus-trap": "^1.0.2",
|
|
56
56
|
"ember-keyboard": "^8.2.0",
|
|
57
|
-
"ember-named-blocks-polyfill": "^0.2.5",
|
|
58
57
|
"ember-stargate": "^0.4.3",
|
|
59
58
|
"ember-style-modifier": "^3.0.1",
|
|
60
59
|
"ember-truth-helpers": "^3.1.1",
|