Skip to content

Commit 1e1614a

Browse files
committed
fix(components): 💅 ‘format’ prettier
1 parent 9efb9bd commit 1e1614a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+581
-480
lines changed

‎packages/components/.prettierrc.cjs

+3-2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
module.exports = {
44
plugins: ['prettier-plugin-ember-template-tag'],
5+
trailingComma: 'es5',
56
overrides: [
67
{
78
files: '*.{js,gjs,ts,gts,mjs,mts,cjs,cts}',
@@ -11,10 +12,10 @@ module.exports = {
1112
},
1213
},
1314
{
14-
files: '*.hbs',
15+
files: '*.{hbs,scss}',
1516
options: {
1617
printWidth: 120,
1718
},
1819
},
1920
],
20-
};
21+
};

‎packages/components/CHANGELOG-FIGMA-COMPONENTS.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,10 @@ In many cases, replacing v1.0 library components with the components in the Figm
7070
- Added an `alignment` property which can be set at the root level to `left` or `center`.
7171
- The footer now supports up to three actions at once. The actions are now organized in accordance with our [Button Organization](/patterns/button-organization) pattern.
7272
- Updated several visual styles including:
73-
- Removing the divider
74-
- Reducing the title from `Display/400/Bold` to `Display/300/Bold`
75-
- Changing the icon and the title color from `Foreground/Faint` to `Foreground/Strong`
76-
- Changing the body text color from `Foreground/Faint` to `Foreground/Primary`
73+
- Removing the divider
74+
- Reducing the title from `Display/400/Bold` to `Display/300/Bold`
75+
- Changing the icon and the title color from `Foreground/Faint` to `Foreground/Strong`
76+
- Changing the body text color from `Foreground/Faint` to `Foreground/Primary`
7777

7878
_Adding support for three actions within the `ApplicationState` results in a breaking change to the previous actions. Before updating the library, we recommend annotating the text and icon name (with a comment or otherwise) in files that are in progress or still being referenced by engineering._
7979

‎packages/components/CHANGELOG-FIGMA-PATTERNS.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22

33
## December 20th, 2024
44

5-
Released HDS Patterns UI Kit v2.0.
5+
Released HDS Patterns UI Kit v2.0.

‎packages/components/CHANGELOG-FIGMA-UTILITIES.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ Released [HDS Wireframes UI Kit](https://www.figma.com/design/w0ukydeAsbv6sJirLx
1010

1111
## August 30th, 2024
1212

13-
Released [HDS A11y Helper Annotations Kit](https://www.figma.com/design/EEfM1jjqLfUv59eYLopn5x/HDS-A11Y-Helper-UI-Kit?m=auto)
13+
Released [HDS A11y Helper Annotations Kit](https://www.figma.com/design/EEfM1jjqLfUv59eYLopn5x/HDS-A11Y-Helper-UI-Kit?m=auto)

‎packages/components/CHANGELOG.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1545,7 +1545,7 @@ Alternatively, you can import the CSS by adding this configuration in `ember-cli
15451545

15461546
```js
15471547
app.import(
1548-
'node_modules/@hashicorp/design-system-components/dist/styles/@hashicorp/design-system-components.css'
1548+
"node_modules/@hashicorp/design-system-components/dist/styles/@hashicorp/design-system-components.css"
15491549
);
15501550
```
15511551

‎packages/components/CONTRIBUTING.md

+18-18
Original file line numberDiff line numberDiff line change
@@ -2,46 +2,46 @@
22

33
## Installation
44

5-
* `git clone <repository-url>`
6-
* `pnpm install`
7-
* `cd packages/components`
5+
- `git clone <repository-url>`
6+
- `pnpm install`
7+
- `cd packages/components`
88

99
## Building
1010

11-
* `pnpm build`
11+
- `pnpm build`
1212

1313
To set a watcher on files located in `src` and rebuild on change
1414

15-
* `pnpm start`
15+
- `pnpm start`
1616

1717
## Linting
1818

19-
* `pnpm lint`
20-
* `pnpm lint:fix`
19+
- `pnpm lint`
20+
- `pnpm lint:fix`
2121

2222
## Stylelinting
2323

24-
* `pnpm lint:css`
25-
* `pnpm lint:css:fix`
24+
- `pnpm lint:css`
25+
- `pnpm lint:css:fix`
2626

2727
Notice: to have VSCode autofix the code on save, you have to:
2828

29-
* install the [Stylelint extension](https://marketplace.visualstudio.com/items?itemName=stylelint.vscode-stylelint)
30-
* in either the user or workspace settings add the entry `"source.fixAll.stylelint": true` to the `editor.codeActionsOnSave` option
29+
- install the [Stylelint extension](https://marketplace.visualstudio.com/items?itemName=stylelint.vscode-stylelint)
30+
- in either the user or workspace settings add the entry `"source.fixAll.stylelint": true` to the `editor.codeActionsOnSave` option
3131

3232
## Running tests
3333

3434
The associated test application is located at the root of the monorepo, in `showcase`
3535

36-
* `cd showcase`
37-
* `ember test` – Runs the test suite on the current Ember version
38-
* `ember test --server` – Runs the test suite in "watch mode"
39-
* `ember try:each` – Runs the test suite against multiple Ember versions
36+
- `cd showcase`
37+
- `ember test` – Runs the test suite on the current Ember version
38+
- `ember test --server` – Runs the test suite in "watch mode"
39+
- `ember try:each` – Runs the test suite against multiple Ember versions
4040

4141
## Running the `showcase` application
4242

43-
* `cd showcase`
44-
* `pnpm start`
45-
* Visit the application at [http://localhost:4200](http://localhost:4200).
43+
- `cd showcase`
44+
- `pnpm start`
45+
- Visit the application at [http://localhost:4200](http://localhost:4200).
4646

4747
For more information on using ember-cli, visit [https://cli.emberjs.com/release/](https://cli.emberjs.com/release/).

‎packages/components/NEW-COMPONENT-CHECKLIST.md

+8-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@ The following should be available as resources for the Project Kickoff.
1414
A project kickoff will be scheduled before the project start date. The kickoff will be used to align on project scope, timelines, and milestones and as a space to discuss any open questions. In attendance should be Design Systems Team leadership, lead Designer and Engineer on the project, and Design/Engineer buddies (if applicable).
1515

1616
## Design Checklist
17+
1718
The design checklist has 4 primary parts:
19+
1820
1. component design
1921
2. testing
2022
3. documentation
@@ -23,6 +25,7 @@ The design checklist has 4 primary parts:
2325
The design process is largely cyclical, so some steps may be repeated until final approval.
2426

2527
### Component Design
28+
2629
- [ ] [create a branch](https://help.figma.com/hc/en-us/articles/360063144053-Create-branches-and-merge-changes#Create_a_branch) in the [product components ui kit](https://www.figma.com/file/noyY6dUMDYjmySpHcMjhkN/HDS-Product---Components)
2730
- [ ] add a new page for the component, as needed
2831
- [ ] copy & paste the [new component template](https://www.figma.com/file/noyY6dUMDYjmySpHcMjhkN/HDS-Product---Components?type=design&node-id=46856-287&mode=design&t=V4zCk5Jv07PcHYzZ-4) to the new page
@@ -59,6 +62,7 @@ The design process is largely cyclical, so some steps may be repeated until fina
5962
- let them know it's been approved and answer any remaining questions
6063

6164
### Component Testing
65+
6266
- [ ] prepare for testing
6367
- [ ] lock the components
6468
- [ ] change the badge in the banner to "Experimental"
@@ -72,24 +76,27 @@ The design process is largely cyclical, so some steps may be repeated until fina
7276
- [ ] if iterations are needed, work through the process until approved (don't forget to branch!)
7377

7478
### Documentation
79+
7580
- [ ] while the component is being tested, write the documentation
7681
- artifacts should include:
7782
- design guidelines
7883
- specifications
7984
- relevant accessibility details
8085

8186
### Release in Figma
87+
8288
Once key stakeholders have tested the component and iterations are approved, prepare for a final release of the component.
8389

8490
- [ ] add a changelog entry to [CHANGELOG-FIGMA-COMPONENTS.md](https://github.com/hashicorp/design-system/blob/main/packages/components/CHANGELOG-FIGMA-COMPONENTS.md)
8591
- [ ] if changes were made, publish the component
8692
- [ ] once the code has been released, communicate the release in the slack channel [#team-design-systems](https://hashicorp.slack.com/archives/C7KTUHNUS)
8793

88-
8994
## Engineering Checklist
95+
9096
The engineering checklist has six parts: creating the feature branch, component template, component backing class, component style, tests, and documentation.
9197

9298
### Dependency
99+
93100
- 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.
94101

95102
### Component Creation

‎packages/components/src/styles/@hashicorp/design-system-power-select-overrides.scss

+3-2
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@
2525
background-color: var(--token-form-control-base-surface-color-default);
2626
background-image: var(--token-form-select-background-image-data-url);
2727
background-repeat: no-repeat;
28-
background-position: right var(--token-form-select-background-image-position-right-x) center, top 8px left 20px;
28+
background-position:
29+
right var(--token-form-select-background-image-position-right-x) center,
30+
top 8px left 20px;
2931
background-size: var(--token-form-select-background-image-size) var(--token-form-select-background-image-size);
3032
border: var(--token-form-control-border-width) solid var(--token-form-control-base-border-color-default);
3133
border-radius: var(--token-form-control-border-radius);
@@ -268,7 +270,6 @@
268270
}
269271
}
270272

271-
272273
.hds-power-select__after-options {
273274
padding: 8px;
274275
color: var(--token-color-foreground-primary);

‎packages/components/src/styles/components/accordion.scss

+15-5
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,8 @@
8888
--hds-accordion-item-focus-ring-offset: 3px;
8989
border-bottom: 1px solid var(--token-color-border-primary);
9090

91-
&.hds-accordion-item--does-not-contain-interactive:not(.hds-accordion-item--is-static) > .hds-disclosure-primitive__toggle {
91+
&.hds-accordion-item--does-not-contain-interactive:not(.hds-accordion-item--is-static)
92+
> .hds-disclosure-primitive__toggle {
9293
&:hover,
9394
&.mock-hover {
9495
.hds-accordion-item__toggle {
@@ -112,13 +113,16 @@
112113
display: flex;
113114
gap: var(--hds-accordion-item-gap);
114115
align-items: center;
115-
padding: var(--hds-accordion-item-toggle-padding) var(--hds-accordion-item-toggle-padding) var(--hds-accordion-item-toggle-padding) var(--hds-accordion-item-toggle-padding-left);
116+
padding: var(--hds-accordion-item-toggle-padding) var(--hds-accordion-item-toggle-padding)
117+
var(--hds-accordion-item-toggle-padding) var(--hds-accordion-item-toggle-padding-left);
116118
}
117119

118120
.hds-accordion-item__button {
119121
padding: 0;
120122

121-
&:hover { cursor: pointer; }
123+
&:hover {
124+
cursor: pointer;
125+
}
122126

123127
.hds-icon {
124128
@media (prefers-reduced-motion: no-preference) {
@@ -134,7 +138,12 @@
134138

135139
// entire toggle area is interactive
136140
.hds-accordion-item__button--parent-does-not-contain-interactive {
137-
@include hds-focus-ring-with-pseudo-element($top: var(--hds-accordion-item-focus-ring-offset), $right: var(--hds-accordion-item-focus-ring-offset), $bottom: var(--hds-accordion-item-focus-ring-offset), $left: var(--hds-accordion-item-focus-ring-offset));
141+
@include hds-focus-ring-with-pseudo-element(
142+
$top: var(--hds-accordion-item-focus-ring-offset),
143+
$right: var(--hds-accordion-item-focus-ring-offset),
144+
$bottom: var(--hds-accordion-item-focus-ring-offset),
145+
$left: var(--hds-accordion-item-focus-ring-offset)
146+
);
138147

139148
position: static;
140149
display: flex;
@@ -180,7 +189,8 @@
180189

181190
.hds-accordion-item__content {
182191
.hds-accordion-item & {
183-
padding: var(--hds-accordion-item-content-padding-top) var(--hds-accordion-item-content-padding-right) var(--hds-accordion-item-content-padding-bottom) var(--hds-accordion-item-content-padding-left);
192+
padding: var(--hds-accordion-item-content-padding-top) var(--hds-accordion-item-content-padding-right)
193+
var(--hds-accordion-item-content-padding-bottom) var(--hds-accordion-item-content-padding-left);
184194
}
185195
}
186196

‎packages/components/src/styles/components/advanced-table.scss

+18-26
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@
1212

1313
$hds-advanced-table-border-radius: var(--token-border-radius-medium);
1414
$hds-advanced-table-border-width: 1px;
15-
$hds-advanced-table-inner-border-radius: calc(#{$hds-advanced-table-border-radius} - #{$hds-advanced-table-border-width});
15+
$hds-advanced-table-inner-border-radius: calc(
16+
#{$hds-advanced-table-border-radius} - #{$hds-advanced-table-border-width}
17+
);
1618
$hds-advanced-table-border-color: var(--token-color-border-primary);
1719
$hds-advanced-table-header-height: 48px;
1820
$hds-advanced-table-cell-padding-medium: 14px 16px 13px 16px; // the 1px difference is to account for the bottom border
@@ -34,8 +36,7 @@ $hds-advanced-table-cell-padding-tall: 22px 16px 21px 16px; // the 1px differenc
3436
.hds-advanced-table,
3537
.hds-advanced-table__th,
3638
.hds-advanced-table__td {
37-
border: calc(#{$hds-advanced-table-border-width} / 2) solid
38-
$hds-advanced-table-border-color;
39+
border: calc(#{$hds-advanced-table-border-width} / 2) solid $hds-advanced-table-border-color;
3940
}
4041

4142
// ----------------------------------------------------------------
@@ -60,12 +61,7 @@ $hds-advanced-table-cell-padding-tall: 22px 16px 21px 16px; // the 1px differenc
6061

6162
&:focus,
6263
&.mock-hover {
63-
@include hds-focus-ring-with-pseudo-element(
64-
$top: -1px,
65-
$right: -1px,
66-
$bottom: -1px,
67-
$left: -1px
68-
);
64+
@include hds-focus-ring-with-pseudo-element($top: -1px, $right: -1px, $bottom: -1px, $left: -1px);
6965
}
7066
}
7167

@@ -113,8 +109,7 @@ $hds-advanced-table-cell-padding-tall: 22px 16px 21px 16px; // the 1px differenc
113109

114110
&.hds-advanced-table__thead--sticky.hds-advanced-table__thead--is-pinned {
115111
// need to add 1px to offset `top: -1px`
116-
border-top: calc(#{$hds-advanced-table-border-width} / 2 + 1px) solid
117-
$hds-advanced-table-border-color;
112+
border-top: calc(#{$hds-advanced-table-border-width} / 2 + 1px) solid $hds-advanced-table-border-color;
118113
border-bottom: 3px solid $hds-advanced-table-border-color;
119114

120115
.hds-advanced-table__tr {
@@ -208,7 +203,7 @@ $hds-advanced-table-cell-padding-tall: 22px 16px 21px 16px; // the 1px differenc
208203
.hds-advanced-table__tr {
209204
display: contents;
210205
color: var(--token-color-foreground-primary);
211-
206+
212207
// striped rows
213208

214209
.hds-advanced-table--striped &:nth-child(even) {
@@ -248,12 +243,7 @@ $hds-advanced-table-cell-padding-tall: 22px 16px 21px 16px; // the 1px differenc
248243
background-color: var(--token-color-surface-primary);
249244

250245
&:focus {
251-
@include hds-focus-ring-with-pseudo-element(
252-
$top: -1px,
253-
$right: -1px,
254-
$bottom: -1px,
255-
$left: -1px
256-
);
246+
@include hds-focus-ring-with-pseudo-element($top: -1px, $right: -1px, $bottom: -1px, $left: -1px);
257247
}
258248

259249
// density
@@ -296,11 +286,11 @@ $hds-advanced-table-cell-padding-tall: 22px 16px 21px 16px; // the 1px differenc
296286
.hds-advanced-table__th,
297287
.hds-advanced-table__td {
298288
.hds-advanced-table--valign-top & {
299-
align-items: flex-start;
289+
align-items: flex-start;
300290
}
301291

302292
.hds-advanced-table--valign-middle & {
303-
align-items: center;
293+
align-items: center;
304294
}
305295

306296
.hds-advanced-table--valign-baseline & {
@@ -309,7 +299,7 @@ $hds-advanced-table-cell-padding-tall: 22px 16px 21px 16px; // the 1px differenc
309299
310300
we decided as a team to match the Table behavior instead of actually setting align-items to baseline to mitigate the difference.
311301
*/
312-
align-items: center;
302+
align-items: center;
313303
}
314304
}
315305

@@ -322,25 +312,27 @@ $hds-advanced-table-cell-padding-tall: 22px 16px 21px 16px; // the 1px differenc
322312
.hds-advanced-table__tr--parent-row {
323313
.hds-advanced-table__th:not(:first-child),
324314
.hds-advanced-table__td:not(:first-child) {
325-
border-left:0
315+
border-left: 0;
326316
}
327317

328318
.hds-advanced-table__th:not(:last-child),
329319
.hds-advanced-table__td:not(:last-child) {
330-
border-right:0
320+
border-right: 0;
331321
}
332322
}
333323
}
334324

335325
.hds-advanced-table--nested {
336326
.hds-advanced-table__tr {
337-
.hds-advanced-table__th, .hds-advanced-table__td {
338-
background-color: var(--token-color-surface-faint);
327+
.hds-advanced-table__th,
328+
.hds-advanced-table__td {
329+
background-color: var(--token-color-surface-faint);
339330
}
340331
}
341332

342333
.hds-advanced-table__tr.hds-advanced-table__tr--parent-row {
343-
.hds-advanced-table__th, .hds-advanced-table__td {
334+
.hds-advanced-table__th,
335+
.hds-advanced-table__td {
344336
background-color: var(--token-color-surface-primary);
345337
}
346338
}

‎packages/components/src/styles/components/alert.scss

+3-1
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,9 @@
145145

146146
&.hds-alert--type-inline {
147147
background-color: var(--token-color-surface-faint);
148-
border-color: var(--token-color-border-strong); // notice: in the "neutral" color the "inline" has a slightly darker border color compared to the others to increase contrast (eg. could be used on a light gray background)
148+
border-color: var(
149+
--token-color-border-strong
150+
); // notice: in the "neutral" color the "inline" has a slightly darker border color compared to the others to increase contrast (eg. could be used on a light gray background)
149151
}
150152

151153
// different color by design

0 commit comments

Comments
 (0)