@hashicorp/design-system-components 0.5.0 → 0.7.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 CHANGED
@@ -1,5 +1,28 @@
1
1
  # @hashicorp/design-system-components
2
2
 
3
+ ## 0.7.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#150](https://github.com/hashicorp/design-system/pull/150) [`c236c159`](https://github.com/hashicorp/design-system/commit/c236c159f7d7ec6edc661710963f5733eb961edf) Thanks [@didoo](https://github.com/didoo)! - removed “box-sizing“ declarations from the components (we assume the consumers codebase already have set it to “border-box“ by default
8
+
9
+ ## 0.6.0
10
+
11
+ ### Minor Changes
12
+
13
+ - [#136](https://github.com/hashicorp/design-system/pull/136) [`bce712a7`](https://github.com/hashicorp/design-system/commit/bce712a7dc13615fa179b8c16791ac6cb8c37984) Thanks [@didoo](https://github.com/didoo)! - updated font-stack definitions in design tokens, will impact the visual aspect of all the components for certains combinations of OS/browser
14
+
15
+ ### Patch Changes
16
+
17
+ - Updated dependencies [[`c17f142c`](https://github.com/hashicorp/design-system/commit/c17f142c0c938b471b696820d1fa440f62f7315b)]:
18
+ - @hashicorp/design-system-tokens@0.8.0
19
+
20
+ ## 0.5.1
21
+
22
+ ### Patch Changes
23
+
24
+ - [#133](https://github.com/hashicorp/design-system/pull/133) [`6ed18c7f`](https://github.com/hashicorp/design-system/commit/6ed18c7f9bf211141ac38005e6bd3aea2dbbf1c7) Thanks [@didoo](https://github.com/didoo)! - small change to the “noop“ guard in the “@didInsert“ method of the “Disclosure“ component
25
+
3
26
  ## 0.5.0
4
27
 
5
28
  ### Minor Changes
@@ -0,0 +1,73 @@
1
+ # New Component Checklist
2
+
3
+ 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`.
4
+
5
+ ## Pre-Flight Checklist
6
+ Update this list and these links as appropriate.
7
+
8
+ - [Component Requirement Document (CRD)](url_here): This file should exist before any code is written.
9
+ - [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.
10
+ - [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.
11
+
12
+ ## Engineering Checklist
13
+ The engineering checklist has six parts: creating the feature branch, component template, component backing class, component style, tests, and documentation.
14
+
15
+ ### Component Creation
16
+
17
+ - [ ] create new branch from main for the component.
18
+ - [ ] create new component
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
+ - if it's a variation on a component, then `hds/COMPONENT_NAME/VARIATION` instead of `index`
21
+ - [ ] **component template**
22
+ - use semantic HTML
23
+ - 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
+ - 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
+ - [ ] **component class**
26
+ - use getters (vs template conditionals or constructors, if possible)
27
+ - write API comments in the JS doc way (copy from an existing DS component)
28
+ - 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.
29
+ - 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.
30
+ - 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
31
+ - booleans should start with a verb (is/has/etc)
32
+ - assertion text should match the content style of the other components.
33
+ - goal is a terse invocation
34
+ - [ ] **component style**
35
+ - create `component/COMPONENT_NAME.scss` in `app/styles`
36
+ - add `@use` to `app/styles/@hashicorp/design-system-components.scss` (see existing code for precise syntax)
37
+ - use design tokens wherever possible, comment where they are not
38
+ - sizes should be in relative units
39
+ - line heights should be unitless
40
+ - [ ] **testing**
41
+ - [ ] test basic functionality
42
+ - [ ] test defaults
43
+ - [ ] try not to repeat tests (i.e., don't have to test all sizes, all colors, etc.)
44
+ - [ ] test all accessibility attributes
45
+ - [ ] **documentation**
46
+ - create component page `ember generate route components/COMPONENT_NAME --dummy`
47
+ - add link to `templates/index.hbs` page
48
+ - [ ] API docs
49
+ - [ ] Usage
50
+ - [ ] Accessibility
51
+ - [ ] Showcase
52
+
53
+ ### Component Review
54
+
55
+ Pre-review request checks:
56
+
57
+ - [ ] run `yarn lint` and fix any issues (`yarn lint:hbs --fix` will resolve most issues)
58
+ - [ ] make sure all tests pass (`ember s` then visit /tests; or `ember t -s`)
59
+ - [ ] check for basic a11y on docs page:
60
+ - keyboard navigation
61
+ - logical DOM order
62
+ - zoom up to 400%
63
+ - color contrast
64
+ - (the axe-core browser plugin can run some basic tests and give immediate feedback)
65
+ - [ ] check page on browsers
66
+ - Chrome
67
+ - Firefox
68
+ - Safari
69
+ - Edge (once available)
70
+
71
+ When ready for review:
72
+ - [ ] add situationally appropriate reviewers
73
+ - [ ] added instructions for reviewers in your PR, letting them know what kind of review you need
package/README.md CHANGED
@@ -47,6 +47,8 @@ Finally, add this line to the top of your app's style file (`app.scss` or simila
47
47
  @import '@hashicorp/design-system-components';
48
48
  ```
49
49
 
50
+ ⚠️ **Notice**: our component library assumes that a `*, *::before, *::after { box-sizing: border-box; }` reset is applied globally in the CSS of the application. If in your use case this is not true, please speak with the design system team (we can try to find a workaround).
51
+
50
52
  Usage
51
53
  ------------------------------------------------------------------------------
52
54
 
@@ -1,6 +1,6 @@
1
1
  import Component from '@glimmer/component';
2
2
 
3
- const noop = () => {};
3
+ const NOOP = () => {};
4
4
 
5
5
  export default class HdsBreadcrumbComponent extends Component {
6
6
  /**
@@ -9,8 +9,13 @@ export default class HdsBreadcrumbComponent extends Component {
9
9
  * @default () => {}
10
10
  */
11
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;
12
+ let { didInsert } = this.args;
13
+
14
+ if (typeof didInsert === 'function') {
15
+ return didInsert;
16
+ } else {
17
+ return NOOP;
18
+ }
14
19
  }
15
20
 
16
21
  /**
@@ -1,6 +1,6 @@
1
1
  <div class="hds-disclosure" ...attributes>
2
2
  <div class="hds-disclosure__toggle">
3
- {{yield (hash onClickToggle=this.onClickToggle) to="toggle"}}
3
+ {{yield (hash onClickToggle=this.onClickToggle isActive=this.isActive) to="toggle"}}
4
4
  </div>
5
5
  {{#if this.isActive}}
6
6
  <div
@@ -15,7 +15,6 @@ $hds-badge-count-border-width: 1px;
15
15
  .hds-badge-count {
16
16
  align-items: center;
17
17
  border: $hds-badge-count-border-width solid transparent;
18
- box-sizing: border-box;
19
18
  display: inline-flex;
20
19
  font-family: var(--token-typography-font-stack-text);
21
20
  max-width: 100%;
@@ -16,7 +16,6 @@
16
16
  align-items: center;
17
17
  border-radius: 5px;
18
18
  border: $hds-badge-border-width solid transparent;
19
- box-sizing: border-box;
20
19
  display: inline-flex;
21
20
  max-width: 100%;
22
21
  }
@@ -18,7 +18,6 @@ $hds-button-focus-border-width: 3px;
18
18
  align-items: center;
19
19
  border: $hds-button-border-width solid transparent; // We need this to be transparent for a11y
20
20
  border-radius: $hds-button-border-radius;
21
- box-sizing: border-box; // TODO https://github.com/hashicorp/design-system-components/issues/46
22
21
  display: flex;
23
22
  font-family: var(--token-typography-font-stack-text);
24
23
  isolation: isolate;
@@ -69,7 +68,6 @@ $hds-button-focus-border-width: 3px;
69
68
  border-radius: $hds-button-border-radius + $hds-button-focus-border-width;
70
69
  border: $hds-button-focus-border-width solid transparent;
71
70
  bottom: -$shift;
72
- box-sizing: border-box;
73
71
  content: '';
74
72
  left: -$shift;
75
73
  position: absolute;
@@ -17,7 +17,6 @@
17
17
  border-radius: 4px;
18
18
  border: $hds-icon-tile-border-width solid transparent;
19
19
  box-shadow: $hds-icon-tile-box-shadow;
20
- box-sizing: border-box;
21
20
  display: flex;
22
21
  position: relative;
23
22
  }
@@ -35,7 +35,6 @@
35
35
  &::before {
36
36
  border-radius: $radius;
37
37
  bottom: $bottom;
38
- box-sizing: border-box;
39
38
  content: '';
40
39
  left: $left;
41
40
  position: absolute;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hashicorp/design-system-components",
3
- "version": "0.5.0",
3
+ "version": "0.7.0",
4
4
  "description": "HashiCorp Design System Components",
5
5
  "keywords": [
6
6
  "hashicorp",
@@ -34,7 +34,7 @@
34
34
  "test:ember:percy": "percy exec ember test"
35
35
  },
36
36
  "dependencies": {
37
- "@hashicorp/design-system-tokens": "^0.7.0",
37
+ "@hashicorp/design-system-tokens": "^0.8.0",
38
38
  "@hashicorp/ember-flight-icons": "^2.0.1",
39
39
  "ember-auto-import": "^2.2.3",
40
40
  "ember-cli-babel": "^7.26.6",
@@ -50,7 +50,7 @@
50
50
  "@embroider/test-setup": "^0.43.5",
51
51
  "@glimmer/component": "^1.0.4",
52
52
  "@glimmer/tracking": "^1.0.4",
53
- "@percy/cli": "^1.0.0-beta.70",
53
+ "@percy/cli": "^1.0.1",
54
54
  "@percy/ember": "^3.0.0",
55
55
  "babel-eslint": "^10.1.0",
56
56
  "broccoli-asset-rev": "^3.0.0",