@hashicorp/design-system-components 0.3.0 → 0.4.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,26 @@
1
1
  # @hashicorp/design-system-components
2
2
 
3
+ ## 0.4.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#117](https://github.com/hashicorp/design-system/pull/117) [`e78f6df8`](https://github.com/hashicorp/design-system/commit/e78f6df8f7488f9f97e8de2a5dc3464b2a390725) Thanks [@didoo](https://github.com/didoo)! - added a stacking context for the “Button” component so that the focus z-index is isolated in the button
8
+
9
+ ## 0.3.2
10
+
11
+ ### Patch Changes
12
+
13
+ - [#112](https://github.com/hashicorp/design-system/pull/112) [`2be08081`](https://github.com/hashicorp/design-system/commit/2be08081582dd7e9c092fdb35c94c063d5ee7f4e) Thanks [@didoo](https://github.com/didoo)! - added missing helpers for “color” and “typography” in “components” package
14
+
15
+ ## 0.3.1
16
+
17
+ ### Patch Changes
18
+
19
+ - [#98](https://github.com/hashicorp/design-system/pull/98) [`411cd9b9`](https://github.com/hashicorp/design-system/commit/411cd9b949e376d38eb1dc4d4af93ae17e6c686a) Thanks [@didoo](https://github.com/didoo)! - refactored the “focus-ring” mixins to support both “action” (default) and “critical“ colors
20
+
21
+ - Updated dependencies [[`411cd9b9`](https://github.com/hashicorp/design-system/commit/411cd9b949e376d38eb1dc4d4af93ae17e6c686a)]:
22
+ - @hashicorp/design-system-tokens@0.7.0
23
+
3
24
  ## 0.3.0
4
25
 
5
26
  ### Minor Changes
@@ -1,12 +1,4 @@
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
- >
1
+ <nav class={{this.classNames}} aria-label="breadcrumbs" ...attributes>
10
2
  <ol class="hds-breadcrumb__list" {{did-insert this.didInsert}}>
11
3
  {{yield}}
12
4
  </ol>
@@ -1,7 +1,9 @@
1
1
  // these are files coming from the 'design-system-tokens' package
2
2
  @use "tokens";
3
+ @use "helpers/color";
3
4
  @use "helpers/elevation";
4
5
  @use "helpers/focus-ring";
6
+ @use "helpers/typography";
5
7
 
6
8
  @use "../components/badge";
7
9
  @use "../components/badge-count";
@@ -21,6 +21,7 @@ $hds-button-focus-border-width: 3px;
21
21
  box-sizing: border-box; // TODO https://github.com/hashicorp/design-system-components/issues/46
22
22
  display: flex;
23
23
  font-family: var(--token-typography-font-stack-text);
24
+ isolation: isolate;
24
25
  justify-content: center;
25
26
  outline-style: solid; // used to avoid double outline+focus-ring in Safari (see https://github.com/hashicorp/design-system-components/issues/161#issuecomment-1031548656)
26
27
  outline-color: transparent; // We need this to be transparent for a11y
@@ -2,14 +2,14 @@
2
2
  // - https://github.com/hashicorp/design-system-components/issues/161
3
3
  // - https://www.tpgi.com/focus-visible-and-backwards-compatibility/
4
4
 
5
- @mixin hds-focus-ring-basic() {
5
+ @mixin hds-focus-ring-basic($color: action) {
6
6
  outline-style: solid; // used to avoid double outline+focus-ring in Safari (see https://github.com/hashicorp/design-system-components/issues/161#issuecomment-1031548656)
7
7
  outline-color: transparent;
8
8
 
9
9
  // default focus for browsers that still rely on ":focus"
10
10
  &:focus,
11
11
  &.is-focus {
12
- box-shadow: var(--token-focus-ring-box-shadow);
12
+ box-shadow: var(--token-focus-ring-#{$color}-box-shadow);
13
13
  }
14
14
  // undo the previous declaration for browsers that support ":focus-visible" but wouldn't normally show default focus styles
15
15
  &:focus:not(:focus-visible) {
@@ -17,7 +17,7 @@
17
17
  }
18
18
  // set focus for browsers that support ":focus-visible"
19
19
  &:focus-visible {
20
- box-shadow: var(--token-focus-ring-box-shadow);
20
+ box-shadow: var(--token-focus-ring-#{$color}-box-shadow);
21
21
  }
22
22
  // remove the focus ring on "active + focused" state (by design)
23
23
  &:focus:active,
@@ -26,7 +26,7 @@
26
26
  }
27
27
  }
28
28
 
29
- @mixin hds-focus-ring-with-pseudo-element($top: 0, $right: 0, $bottom: 0, $left: 0, $radius: 5px) {
29
+ @mixin hds-focus-ring-with-pseudo-element($top: 0, $right: 0, $bottom: 0, $left: 0, $radius: 5px, $color: action) {
30
30
  isolation: isolate; // used to create a new stacking context (needed to have the pseudo element below text/icon but not the parent container)
31
31
  outline-style: solid; // used to avoid double outline+focus-ring in Safari (see https://github.com/hashicorp/design-system-components/issues/161#issuecomment-1031548656)
32
32
  outline-color: transparent;
@@ -48,7 +48,7 @@
48
48
  &:focus,
49
49
  &.is-focus {
50
50
  &::before {
51
- box-shadow: var(--token-focus-ring-box-shadow);
51
+ box-shadow: var(--token-focus-ring-#{$color}-box-shadow);
52
52
  }
53
53
  }
54
54
  // undo the previous declaration for browsers that support ":focus-visible" but wouldn't normally show default focus styles
@@ -60,7 +60,7 @@
60
60
  // set focus for browsers that support ":focus-visible"
61
61
  &:focus-visible {
62
62
  &::before {
63
- box-shadow: var(--token-focus-ring-box-shadow);
63
+ box-shadow: var(--token-focus-ring-#{$color}-box-shadow);
64
64
  }
65
65
  }
66
66
  // remove the focus ring on "active + focused" state (by design)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hashicorp/design-system-components",
3
- "version": "0.3.0",
3
+ "version": "0.4.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.6.0",
37
+ "@hashicorp/design-system-tokens": "^0.7.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",