@hashicorp/design-system-components 0.4.0 → 0.6.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,34 @@
1
1
  # @hashicorp/design-system-components
2
2
 
3
+ ## 0.6.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#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
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies [[`c17f142c`](https://github.com/hashicorp/design-system/commit/c17f142c0c938b471b696820d1fa440f62f7315b)]:
12
+ - @hashicorp/design-system-tokens@0.8.0
13
+
14
+ ## 0.5.1
15
+
16
+ ### Patch Changes
17
+
18
+ - [#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
19
+
20
+ ## 0.5.0
21
+
22
+ ### Minor Changes
23
+
24
+ - [#127](https://github.com/hashicorp/design-system/pull/127) [`fa13190f`](https://github.com/hashicorp/design-system/commit/fa13190f1058f172898221aa1e1913965bfa53e9) Thanks [@didoo](https://github.com/didoo)! - removed the “isDisabled“ prop from the “Button” component; added instructions for developers to manually add it themselves if needed.
25
+
26
+ ### Patch Changes
27
+
28
+ - [#125](https://github.com/hashicorp/design-system/pull/125) [`b0ff180c`](https://github.com/hashicorp/design-system/commit/b0ff180c85ff920e704d46c9b823b3fa261b1b1e) Thanks [@didoo](https://github.com/didoo)! - updated border radius of “Badge” from 4px to 5px
29
+
30
+ * [#126](https://github.com/hashicorp/design-system/pull/126) [`7b639915`](https://github.com/hashicorp/design-system/commit/7b63991586b242973bad45c6108c447453772d0a) Thanks [@didoo](https://github.com/didoo)! - updated the internal padding of the “Button” component to match design specifications
31
+
3
32
  ## 0.4.0
4
33
 
5
34
  ### 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
@@ -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,10 +1,4 @@
1
- <button
2
- class={{this.classNames}}
3
- ...attributes
4
- aria-label={{if this.isIconOnly this.text null}}
5
- type={{this.type}}
6
- disabled={{if this.isDisabled "disabled" null}}
7
- >
1
+ <button class={{this.classNames}} ...attributes aria-label={{if this.isIconOnly this.text null}} type={{this.type}}>
8
2
  {{#if this.isIconOnly}}
9
3
  <div class="hds-button__icon">
10
4
  <FlightIcon @name={{this.icon}} @size={{this.iconSize}} @stretched={{true}} />
@@ -155,16 +155,6 @@ export default class HdsButtonIndexComponent extends Component {
155
155
  return this.args.isFullWidth ?? false;
156
156
  }
157
157
 
158
- /**
159
- * @param isDisabled
160
- * @type {boolean}
161
- * @default null
162
- * @description Sets the native HTML attribute `disabled` on the button element. Default is null (doesn't render the attribute).
163
- */
164
- get isDisabled() {
165
- return this.args.isDisabled ?? null;
166
- }
167
-
168
158
  /**
169
159
  * Get the class names to apply to the component.
170
160
  * @method Button#classNames
@@ -14,7 +14,7 @@
14
14
 
15
15
  .hds-badge {
16
16
  align-items: center;
17
- border-radius: 4px;
17
+ border-radius: 5px;
18
18
  border: $hds-badge-border-width solid transparent;
19
19
  box-sizing: border-box;
20
20
  display: inline-flex;
@@ -99,23 +99,23 @@ $hds-button-focus-border-width: 3px;
99
99
  $size-props: (
100
100
  "small": (
101
101
  "font-size": 0.8125rem, // 13px;
102
- "line-height": 1,
102
+ "line-height": 0.875rem, // 14px - we need to make it even (so we set it slighly larger than the font-size; notice: in Figma is 12px but this would cut some ascendants/descendants)
103
103
  "min-height": 1.75rem, // 28px
104
- "padding": 0 1rem, // 0 16px
104
+ "padding": 0.375rem 0.6875rem, // 6px 11px - here we're taking into account the 1px border
105
105
  "icon-size": 0.75rem, // 12px
106
106
  ),
107
107
  "medium": (
108
108
  "font-size": 0.875rem, // 14px
109
109
  "line-height": 1rem,// 16px
110
110
  "min-height": 2.25rem, // 36px
111
- "padding": 0.625rem 1rem, // 10px 16px
111
+ "padding": 0.5625rem 0.9375rem, // 9px 15px - here we're taking into account the 1px border
112
112
  "icon-size": 1rem, // 16px
113
113
  ),
114
114
  "large": (
115
115
  "font-size": 1rem, //16px
116
116
  "line-height": 1.5rem, // 24px
117
117
  "min-height": 3rem, // 48px
118
- "padding": 0.75rem 1.25rem, // 12px 20px
118
+ "padding": 0.6875rem 1.1875rem, // 11px 19px - here we're taking into account the 1px border
119
119
  "icon-size": 1.5rem, // 24px
120
120
  )
121
121
  );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hashicorp/design-system-components",
3
- "version": "0.4.0",
3
+ "version": "0.6.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",