@hashicorp/design-system-components 0.9.1 → 0.9.2
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/NEW-COMPONENT-CHECKLIST.md +20 -11
- package/app/styles/components/breadcrumb.scss +14 -11
- package/app/styles/components/button.scss +36 -30
- package/app/styles/components/dropdown.scss +0 -1
- package/app/styles/components/link/standalone.scss +1 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @hashicorp/design-system-components
|
|
2
2
|
|
|
3
|
+
## 0.9.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#209](https://github.com/hashicorp/design-system/pull/209) [`6021d433`](https://github.com/hashicorp/design-system/commit/6021d43352b8e38b268b06cd98ca0c62adb14999) Thanks [@didoo](https://github.com/didoo)! - Re-ordered declarations of CSS states
|
|
8
|
+
|
|
3
9
|
## 0.9.1
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
|
@@ -14,25 +14,27 @@ The engineering checklist has six parts: creating the feature branch, component
|
|
|
14
14
|
|
|
15
15
|
### Component Creation
|
|
16
16
|
|
|
17
|
-
- [ ] create new branch from main for the component
|
|
17
|
+
- [ ] create new branch from main for the component (`git checkout -b USER/COMPONENT-NAME`)
|
|
18
18
|
- [ ] create new component
|
|
19
|
-
- `ember generate component hds/
|
|
20
|
-
- if
|
|
19
|
+
- `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)
|
|
20
|
+
- tip: if you forget to generate the backing class (via `--gc`), you can add it with `ember generate component-class hds/COMPONENT-NAME/index`.
|
|
21
|
+
- if it's a child component, then `hds/COMPONENT_NAME/CHILD_NAME` instead of `index`
|
|
22
|
+
- tip: if you need to destroy a component and start over again, `ember destroy component hds/COMPONENT-NAME/index` will remove the component and the related files as appropriate.
|
|
21
23
|
- [ ] **component template**
|
|
22
24
|
- use semantic HTML
|
|
23
25
|
- 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.
|
|
24
26
|
- add `...attributes` unless doing so would be detrimental (e.g., a parent element and child element in the same component that both have ...attributes)
|
|
25
27
|
- [ ] **component class**
|
|
26
28
|
- use getters (vs template conditionals or constructors, if possible)
|
|
27
|
-
-
|
|
28
|
-
-
|
|
29
|
-
-
|
|
30
|
-
-
|
|
29
|
+
- we have chosen to define the value of the `class` attribute (containing the different CSS class names) for the "root" of the element's code in the backing class, UNLESS that component only has one CSS class name.
|
|
30
|
+
- write API comments in the [JS doc](https://jsdoc.app/) format (look at existing components for examples)
|
|
31
|
+
- 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 a comment.
|
|
32
|
+
- if there is an existing Structure component that is similar to the HDS component being created, ensure that all existing functionality 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.
|
|
31
33
|
- booleans should start with a verb (is/has/etc)
|
|
32
|
-
-
|
|
33
|
-
- goal is a terse invocation
|
|
34
|
+
- assertions should match the content style of the other components, e.g., `'@text for "Hds::Button" must have a valid value'`,
|
|
35
|
+
- program with intent; think about the invocation for the developer who will use the component. The goal is a terse invocation, but we also want to consider the big picture. Try to get feedback when you can.
|
|
34
36
|
- [ ] **component style**
|
|
35
|
-
- create `component/
|
|
37
|
+
- create `component/COMPONENT-NAME.scss` in `app/styles`
|
|
36
38
|
- add `@use` to `app/styles/@hashicorp/design-system-components.scss` (see existing code for precise syntax)
|
|
37
39
|
- use design tokens wherever possible, comment where they are not
|
|
38
40
|
- sizes should be in relative units
|
|
@@ -42,12 +44,18 @@ The engineering checklist has six parts: creating the feature branch, component
|
|
|
42
44
|
- [ ] test defaults
|
|
43
45
|
- [ ] try not to repeat tests (i.e., don't have to test all sizes, all colors, etc.)
|
|
44
46
|
- [ ] test all accessibility attributes
|
|
47
|
+
- [ ] test assertions
|
|
45
48
|
- [ ] **documentation**
|
|
46
49
|
- create component page `ember generate route components/COMPONENT_NAME --dummy`
|
|
47
50
|
- add link to `templates/index.hbs` page
|
|
48
|
-
- [ ]
|
|
51
|
+
- [ ] Definition of component (from CRD) (this should be a paragraph under the component name, and before the first section)
|
|
52
|
+
- [ ] Component API
|
|
49
53
|
- [ ] Usage
|
|
54
|
+
- [ ] Design Guidelines
|
|
50
55
|
- [ ] Accessibility
|
|
56
|
+
- Conformance Rating [(internal document)](https://docs.google.com/document/d/1OjTKpQLB_wuZSVJNLbbguTzMDMYCHKhNdKQz7-Kfqic/edit#bookmark=id.v7r42vfu4pdd)
|
|
57
|
+
- Known Issues (if any)
|
|
58
|
+
- Related WCAG (pull from CRD or ask Melanie)
|
|
51
59
|
- [ ] Showcase
|
|
52
60
|
|
|
53
61
|
### Component Review
|
|
@@ -69,5 +77,6 @@ Pre-review request checks:
|
|
|
69
77
|
- Edge (once available)
|
|
70
78
|
|
|
71
79
|
When ready for review:
|
|
80
|
+
|
|
72
81
|
- [ ] add situationally appropriate reviewers
|
|
73
82
|
- [ ] added instructions for reviewers in your PR, letting them know what kind of review you need
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
// BREADCRUMB
|
|
3
3
|
//
|
|
4
4
|
// properties within each class are sorted alphabetically
|
|
5
|
+
// notice: pseudo-classes for the states *must* follow the order link > visited > hover > focus > active
|
|
5
6
|
//
|
|
6
7
|
//
|
|
7
8
|
|
|
@@ -75,9 +76,6 @@ $hds-breadcrumb-item-visual-horizontal-padding: 4px;
|
|
|
75
76
|
// 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
77
|
text-decoration-color: transparent;
|
|
77
78
|
|
|
78
|
-
// we apply the focus directly to the element, without using a pseudo-element
|
|
79
|
-
@include hds-focus-ring-basic();
|
|
80
|
-
|
|
81
79
|
&:hover,
|
|
82
80
|
&.is-hover {
|
|
83
81
|
color: var(--token-color-palette-neutral-600);
|
|
@@ -87,6 +85,9 @@ $hds-breadcrumb-item-visual-horizontal-padding: 4px;
|
|
|
87
85
|
}
|
|
88
86
|
}
|
|
89
87
|
|
|
88
|
+
// we apply the focus directly to the element, without using a pseudo-element
|
|
89
|
+
@include hds-focus-ring-basic();
|
|
90
|
+
|
|
90
91
|
&:active,
|
|
91
92
|
&.is-active {
|
|
92
93
|
color: var(--token-color-foreground-secondary);
|
|
@@ -153,25 +154,27 @@ $hds-breadcrumb-item-visual-horizontal-padding: 4px;
|
|
|
153
154
|
padding: 0;
|
|
154
155
|
width: $hds-breadcrumb-item-height;
|
|
155
156
|
|
|
156
|
-
// we apply the focus directly to the element, without using a pseudo-element
|
|
157
|
-
@include hds-focus-ring-basic();
|
|
158
|
-
|
|
159
157
|
&:hover,
|
|
160
158
|
&.is-hover {
|
|
161
159
|
border-color: var(--token-color-border-strong);
|
|
162
160
|
color: var(--token-color-foreground-faint);
|
|
163
161
|
}
|
|
162
|
+
|
|
163
|
+
// we apply the focus directly to the element, without using a pseudo-element
|
|
164
|
+
@include hds-focus-ring-basic();
|
|
165
|
+
|
|
166
|
+
&:focus,
|
|
167
|
+
&.is-focus {
|
|
168
|
+
background-color: transparent;
|
|
169
|
+
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
|
|
170
|
+
}
|
|
171
|
+
|
|
164
172
|
&:active,
|
|
165
173
|
&.is-active {
|
|
166
174
|
background-color: var(--token-color-surface-interactive-active);
|
|
167
175
|
border-color: var(--token-color-border-strong);
|
|
168
176
|
color: var(--token-color-foreground-primary);
|
|
169
177
|
}
|
|
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
178
|
}
|
|
176
179
|
|
|
177
180
|
.hds-breadcrumb__truncation-content {
|
|
@@ -2,8 +2,7 @@
|
|
|
2
2
|
// BUTTON COMPONENT
|
|
3
3
|
//
|
|
4
4
|
// properties within each class are sorted alphabetically
|
|
5
|
-
// notice: pseudo-classes for the states *must* follow the order link > visited >
|
|
6
|
-
// see https://github.com/hashicorp/design-system-components/issues/132
|
|
5
|
+
// notice: pseudo-classes for the states *must* follow the order link > visited > hover > focus > active
|
|
7
6
|
//
|
|
8
7
|
//
|
|
9
8
|
|
|
@@ -145,6 +144,14 @@ $size-props: (
|
|
|
145
144
|
box-shadow: var(--token-elevation-low-box-shadow);
|
|
146
145
|
color: var(--token-color-foreground-high-contrast);
|
|
147
146
|
|
|
147
|
+
&:hover,
|
|
148
|
+
&.is-hover {
|
|
149
|
+
background-color: var(--token-color-palette-blue-300);
|
|
150
|
+
border-color: var(--token-color-palette-blue-400);
|
|
151
|
+
color: var(--token-color-foreground-high-contrast);
|
|
152
|
+
cursor: pointer;
|
|
153
|
+
}
|
|
154
|
+
|
|
148
155
|
&:focus,
|
|
149
156
|
&.is-focus {
|
|
150
157
|
background-color: var(--token-color-palette-blue-200);
|
|
@@ -163,13 +170,7 @@ $size-props: (
|
|
|
163
170
|
top: -$shift;
|
|
164
171
|
}
|
|
165
172
|
}
|
|
166
|
-
|
|
167
|
-
&.is-hover {
|
|
168
|
-
background-color: var(--token-color-palette-blue-300);
|
|
169
|
-
border-color: var(--token-color-palette-blue-400);
|
|
170
|
-
color: var(--token-color-foreground-high-contrast);
|
|
171
|
-
cursor: pointer;
|
|
172
|
-
}
|
|
173
|
+
|
|
173
174
|
&:active,
|
|
174
175
|
&.is-active {
|
|
175
176
|
background-color: var(--token-color-palette-blue-400);
|
|
@@ -188,6 +189,14 @@ $size-props: (
|
|
|
188
189
|
box-shadow: var(--token-elevation-low-box-shadow);
|
|
189
190
|
color: var(--token-color-foreground-primary);
|
|
190
191
|
|
|
192
|
+
&:hover,
|
|
193
|
+
&.is-hover {
|
|
194
|
+
background-color: var(--token-color-surface-primary);
|
|
195
|
+
border-color: var(--token-color-border-strong);
|
|
196
|
+
color: var(--token-color-foreground-primary);
|
|
197
|
+
cursor: pointer;
|
|
198
|
+
}
|
|
199
|
+
|
|
191
200
|
&:focus,
|
|
192
201
|
&.is-focus {
|
|
193
202
|
background-color: var(--token-color-surface-faint);
|
|
@@ -197,13 +206,7 @@ $size-props: (
|
|
|
197
206
|
border-color: var(--token-color-focus-action-external);
|
|
198
207
|
}
|
|
199
208
|
}
|
|
200
|
-
|
|
201
|
-
&.is-hover {
|
|
202
|
-
background-color: var(--token-color-surface-primary);
|
|
203
|
-
border-color: var(--token-color-border-strong);
|
|
204
|
-
color: var(--token-color-foreground-primary);
|
|
205
|
-
cursor: pointer;
|
|
206
|
-
}
|
|
209
|
+
|
|
207
210
|
&:active,
|
|
208
211
|
&.is-active {
|
|
209
212
|
background-color: var(--token-color-surface-interactive-active);
|
|
@@ -221,6 +224,14 @@ $size-props: (
|
|
|
221
224
|
border-color: transparent;
|
|
222
225
|
color: var(--token-color-foreground-action);
|
|
223
226
|
|
|
227
|
+
&:hover,
|
|
228
|
+
&.is-hover {
|
|
229
|
+
background-color: var(--token-color-surface-primary);
|
|
230
|
+
border-color: var(--token-color-border-strong);
|
|
231
|
+
color: var(--token-color-foreground-action-hover);
|
|
232
|
+
cursor: pointer;
|
|
233
|
+
}
|
|
234
|
+
|
|
224
235
|
&:focus,
|
|
225
236
|
&.is-focus {
|
|
226
237
|
border-color: var(--token-color-focus-action-internal);
|
|
@@ -229,13 +240,7 @@ $size-props: (
|
|
|
229
240
|
border-color: var(--token-color-focus-action-external);
|
|
230
241
|
}
|
|
231
242
|
}
|
|
232
|
-
|
|
233
|
-
&.is-hover {
|
|
234
|
-
background-color: var(--token-color-surface-primary);
|
|
235
|
-
border-color: var(--token-color-border-strong);
|
|
236
|
-
color: var(--token-color-foreground-action-hover);
|
|
237
|
-
cursor: pointer;
|
|
238
|
-
}
|
|
243
|
+
|
|
239
244
|
&:active,
|
|
240
245
|
&.is-active {
|
|
241
246
|
background-color: var(--token-color-surface-interactive-active);
|
|
@@ -271,6 +276,14 @@ $size-props: (
|
|
|
271
276
|
box-shadow: var(--token-elevation-low-box-shadow);
|
|
272
277
|
color: var(--token-color-foreground-critical-on-surface);
|
|
273
278
|
|
|
279
|
+
&:hover,
|
|
280
|
+
&.is-hover {
|
|
281
|
+
background-color: var(--token-color-palette-red-300);
|
|
282
|
+
border-color: var(--token-color-palette-red-400);
|
|
283
|
+
color: var(--token-color-foreground-high-contrast);
|
|
284
|
+
cursor: pointer;
|
|
285
|
+
}
|
|
286
|
+
|
|
274
287
|
&:focus,
|
|
275
288
|
&.is-focus {
|
|
276
289
|
background-color: var(--token-color-surface-critical);
|
|
@@ -280,13 +293,6 @@ $size-props: (
|
|
|
280
293
|
border-color: var(--token-color-focus-critical-external);
|
|
281
294
|
}
|
|
282
295
|
}
|
|
283
|
-
&:hover,
|
|
284
|
-
&.is-hover {
|
|
285
|
-
background-color: var(--token-color-palette-red-300);
|
|
286
|
-
border-color: var(--token-color-palette-red-400);
|
|
287
|
-
color: var(--token-color-foreground-high-contrast);
|
|
288
|
-
cursor: pointer;
|
|
289
|
-
}
|
|
290
296
|
|
|
291
297
|
&:active,
|
|
292
298
|
&.is-active {
|
|
@@ -15,7 +15,6 @@
|
|
|
15
15
|
//
|
|
16
16
|
// properties within each class are sorted alphabetically
|
|
17
17
|
// notice: pseudo-classes for the states *must* follow the order link > visited > hover > focus > active
|
|
18
|
-
// see https://github.com/hashicorp/design-system-components/issues/132
|
|
19
18
|
//
|
|
20
19
|
//
|
|
21
20
|
|
|
@@ -2,8 +2,7 @@
|
|
|
2
2
|
// LINK > STANDALONE COMPONENT
|
|
3
3
|
//
|
|
4
4
|
// properties within each class are sorted alphabetically
|
|
5
|
-
// notice: pseudo-classes for the states *must* follow the order link > visited >
|
|
6
|
-
// see https://github.com/hashicorp/design-system-components/issues/132
|
|
5
|
+
// notice: pseudo-classes for the states *must* follow the order link > visited > hover > focus > active
|
|
7
6
|
//
|
|
8
7
|
//
|
|
9
8
|
|