@hashicorp/design-system-components 0.1.1 → 0.3.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 +22 -0
- package/README.md +2 -2
- package/RELEASE.md +3 -32
- package/addon/components/hds/breadcrumb/index.hbs +13 -0
- package/addon/components/hds/breadcrumb/index.js +40 -0
- package/addon/components/hds/breadcrumb/item.hbs +26 -0
- package/addon/components/hds/breadcrumb/item.js +50 -0
- package/addon/components/hds/breadcrumb/truncation.hbs +23 -0
- package/addon/components/hds/button/index.js +7 -5
- package/app/components/hds/breadcrumb/index.js +1 -0
- package/app/components/hds/breadcrumb/item.js +1 -0
- package/app/components/hds/breadcrumb/truncation.js +1 -0
- package/app/styles/@hashicorp/design-system-components.scss +1 -0
- package/app/styles/components/breadcrumb.scss +189 -0
- package/app/styles/components/button.scss +54 -0
- package/app/styles/components/link/standalone.scss +1 -1
- package/package.json +8 -41
- package/.github/ISSUE_TEMPLATE/new-component-quest-issue-engineering-checklist.md +0 -78
- package/.github/pull_request_template.md. +0 -26
- package/.github/workflows/ci.yml +0 -196
- package/.husky/pre-commit +0 -4
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# @hashicorp/design-system-components
|
|
2
|
+
|
|
3
|
+
## 0.3.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#48](https://github.com/hashicorp/design-system/pull/48) [`971efb9e`](https://github.com/hashicorp/design-system/commit/971efb9e92478e4d88c24aeee835f448f35d2066) Thanks [@didoo](https://github.com/didoo)! - Added "Breadcrumb" component
|
|
8
|
+
|
|
9
|
+
## 0.2.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- [#76](https://github.com/hashicorp/design-system/pull/76) [`48a82d54`](https://github.com/hashicorp/design-system/commit/48a82d545817c280d022cf95b2f3a691dc3c46a3) Thanks [@didoo](https://github.com/didoo)! - Added the "tertiary" color variant to the "Button" component
|
|
14
|
+
|
|
15
|
+
* [#77](https://github.com/hashicorp/design-system/pull/77) [`c08711e4`](https://github.com/hashicorp/design-system/commit/c08711e4fa3fac0cd3418b8afa1a0c4c254e8fac) Thanks [@didoo](https://github.com/didoo)! - Fixed the "elevation" treatment for the "Button" component
|
|
16
|
+
|
|
17
|
+
## 0.1.2
|
|
18
|
+
|
|
19
|
+
### Patch Changes
|
|
20
|
+
|
|
21
|
+
- Updated dependencies [[`04db4d9e`](https://github.com/hashicorp/design-system/commit/04db4d9ece6aba358acfa0721a78dfe84c561b5e)]:
|
|
22
|
+
- @hashicorp/design-system-tokens@0.6.0
|
package/README.md
CHANGED
|
@@ -21,7 +21,7 @@ Installation
|
|
|
21
21
|
yarn add @hashicorp/design-system-components
|
|
22
22
|
```
|
|
23
23
|
|
|
24
|
-
|
|
24
|
+
You will need to do three things before importing the styles into your app:
|
|
25
25
|
|
|
26
26
|
1. Install `ember-cli-sass`
|
|
27
27
|
|
|
@@ -36,7 +36,7 @@ ember install ember-cli-sass
|
|
|
36
36
|
sassOptions: {
|
|
37
37
|
precision: 4,
|
|
38
38
|
includePaths: [
|
|
39
|
-
'./node_modules/@hashicorp/design-system-tokens/products/css',
|
|
39
|
+
'./node_modules/@hashicorp/design-system-tokens/dist/products/css',
|
|
40
40
|
],
|
|
41
41
|
},
|
|
42
42
|
```
|
package/RELEASE.md
CHANGED
|
@@ -1,41 +1,12 @@
|
|
|
1
|
-
# How
|
|
1
|
+
# How to release
|
|
2
2
|
|
|
3
3
|
Whenever there is an update to the components, and these changes have been approved, we need to release them as package to the npm registry.
|
|
4
4
|
|
|
5
5
|
Please see the instructions in the [CONTRIBUTING](CONTRIBUTING.md) file for more details about how to setup the project and make changes to the code for these packages.
|
|
6
6
|
|
|
7
|
-
## Bump
|
|
7
|
+
## Bump and release
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
* Make sure your local `main` branch is up to date.
|
|
12
|
-
* Create new custom branch from `main`.
|
|
13
|
-
* `cd /design-system-components`
|
|
14
|
-
* Run `yarn bump` and choose the _SemVer_ version as agreed upon on the previous PR.
|
|
15
|
-
* _The `bump` command is interactive, you can move up and down with the keyboard, choose one option, and then hit "enter": the tool will automatically update the version in the `package.json` file for you._
|
|
16
|
-
* Check the `git diff` for the project, you should see only the `package.json` file changed (with the new version).
|
|
17
|
-
* Commit, push, open a pull request, and wait for approval.
|
|
18
|
-
|
|
19
|
-
Once the PR has been approved and merged, you can finally move to the next step, the actual release.
|
|
20
|
-
|
|
21
|
-
## Release
|
|
22
|
-
|
|
23
|
-
The "release" step publishes the package on the npm registry, using the version declared in the `package.json` file, and [tags](https://www.atlassian.com/git/tutorials/inspecting-a-repository/git-tag) that specific release on git.
|
|
24
|
-
|
|
25
|
-
_**IMPORTANT**: Once released a package on the public registry, you can't revert the changes: the only solution is to deprecate the package (this will hide it from the public, but remains there). If you need to do some tests, use a **local** package registry (see below), don't test directly in production!_
|
|
26
|
-
|
|
27
|
-
* Make sure your local `main` branch is up to date.
|
|
28
|
-
* You will need a company-approved 2FA-enabled account on npm to publish (see [npm 2FA docs](https://docs.npmjs.com/configuring-two-factor-authentication) for more info).
|
|
29
|
-
* `cd /design-system-components`
|
|
30
|
-
* `yarn release`
|
|
31
|
-
* Check the git diff, you should not see any change.
|
|
32
|
-
|
|
33
|
-
**Notice**: this action will automatically:
|
|
34
|
-
|
|
35
|
-
* publish the new version of the package on the [NPM registry](https://www.npmjs.com/) using the current _SemVer_ version declared in the `package.json` file (the one previously chosen in the `bump` step).
|
|
36
|
-
* tag the current last commit in the `main` branch and push the tag to the git origin
|
|
37
|
-
|
|
38
|
-
At this point check on npm that the package ([@hashicorp/design-system-components](https://www.npmjs.com/package/@hashicorp/design-system-components) has been successfully published, and if it's so... well done! You just published your new package 🎉.
|
|
9
|
+
Follow the instructions for Changesets in the root [README](../../README.md).
|
|
39
10
|
|
|
40
11
|
🚨 **DON'T FORGET**:
|
|
41
12
|
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<nav
|
|
2
|
+
class={{this.classNames}}
|
|
3
|
+
{{!
|
|
4
|
+
TODO: should this string be localized, like in Structure? https://github.com/hashicorp/structure/blob/dffbb0e0ae5246d3b832586ab25bcb981a052b30/packages/pds-ember/addon/components/pds/breadcrumbs/index.hbs#L3
|
|
5
|
+
(in which case, we need to expose a prop? or start to have localization in the HDS system?)
|
|
6
|
+
}}
|
|
7
|
+
aria-label="breadcrumbs"
|
|
8
|
+
...attributes
|
|
9
|
+
>
|
|
10
|
+
<ol class="hds-breadcrumb__list" {{did-insert this.didInsert}}>
|
|
11
|
+
{{yield}}
|
|
12
|
+
</ol>
|
|
13
|
+
</nav>
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import Component from '@glimmer/component';
|
|
2
|
+
|
|
3
|
+
const noop = () => {};
|
|
4
|
+
|
|
5
|
+
export default class HdsBreadcrumbComponent extends Component {
|
|
6
|
+
/**
|
|
7
|
+
* @param onDidInsert
|
|
8
|
+
* @type {function}
|
|
9
|
+
* @default () => {}
|
|
10
|
+
*/
|
|
11
|
+
get didInsert() {
|
|
12
|
+
// TODO discuss with Matthew if this is the right way to create a guard for this method
|
|
13
|
+
return this.args.didInsert ?? noop;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* @param itemsCanWrap
|
|
18
|
+
* @type {boolean}
|
|
19
|
+
* @default true
|
|
20
|
+
*/
|
|
21
|
+
get itemsCanWrap() {
|
|
22
|
+
return this.args.itemsCanWrap ?? true;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Get the class names to apply to the component.
|
|
27
|
+
* @method Breadcrumb#classNames
|
|
28
|
+
* @return {string} The "class" attribute to apply to the component.
|
|
29
|
+
*/
|
|
30
|
+
get classNames() {
|
|
31
|
+
let classes = ['hds-breadcrumb'];
|
|
32
|
+
|
|
33
|
+
// add a class based on the @itemsCanWrap argument
|
|
34
|
+
if (this.itemsCanWrap) {
|
|
35
|
+
classes.push('hds-breadcrumb--items-can-wrap');
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
return classes.join(' ');
|
|
39
|
+
}
|
|
40
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
<li class="hds-breadcrumb__item" style={{this.itemStyle}} ...attributes>
|
|
2
|
+
{{#if @current}}
|
|
3
|
+
<div class="hds-breadcrumb__current">
|
|
4
|
+
{{#if @icon}}
|
|
5
|
+
<div class="hds-breadcrumb__icon">
|
|
6
|
+
<FlightIcon @name={{@icon}} @size="16" @stretched={{true}} />
|
|
7
|
+
</div>
|
|
8
|
+
{{/if}}
|
|
9
|
+
<span class="hds-breadcrumb__text">{{@text}}</span>
|
|
10
|
+
</div>
|
|
11
|
+
{{else}}
|
|
12
|
+
<LinkTo
|
|
13
|
+
class="hds-breadcrumb__link {{if @hover 'is-hover'}} {{if @active 'is-active'}} {{if @focus 'is-focus'}}"
|
|
14
|
+
@models={{hds-link-to-models @model @models}}
|
|
15
|
+
@query={{hds-link-to-query @query}}
|
|
16
|
+
@route={{@route}}
|
|
17
|
+
>
|
|
18
|
+
{{#if @icon}}
|
|
19
|
+
<div class="hds-breadcrumb__icon">
|
|
20
|
+
<FlightIcon @name={{@icon}} @size="16" @stretched={{true}} />
|
|
21
|
+
</div>
|
|
22
|
+
{{/if}}
|
|
23
|
+
<span class="hds-breadcrumb__text">{{@text}}</span>
|
|
24
|
+
</LinkTo>
|
|
25
|
+
{{/if}}
|
|
26
|
+
</li>
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import Component from '@glimmer/component';
|
|
2
|
+
import { htmlSafe } from '@ember/template';
|
|
3
|
+
import { assert } from '@ember/debug';
|
|
4
|
+
|
|
5
|
+
export default class HdsBreadcrumbItemComponent extends Component {
|
|
6
|
+
/**
|
|
7
|
+
* @param maxWidth
|
|
8
|
+
* @type {string}
|
|
9
|
+
* @default undefined
|
|
10
|
+
* @description A parameter that can be applied to an "item" to limit its max-width
|
|
11
|
+
*/
|
|
12
|
+
get maxWidth() {
|
|
13
|
+
let { maxWidth } = this.args;
|
|
14
|
+
|
|
15
|
+
if (maxWidth) {
|
|
16
|
+
assert(
|
|
17
|
+
`@maxWidth for "Hds::Breadcrumb::Item" must be a size as number in 'px' or in 'em' (eg. '200px' or '24em'), received: ${maxWidth}`,
|
|
18
|
+
maxWidth.match(/^\d+(px|em)$/)
|
|
19
|
+
);
|
|
20
|
+
|
|
21
|
+
return maxWidth;
|
|
22
|
+
} else {
|
|
23
|
+
return undefined;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Get the inline style to apply to the item.
|
|
29
|
+
* @method BreadcrumbItem#itemStyle
|
|
30
|
+
* @return {string} The "style" attribute to apply to the item.
|
|
31
|
+
*/
|
|
32
|
+
get itemStyle() {
|
|
33
|
+
if (this.maxWidth) {
|
|
34
|
+
return htmlSafe(`max-width: ${this.maxWidth}`);
|
|
35
|
+
} else {
|
|
36
|
+
return undefined;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Get the class names to apply to the component.
|
|
42
|
+
* @method BreadcrumbItem#classNames
|
|
43
|
+
* @return {string} The "class" attribute to apply to the component.
|
|
44
|
+
*/
|
|
45
|
+
get classNames() {
|
|
46
|
+
let classes = ['hds-breadcrumb__item'];
|
|
47
|
+
|
|
48
|
+
return classes.join(' ');
|
|
49
|
+
}
|
|
50
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
<li class="hds-breadcrumb__item hds-breadcrumb__item--is-truncation" ...attributes>
|
|
2
|
+
<Hds::Disclosure>
|
|
3
|
+
<:toggle as |t|>
|
|
4
|
+
<button
|
|
5
|
+
type="button"
|
|
6
|
+
class="hds-breadcrumb__truncation-toggle
|
|
7
|
+
{{if @hover 'is-hover'}}
|
|
8
|
+
{{if @active 'is-active'}}
|
|
9
|
+
{{if @focus 'is-focus'}}"
|
|
10
|
+
{{on "click" t.onClickToggle}}
|
|
11
|
+
>
|
|
12
|
+
<FlightIcon @name="more-horizontal" @size="16" @isInlineBlock={{false}} />
|
|
13
|
+
</button>
|
|
14
|
+
</:toggle>
|
|
15
|
+
<:content>
|
|
16
|
+
<div class="hds-breadcrumb__truncation-content">
|
|
17
|
+
<ol class="hds-breadcrumb__sublist">
|
|
18
|
+
{{yield}}
|
|
19
|
+
</ol>
|
|
20
|
+
</div>
|
|
21
|
+
</:content>
|
|
22
|
+
</Hds::Disclosure>
|
|
23
|
+
</li>
|
|
@@ -6,7 +6,7 @@ export const DEFAULT_COLOR = 'primary';
|
|
|
6
6
|
export const DEFAULT_TYPE = 'button';
|
|
7
7
|
export const DEFAULT_ICONPOSITION = 'leading';
|
|
8
8
|
export const SIZES = ['small', 'medium', 'large'];
|
|
9
|
-
export const COLORS = ['primary', 'secondary', 'critical'];
|
|
9
|
+
export const COLORS = ['primary', 'secondary', 'tertiary', 'critical'];
|
|
10
10
|
export const TYPES = ['button', 'submit', 'reset'];
|
|
11
11
|
export const ICONPOSITIONS = ['leading', 'trailing'];
|
|
12
12
|
|
|
@@ -72,6 +72,11 @@ export default class HdsButtonIndexComponent extends Component {
|
|
|
72
72
|
* @description The name of the icon to be used.
|
|
73
73
|
*/
|
|
74
74
|
get icon() {
|
|
75
|
+
assert(
|
|
76
|
+
`when the "Hds::Button" @color is "tertiary" an @icon is required`,
|
|
77
|
+
!(this.color === 'tertiary' && !this.args.icon)
|
|
78
|
+
);
|
|
79
|
+
|
|
75
80
|
return this.args.icon ?? null;
|
|
76
81
|
}
|
|
77
82
|
|
|
@@ -162,7 +167,7 @@ export default class HdsButtonIndexComponent extends Component {
|
|
|
162
167
|
|
|
163
168
|
/**
|
|
164
169
|
* Get the class names to apply to the component.
|
|
165
|
-
* @method
|
|
170
|
+
* @method Button#classNames
|
|
166
171
|
* @return {string} The "class" attribute to apply to the component.
|
|
167
172
|
*/
|
|
168
173
|
// "hds-button {{this.sizeClass}} {{this.colorClass}} {{this.widthClass}}"
|
|
@@ -180,9 +185,6 @@ export default class HdsButtonIndexComponent extends Component {
|
|
|
180
185
|
classes.push('hds-button--width-full');
|
|
181
186
|
}
|
|
182
187
|
|
|
183
|
-
// the button has a "low" elevation effect applied to it
|
|
184
|
-
classes.push('hds-elevation-low');
|
|
185
|
-
|
|
186
188
|
return classes.join(' ');
|
|
187
189
|
}
|
|
188
190
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from '@hashicorp/design-system-components/components/hds/breadcrumb/index';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from '@hashicorp/design-system-components/components/hds/breadcrumb/item';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from '@hashicorp/design-system-components/components/hds/breadcrumb/truncation';
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
//
|
|
2
|
+
// BREADCRUMB
|
|
3
|
+
//
|
|
4
|
+
// properties within each class are sorted alphabetically
|
|
5
|
+
//
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
@use "../mixins/focus-ring" as *;
|
|
9
|
+
|
|
10
|
+
$hds-breadcrumb-item-height: 28px;
|
|
11
|
+
$hds-breadcrumb-item-border-radius: 5px;
|
|
12
|
+
$hds-breadcrumb-item-visual-horizontal-padding: 4px;
|
|
13
|
+
|
|
14
|
+
// MAIN CONTAINER (NAV)
|
|
15
|
+
.hds-breadcrumb {
|
|
16
|
+
position: relative;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
// LIST (OL)
|
|
20
|
+
|
|
21
|
+
.hds-breadcrumb__list {
|
|
22
|
+
display: flex;
|
|
23
|
+
list-style: none;
|
|
24
|
+
margin: 0;
|
|
25
|
+
padding: 0;
|
|
26
|
+
|
|
27
|
+
.hds-breadcrumb--items-can-wrap & {
|
|
28
|
+
flex-wrap: wrap;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.hds-breadcrumb__sublist {
|
|
33
|
+
list-style: none;
|
|
34
|
+
margin: 0;
|
|
35
|
+
padding: 0;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// ITEM (LI)
|
|
39
|
+
|
|
40
|
+
.hds-breadcrumb__item {
|
|
41
|
+
align-items: center;
|
|
42
|
+
display: flex;
|
|
43
|
+
flex-direction: row;
|
|
44
|
+
min-width: 0;
|
|
45
|
+
position: relative;
|
|
46
|
+
|
|
47
|
+
.hds-breadcrumb__list > & {
|
|
48
|
+
&:not(:last-child)::after {
|
|
49
|
+
color: var(--token-color-palette-neutral-300);
|
|
50
|
+
content: "/";
|
|
51
|
+
padding: 0 8px;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.hds-breadcrumb__sublist > & + & {
|
|
56
|
+
margin-top: 4px;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.hds-breadcrumb__item--is-truncation {
|
|
61
|
+
flex: none; // needed to avoid that the "flex" parent collapses the truncation element (it happens with very long strings and no-wrapping)
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
// LINK (A)
|
|
65
|
+
|
|
66
|
+
.hds-breadcrumb__link {
|
|
67
|
+
align-items: center;
|
|
68
|
+
border-radius: $hds-breadcrumb-item-border-radius;
|
|
69
|
+
color: var(--token-color-foreground-faint);
|
|
70
|
+
display: flex;
|
|
71
|
+
flex-direction: row;
|
|
72
|
+
margin: 0 (-$hds-breadcrumb-item-visual-horizontal-padding); // we use a negative horizontal margin to counter-balance the horizonal padding (used to shift the focus from the content)
|
|
73
|
+
min-width: 0;
|
|
74
|
+
padding: 0 $hds-breadcrumb-item-visual-horizontal-padding;
|
|
75
|
+
// notice: the text decoration is applied directly to the "text" container because of a bug in Safari (see https://github.com/hashicorp/design-system-components/issues/159)
|
|
76
|
+
text-decoration-color: transparent;
|
|
77
|
+
|
|
78
|
+
// we apply the focus directly to the element, without using a pseudo-element
|
|
79
|
+
@include hds-focus-ring-basic();
|
|
80
|
+
|
|
81
|
+
&:hover,
|
|
82
|
+
&.is-hover {
|
|
83
|
+
color: var(--token-color-palette-neutral-600);
|
|
84
|
+
|
|
85
|
+
> .hds-breadcrumb__text {
|
|
86
|
+
text-decoration-color: currentColor;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
&:active,
|
|
91
|
+
&.is-active {
|
|
92
|
+
color: var(--token-color-foreground-secondary);
|
|
93
|
+
|
|
94
|
+
> .hds-breadcrumb__text {
|
|
95
|
+
text-decoration-color: currentColor;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
// CURRENT
|
|
101
|
+
|
|
102
|
+
.hds-breadcrumb__current {
|
|
103
|
+
align-items: center;
|
|
104
|
+
color: var(--token-color-foreground-strong);
|
|
105
|
+
display: flex;
|
|
106
|
+
flex-direction: row;
|
|
107
|
+
margin: 0 (-$hds-breadcrumb-item-visual-horizontal-padding); // we use a negative horizontal margin to counter-balance the horizonal padding (used to shift the focus from the content)
|
|
108
|
+
min-width: 0;
|
|
109
|
+
padding: 0 $hds-breadcrumb-item-visual-horizontal-padding;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
// SUB-ELEMENTS
|
|
113
|
+
|
|
114
|
+
.hds-breadcrumb__icon {
|
|
115
|
+
flex: none;
|
|
116
|
+
margin-right: 6px;
|
|
117
|
+
height: 13px;
|
|
118
|
+
width: 13px;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.hds-breadcrumb__text {
|
|
122
|
+
font-family: var(--token-typography-font-stack-text);
|
|
123
|
+
font-size: 0.8125rem; // 13px
|
|
124
|
+
line-height: 1rem; // 16px
|
|
125
|
+
overflow: hidden;
|
|
126
|
+
// we use the extra vertical padding to force the height of the parent item to be exactly $hds-breadcrumb-item-height
|
|
127
|
+
padding: calc((#{$hds-breadcrumb-item-height} - 1rem) / 2) 0;
|
|
128
|
+
text-decoration: underline;
|
|
129
|
+
text-decoration-color: transparent;
|
|
130
|
+
text-overflow: ellipsis;
|
|
131
|
+
white-space: nowrap;
|
|
132
|
+
|
|
133
|
+
.hds-breadcrumb__sublist & {
|
|
134
|
+
white-space: normal;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
// TRUNCATION
|
|
139
|
+
|
|
140
|
+
.hds-breadcrumb__truncation-toggle {
|
|
141
|
+
align-items: center;
|
|
142
|
+
background-color: transparent;
|
|
143
|
+
border: 1px solid transparent; // We need this to be transparent for a11y
|
|
144
|
+
border-radius: $hds-breadcrumb-item-border-radius;
|
|
145
|
+
color: var(--token-color-foreground-faint);
|
|
146
|
+
cursor: pointer;
|
|
147
|
+
display: flex;
|
|
148
|
+
flex: none;
|
|
149
|
+
height: $hds-breadcrumb-item-height;
|
|
150
|
+
justify-content: center;
|
|
151
|
+
margin: 0 (-$hds-breadcrumb-item-visual-horizontal-padding); // the horizontal negative margin applied here is for visual balance of the spacing between items
|
|
152
|
+
outline: none; // TODO check with @melanie
|
|
153
|
+
padding: 0;
|
|
154
|
+
width: $hds-breadcrumb-item-height;
|
|
155
|
+
|
|
156
|
+
// we apply the focus directly to the element, without using a pseudo-element
|
|
157
|
+
@include hds-focus-ring-basic();
|
|
158
|
+
|
|
159
|
+
&:hover,
|
|
160
|
+
&.is-hover {
|
|
161
|
+
border-color: var(--token-color-border-strong);
|
|
162
|
+
color: var(--token-color-foreground-faint);
|
|
163
|
+
}
|
|
164
|
+
&:active,
|
|
165
|
+
&.is-active {
|
|
166
|
+
background-color: var(--token-color-surface-interactive-active);
|
|
167
|
+
border-color: var(--token-color-border-strong);
|
|
168
|
+
color: var(--token-color-foreground-primary);
|
|
169
|
+
}
|
|
170
|
+
&:focus,
|
|
171
|
+
&.is-focus {
|
|
172
|
+
background-color: transparent;
|
|
173
|
+
border: none; // important: we need to completely remove the border, of the inner box-shadow of the focus ring will be drawn inside the border
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
.hds-breadcrumb__truncation-content {
|
|
178
|
+
background-color: var(--token-color-surface-primary);
|
|
179
|
+
border-radius: 6px;
|
|
180
|
+
box-shadow: var(--token-surface-high-box-shadow);
|
|
181
|
+
left: -$hds-breadcrumb-item-visual-horizontal-padding;
|
|
182
|
+
margin-top: 4px;
|
|
183
|
+
max-width: 200px; // by design
|
|
184
|
+
padding: 6px 12px;
|
|
185
|
+
position: absolute;
|
|
186
|
+
top: 100%;
|
|
187
|
+
width: max-content;
|
|
188
|
+
z-index: 300; // this is the z-index used in Structure for this kind of things, I am reusing the same value
|
|
189
|
+
}
|
|
@@ -59,6 +59,8 @@ $hds-button-focus-border-width: 3px;
|
|
|
59
59
|
|
|
60
60
|
&:focus,
|
|
61
61
|
&.is-focus {
|
|
62
|
+
box-shadow: none;
|
|
63
|
+
|
|
62
64
|
&::before {
|
|
63
65
|
// the position absolute of an element is computed from the inside of the border of the container
|
|
64
66
|
// so we have to take in account the border width of the pseudo-element container itself
|
|
@@ -141,6 +143,7 @@ $size-props: (
|
|
|
141
143
|
.hds-button--color-primary {
|
|
142
144
|
background-color: var(--token-color-palette-blue-200);
|
|
143
145
|
border-color: var(--token-color-palette-blue-300);
|
|
146
|
+
box-shadow: var(--token-elevation-low-box-shadow);
|
|
144
147
|
color: var(--token-color-foreground-high-contrast);
|
|
145
148
|
|
|
146
149
|
&:focus,
|
|
@@ -183,6 +186,7 @@ $size-props: (
|
|
|
183
186
|
.hds-button--color-secondary {
|
|
184
187
|
background-color: var(--token-color-surface-faint);
|
|
185
188
|
border-color: var(--token-color-border-strong);
|
|
189
|
+
box-shadow: var(--token-elevation-low-box-shadow);
|
|
186
190
|
color: var(--token-color-foreground-primary);
|
|
187
191
|
|
|
188
192
|
&:focus,
|
|
@@ -213,9 +217,59 @@ $size-props: (
|
|
|
213
217
|
}
|
|
214
218
|
}
|
|
215
219
|
|
|
220
|
+
.hds-button--color-tertiary {
|
|
221
|
+
background-color: transparent;
|
|
222
|
+
border-color: transparent;
|
|
223
|
+
color: var(--token-color-foreground-action);
|
|
224
|
+
|
|
225
|
+
&:focus,
|
|
226
|
+
&.is-focus {
|
|
227
|
+
border-color: var(--token-color-focus-action-internal);
|
|
228
|
+
color: var(--token-color-foreground-action);
|
|
229
|
+
&::before {
|
|
230
|
+
border-color: var(--token-color-focus-action-external);
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
&:hover,
|
|
234
|
+
&.is-hover {
|
|
235
|
+
background-color: var(--token-color-surface-primary);
|
|
236
|
+
border-color: var(--token-color-border-strong);
|
|
237
|
+
color: var(--token-color-foreground-action-hover);
|
|
238
|
+
cursor: pointer;
|
|
239
|
+
}
|
|
240
|
+
&:active,
|
|
241
|
+
&.is-active {
|
|
242
|
+
background-color: var(--token-color-surface-interactive-active);
|
|
243
|
+
border-color: var(--token-color-border-strong);
|
|
244
|
+
box-shadow: none;
|
|
245
|
+
color: var(--token-color-foreground-action-active);
|
|
246
|
+
&::before {
|
|
247
|
+
border-color: transparent;
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
&:disabled,
|
|
252
|
+
&[disabled],
|
|
253
|
+
&.is-disabled,
|
|
254
|
+
&:disabled:focus,
|
|
255
|
+
&[disabled]:focus,
|
|
256
|
+
&.is-disabled:focus,
|
|
257
|
+
&:disabled:hover,
|
|
258
|
+
&[disabled]:hover,
|
|
259
|
+
&.is-disabled:hover {
|
|
260
|
+
background-color: transparent;
|
|
261
|
+
border-color: transparent;
|
|
262
|
+
|
|
263
|
+
&::before {
|
|
264
|
+
border-color: transparent;
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
|
|
216
269
|
.hds-button--color-critical {
|
|
217
270
|
background-color: var(--token-color-surface-critical);
|
|
218
271
|
border-color: var(--token-color-foreground-critical-on-surface);
|
|
272
|
+
box-shadow: var(--token-elevation-low-box-shadow);
|
|
219
273
|
color: var(--token-color-foreground-critical-on-surface);
|
|
220
274
|
|
|
221
275
|
&:focus,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hashicorp/design-system-components",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "HashiCorp Design System Components",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"hashicorp",
|
|
@@ -8,35 +8,13 @@
|
|
|
8
8
|
"components",
|
|
9
9
|
"ember-addon"
|
|
10
10
|
],
|
|
11
|
-
"repository":
|
|
11
|
+
"repository": {
|
|
12
|
+
"type": "git",
|
|
13
|
+
"url": "https://github.com/hashicorp/design-system.git",
|
|
14
|
+
"directory": "packages/components"
|
|
15
|
+
},
|
|
12
16
|
"license": "MPL-2.0",
|
|
13
17
|
"author": "HashiCorp Design Systems <design-systems@hashicorp.com>",
|
|
14
|
-
"contributors": [
|
|
15
|
-
{
|
|
16
|
-
"name": "Melanie Sumner",
|
|
17
|
-
"email": "melanie@hashicorp.com"
|
|
18
|
-
},
|
|
19
|
-
{
|
|
20
|
-
"name": "Brian Runnells",
|
|
21
|
-
"email": "brunnells@hashicorp.com"
|
|
22
|
-
},
|
|
23
|
-
{
|
|
24
|
-
"name": "Hector Simpson",
|
|
25
|
-
"email": "hector@hashicorp.com"
|
|
26
|
-
},
|
|
27
|
-
{
|
|
28
|
-
"name": "Heather Larsen",
|
|
29
|
-
"email": "hlarsen@hashicorp.com"
|
|
30
|
-
},
|
|
31
|
-
{
|
|
32
|
-
"name": "Amy Lam",
|
|
33
|
-
"email": "alam@hashicorp.com"
|
|
34
|
-
},
|
|
35
|
-
{
|
|
36
|
-
"name": "Cristiano Rastelli",
|
|
37
|
-
"email": "cristiano.rastelli@hashicorp.com"
|
|
38
|
-
}
|
|
39
|
-
],
|
|
40
18
|
"directories": {
|
|
41
19
|
"doc": "doc",
|
|
42
20
|
"test": "tests"
|
|
@@ -53,15 +31,10 @@
|
|
|
53
31
|
"test": "npm-run-all lint test:*",
|
|
54
32
|
"test:ember": "ember test",
|
|
55
33
|
"test:ember-compatibility": "ember try:each",
|
|
56
|
-
"test:ember:percy": "percy exec ember test"
|
|
57
|
-
"bump": "./node_modules/.bin/bump package.json",
|
|
58
|
-
"release": "yarn publish --new-version $npm_package_version",
|
|
59
|
-
"postrelease:git-tag": "TAG_VERSION=\"${npm_package_name}/${npm_package_version}\" && git tag $TAG_VERSION && git push origin $TAG_VERSION",
|
|
60
|
-
"postrelease": "yarn postrelease:git-tag",
|
|
61
|
-
"prepare": "husky install"
|
|
34
|
+
"test:ember:percy": "percy exec ember test"
|
|
62
35
|
},
|
|
63
36
|
"dependencies": {
|
|
64
|
-
"@hashicorp/design-system-tokens": "^0.
|
|
37
|
+
"@hashicorp/design-system-tokens": "^0.6.0",
|
|
65
38
|
"@hashicorp/ember-flight-icons": "^2.0.1",
|
|
66
39
|
"ember-auto-import": "^2.2.3",
|
|
67
40
|
"ember-cli-babel": "^7.26.6",
|
|
@@ -111,8 +84,6 @@
|
|
|
111
84
|
"eslint-plugin-node": "^11.1.0",
|
|
112
85
|
"eslint-plugin-prettier": "^3.4.1",
|
|
113
86
|
"eslint-plugin-qunit": "^6.2.0",
|
|
114
|
-
"husky": "^7.0.4",
|
|
115
|
-
"lint-staged": "^12.1.2",
|
|
116
87
|
"loader.js": "^4.7.0",
|
|
117
88
|
"npm-run-all": "^4.1.5",
|
|
118
89
|
"prettier": "^2.3.2",
|
|
@@ -129,9 +100,5 @@
|
|
|
129
100
|
},
|
|
130
101
|
"ember-addon": {
|
|
131
102
|
"configPath": "tests/dummy/config"
|
|
132
|
-
},
|
|
133
|
-
"lint-staged": {
|
|
134
|
-
"*.js": "eslint --cache --fix",
|
|
135
|
-
"*.{js,hbs}": "prettier --write"
|
|
136
103
|
}
|
|
137
104
|
}
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: New Component Quest Issue/Engineering Checklist
|
|
3
|
-
about: 'DS Team: Engineering Checklist for New Components'
|
|
4
|
-
title: "[Quest] New Component: Component Name"
|
|
5
|
-
labels: ''
|
|
6
|
-
assignees: ''
|
|
7
|
-
|
|
8
|
-
---
|
|
9
|
-
|
|
10
|
-
This is the quest issue/engineering checklist for the COMPONENT_NAME Component. All new components will have their own feature branch, and any PR that adds an item from the checklist should target the feature branch, and not `main`.
|
|
11
|
-
|
|
12
|
-
## Pre-Flight Checklist
|
|
13
|
-
Update this list and these links as appropriate.
|
|
14
|
-
|
|
15
|
-
- [Component Doc](url_here): This file should exist before any code is written.
|
|
16
|
-
- [FIGMA Design](url_here): Since we are trying to align the component API naming with the same terms used in the Figma file, it is likely useful to have a fairly stable Figma design before we create a component; it should definitely be finalized before the component ships, however.
|
|
17
|
-
- [Design System Website](https://design-system-website.vercel.app/?path=/story/example-introduction--page) (storybook of storybooks): use for reference, to consider existing features that we might need to replicate in the component.
|
|
18
|
-
|
|
19
|
-
## Engineering Checklist
|
|
20
|
-
The engineering checklist has six parts: creating the feature branch, component template, component backing class, component style, tests, and documentation.
|
|
21
|
-
|
|
22
|
-
### Component Creation
|
|
23
|
-
|
|
24
|
-
- [ ] create new branch from main for the component.
|
|
25
|
-
- [ ] create new component
|
|
26
|
-
- `ember generate component hds/COMPONENT_NAME/index --gc` (the component won't need to be invoked with index, it's just to put all the files in the correct place)
|
|
27
|
-
- if it's a variation on a component, then `hds/COMPONENT_NAME/VARIATION` instead of `index`
|
|
28
|
-
- [ ] **component template**
|
|
29
|
-
- use semantic HTML
|
|
30
|
-
- the component should have a css class that is the same as the component (e.g. `hds/button` should have a class name of `hds-button` on the component, and additional CSS classes should start with this same class name.
|
|
31
|
-
- add `...attributes` unless doing so would be detrimental (e.g., a parent component and child component that both have ...attributes)
|
|
32
|
-
- [ ] **component class**
|
|
33
|
-
- use getters (vs template conditionals or constructors, if possible)
|
|
34
|
-
- write API comments in the JS doc way (copy from an existing DS component)
|
|
35
|
-
- use the same naming as the Figma file for the components API unless it conflicts with a pre-existing HTML attribute. If that is the case, document the difference in the comment.
|
|
36
|
-
- ensure that all existing functionality (from a Structure component) is accounted for in some way. If we are not providing existing functionality at all, it should be documented (along with the reason why). If we are providing temporary functionality, explain that it's temporary and why.
|
|
37
|
-
- check the [design system website](https://design-system-website.vercel.app/?path=/story/example-introduction--page) to see what kind of component functionality is being used across all products
|
|
38
|
-
- booleans should start with a verb (is/has/etc)
|
|
39
|
-
- assertion text should match the content style of the other components.
|
|
40
|
-
- goal is a terse invocation
|
|
41
|
-
- [ ] **component style**
|
|
42
|
-
- create `component/COMPONENT_NAME.scss` in `app/styles`
|
|
43
|
-
- add `@use` to `app/styles/@hashicorp/design-system-components.scss` (see existing code for precise syntax)
|
|
44
|
-
- use design tokens wherever possible, comment where they are not
|
|
45
|
-
- sizes should be in relative units
|
|
46
|
-
- line heights should be unitless
|
|
47
|
-
- [ ] **testing**
|
|
48
|
-
- [ ] test basic functionality
|
|
49
|
-
- [ ] test defaults
|
|
50
|
-
- [ ] try not to repeat tests (i.e., don't have to test all sizes, all colors, etc.)
|
|
51
|
-
- [ ] test all accessibility attributes
|
|
52
|
-
- [ ] **documentation**
|
|
53
|
-
- create component page `ember generate route components/COMPONENT_NAME --dummy`
|
|
54
|
-
- add link to `templates/index.hbs` page
|
|
55
|
-
- [ ] API docs
|
|
56
|
-
- [ ] Usage
|
|
57
|
-
- [ ] Showcase
|
|
58
|
-
|
|
59
|
-
### Component Review
|
|
60
|
-
|
|
61
|
-
Pre-review request checks:
|
|
62
|
-
|
|
63
|
-
- [ ] make sure all tests pass (`ember s` then visit /tests; or `ember t -s`)
|
|
64
|
-
- [ ] check for basic a11y on docs page:
|
|
65
|
-
- keyboard navigation
|
|
66
|
-
- logical DOM order
|
|
67
|
-
- zoom up to 400%
|
|
68
|
-
- color contrast
|
|
69
|
-
- (the axe-core browser plugin can run some basic tests and give immediate feedback)
|
|
70
|
-
- [ ] check page on browsers
|
|
71
|
-
- Chrome
|
|
72
|
-
- Firefox
|
|
73
|
-
- Safari
|
|
74
|
-
- Edge (once available)
|
|
75
|
-
|
|
76
|
-
When ready for review:
|
|
77
|
-
- [ ] add situationally appropriate reviewers
|
|
78
|
-
- [ ] added instructions for reviewers in your PR, letting them know what kind of review you need
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
## :pushpin: Summary
|
|
2
|
-
|
|
3
|
-
<!-- TLDR that includes the purpose of the PR e.g. "If merged, this PR..." -->
|
|
4
|
-
|
|
5
|
-
## :busts_in_silhouette: How to review this PR
|
|
6
|
-
|
|
7
|
-
<!-- Check one box -->
|
|
8
|
-
|
|
9
|
-
- [ ] Review commit-by-commit (please copy commit info to "Summary" for clarity)
|
|
10
|
-
- [ ] Review by "Files changed"
|
|
11
|
-
|
|
12
|
-
## :camera_flash: Screenshots
|
|
13
|
-
|
|
14
|
-
<!-- A picture is a thousand words -->
|
|
15
|
-
|
|
16
|
-
## :link: External links
|
|
17
|
-
|
|
18
|
-
<!-- Asana issues, RFCs, etc. -->
|
|
19
|
-
|
|
20
|
-
## :memo: Is it documented?
|
|
21
|
-
|
|
22
|
-
- [ ] Please confirm that this change is documented on the website!
|
|
23
|
-
|
|
24
|
-
***
|
|
25
|
-
|
|
26
|
-
:speech_balloon: Please consider using [conventional comments](https://conventionalcomments.org/) when reviewing this PR.
|
package/.github/workflows/ci.yml
DELETED
|
@@ -1,196 +0,0 @@
|
|
|
1
|
-
name: CI
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
push:
|
|
5
|
-
branches:
|
|
6
|
-
- main
|
|
7
|
-
pull_request:
|
|
8
|
-
|
|
9
|
-
env:
|
|
10
|
-
NODE_VERSION: '16.x'
|
|
11
|
-
|
|
12
|
-
jobs:
|
|
13
|
-
lint:
|
|
14
|
-
name: Lint
|
|
15
|
-
runs-on: ubuntu-latest
|
|
16
|
-
steps:
|
|
17
|
-
- uses: actions/checkout@v2
|
|
18
|
-
with:
|
|
19
|
-
fetch-depth: 1
|
|
20
|
-
|
|
21
|
-
- uses: actions/setup-node@v2-beta
|
|
22
|
-
with:
|
|
23
|
-
node-version: '${{ env.NODE_VERSION }}'
|
|
24
|
-
|
|
25
|
-
- name: Get package manager's global cache path
|
|
26
|
-
id: global-cache-dir-path
|
|
27
|
-
run: echo "::set-output name=dir::$(yarn cache dir)"
|
|
28
|
-
|
|
29
|
-
- name: Cache package manager's global cache and node_modules
|
|
30
|
-
id: cache-dependencies
|
|
31
|
-
uses: actions/cache@v2
|
|
32
|
-
with:
|
|
33
|
-
path: |
|
|
34
|
-
${{ steps.global-cache-dir-path.outputs.dir }}
|
|
35
|
-
node_modules
|
|
36
|
-
key: ${{ runner.os }}-${{ matrix.node-version }}-${{
|
|
37
|
-
hashFiles('**/yarn.lock'
|
|
38
|
-
) }}
|
|
39
|
-
restore-keys: |
|
|
40
|
-
${{ runner.os }}-${{ matrix.node-version }}-
|
|
41
|
-
|
|
42
|
-
- name: Install Dependencies
|
|
43
|
-
run: yarn install --frozen-lockfile
|
|
44
|
-
if: |
|
|
45
|
-
steps.cache-dependencies.outputs.cache-hit != 'true'
|
|
46
|
-
|
|
47
|
-
- name: Lint
|
|
48
|
-
run: yarn lint
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
test:
|
|
52
|
-
name: Tests
|
|
53
|
-
runs-on: ${{ matrix.os }}
|
|
54
|
-
needs: lint
|
|
55
|
-
|
|
56
|
-
strategy:
|
|
57
|
-
matrix:
|
|
58
|
-
os: [ubuntu-latest]
|
|
59
|
-
browser: [chrome]
|
|
60
|
-
|
|
61
|
-
steps:
|
|
62
|
-
- uses: actions/checkout@v2
|
|
63
|
-
with:
|
|
64
|
-
fetch-depth: 1
|
|
65
|
-
|
|
66
|
-
- uses: actions/setup-node@v2-beta
|
|
67
|
-
with:
|
|
68
|
-
node-version: '${{ env.NODE_VERSION }}'
|
|
69
|
-
|
|
70
|
-
- name: Get package manager's global cache path
|
|
71
|
-
id: global-cache-dir-path
|
|
72
|
-
run: echo "::set-output name=dir::$(yarn cache dir)"
|
|
73
|
-
|
|
74
|
-
- name: Cache package manager's global cache and node_modules
|
|
75
|
-
id: cache-dependencies
|
|
76
|
-
uses: actions/cache@v2
|
|
77
|
-
with:
|
|
78
|
-
path: |
|
|
79
|
-
${{ steps.global-cache-dir-path.outputs.dir }}
|
|
80
|
-
node_modules
|
|
81
|
-
key: ${{ runner.os }}-${{ matrix.node-version }}-${{
|
|
82
|
-
hashFiles('**/yarn.lock'
|
|
83
|
-
) }}
|
|
84
|
-
restore-keys: |
|
|
85
|
-
${{ runner.os }}-${{ matrix.node-version }}-
|
|
86
|
-
|
|
87
|
-
- name: Install Dependencies
|
|
88
|
-
run: yarn install --frozen-lockfile
|
|
89
|
-
if: |
|
|
90
|
-
steps.cache-dependencies.outputs.cache-hit != 'true'
|
|
91
|
-
|
|
92
|
-
- name: Test
|
|
93
|
-
run: yarn test:ember:percy --launch ${{ matrix.browser }}
|
|
94
|
-
env:
|
|
95
|
-
PERCY_TOKEN: ${{ secrets.PERCY_TOKEN }}
|
|
96
|
-
|
|
97
|
-
floating-dependencies:
|
|
98
|
-
name: Floating Dependencies
|
|
99
|
-
runs-on: ${{ matrix.os }}
|
|
100
|
-
needs: lint
|
|
101
|
-
|
|
102
|
-
strategy:
|
|
103
|
-
matrix:
|
|
104
|
-
os: [ubuntu-latest]
|
|
105
|
-
browser: [chrome]
|
|
106
|
-
|
|
107
|
-
steps:
|
|
108
|
-
- uses: actions/checkout@v2
|
|
109
|
-
with:
|
|
110
|
-
fetch-depth: 1
|
|
111
|
-
|
|
112
|
-
- uses: actions/setup-node@v2-beta
|
|
113
|
-
with:
|
|
114
|
-
node-version: '${{ env.NODE_VERSION }}'
|
|
115
|
-
|
|
116
|
-
- name: Get package manager's global cache path
|
|
117
|
-
id: global-cache-dir-path
|
|
118
|
-
run: echo "::set-output name=dir::$(yarn cache dir)"
|
|
119
|
-
|
|
120
|
-
- name: Cache package manager's global cache and node_modules
|
|
121
|
-
id: cache-dependencies
|
|
122
|
-
uses: actions/cache@v2
|
|
123
|
-
with:
|
|
124
|
-
path: |
|
|
125
|
-
${{ steps.global-cache-dir-path.outputs.dir }}
|
|
126
|
-
node_modules
|
|
127
|
-
key: ${{ runner.os }}-${{ matrix.node-version }}-${{
|
|
128
|
-
hashFiles('**/yarn.lock'
|
|
129
|
-
) }}
|
|
130
|
-
restore-keys: |
|
|
131
|
-
${{ runner.os }}-${{ matrix.node-version }}-
|
|
132
|
-
|
|
133
|
-
- name: Install Dependencies
|
|
134
|
-
run: yarn install --no-lockfile --non-interactive
|
|
135
|
-
|
|
136
|
-
- name: Test
|
|
137
|
-
run: yarn test:ember:percy --launch ${{ matrix.browser }}
|
|
138
|
-
env:
|
|
139
|
-
PERCY_TOKEN: ${{ secrets.PERCY_TOKEN }}
|
|
140
|
-
|
|
141
|
-
try-scenarios:
|
|
142
|
-
name: Tests - ${{ matrix.ember-try-scenario }}
|
|
143
|
-
runs-on: ubuntu-latest
|
|
144
|
-
continue-on-error: true
|
|
145
|
-
needs: test
|
|
146
|
-
|
|
147
|
-
strategy:
|
|
148
|
-
fail-fast: true
|
|
149
|
-
matrix:
|
|
150
|
-
ember-try-scenario: [
|
|
151
|
-
ember-lts-3.20,
|
|
152
|
-
ember-lts-3.24,
|
|
153
|
-
ember-release,
|
|
154
|
-
ember-beta,
|
|
155
|
-
# ember-canary,
|
|
156
|
-
ember-default-with-jquery,
|
|
157
|
-
ember-classic,
|
|
158
|
-
# embroider-safe,
|
|
159
|
-
# embroider-optimized
|
|
160
|
-
]
|
|
161
|
-
|
|
162
|
-
steps:
|
|
163
|
-
- uses: actions/checkout@v2
|
|
164
|
-
with:
|
|
165
|
-
fetch-depth: 1
|
|
166
|
-
|
|
167
|
-
- uses: actions/setup-node@v2-beta
|
|
168
|
-
with:
|
|
169
|
-
node-version: '${{ env.NODE_VERSION }}'
|
|
170
|
-
|
|
171
|
-
- name: Get package manager's global cache path
|
|
172
|
-
id: global-cache-dir-path
|
|
173
|
-
run: echo "::set-output name=dir::$(yarn cache dir)"
|
|
174
|
-
|
|
175
|
-
- name: Cache package manager's global cache and node_modules
|
|
176
|
-
id: cache-dependencies
|
|
177
|
-
uses: actions/cache@v2
|
|
178
|
-
with:
|
|
179
|
-
path: |
|
|
180
|
-
${{ steps.global-cache-dir-path.outputs.dir }}
|
|
181
|
-
node_modules
|
|
182
|
-
key: ${{ runner.os }}-${{ matrix.node-version }}-${{
|
|
183
|
-
hashFiles('**/yarn.lock'
|
|
184
|
-
) }}
|
|
185
|
-
restore-keys: |
|
|
186
|
-
${{ runner.os }}-${{ matrix.node-version }}-
|
|
187
|
-
|
|
188
|
-
- name: Install Dependencies
|
|
189
|
-
run: yarn install --frozen-lockfile
|
|
190
|
-
if: |
|
|
191
|
-
steps.cache-dependencies.outputs.cache-hit != 'true'
|
|
192
|
-
|
|
193
|
-
- name: Test
|
|
194
|
-
env:
|
|
195
|
-
EMBER_TRY_SCENARIO: ${{ matrix.ember-try-scenario }}
|
|
196
|
-
run: node_modules/.bin/ember try:one $EMBER_TRY_SCENARIO
|
package/.husky/pre-commit
DELETED