@hashicorp/design-system-components 1.0.4 → 1.2.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.
Files changed (60) hide show
  1. package/.stylelintignore +26 -0
  2. package/CHANGELOG.md +31 -0
  3. package/addon/components/hds/badge/index.hbs +1 -1
  4. package/addon/components/hds/badge/index.js +3 -3
  5. package/addon/components/hds/badge-count/index.js +3 -3
  6. package/addon/components/hds/breadcrumb/item.js +1 -1
  7. package/addon/components/hds/card/container.js +5 -5
  8. package/addon/components/hds/dropdown/toggle/button.hbs +1 -0
  9. package/addon/components/hds/form/field/index.js +1 -1
  10. package/addon/components/hds/form/radio-card/description.hbs +1 -0
  11. package/addon/components/hds/form/radio-card/group.hbs +26 -0
  12. package/addon/components/hds/form/radio-card/index.hbs +20 -0
  13. package/addon/components/hds/form/radio-card/index.js +90 -0
  14. package/addon/components/hds/form/radio-card/label.hbs +1 -0
  15. package/addon/components/hds/form/text-input/base.js +1 -1
  16. package/addon/components/hds/icon-tile/index.hbs +3 -3
  17. package/addon/components/hds/icon-tile/index.js +3 -3
  18. package/addon/components/hds/stepper/step/indicator.js +1 -1
  19. package/addon/components/hds/stepper/task/indicator.js +1 -1
  20. package/app/components/hds/form/radio-card/description.js +1 -0
  21. package/app/components/hds/form/radio-card/group.js +1 -0
  22. package/app/components/hds/form/radio-card/index.js +1 -0
  23. package/app/components/hds/form/radio-card/label.js +1 -0
  24. package/app/styles/@hashicorp/design-system-components.scss +12 -12
  25. package/app/styles/@hashicorp/design-system-power-select-overrides.scss +225 -0
  26. package/app/styles/components/alert.scss +39 -37
  27. package/app/styles/components/avatar.scss +6 -6
  28. package/app/styles/components/badge-count.scss +19 -20
  29. package/app/styles/components/badge.scss +21 -22
  30. package/app/styles/components/breadcrumb.scss +123 -123
  31. package/app/styles/components/button-set.scss +5 -5
  32. package/app/styles/components/button.scss +56 -49
  33. package/app/styles/components/card/container.scss +5 -4
  34. package/app/styles/components/card/index.scss +1 -1
  35. package/app/styles/components/dropdown.scss +76 -66
  36. package/app/styles/components/empty-state.scss +8 -5
  37. package/app/styles/components/form/checkbox.scss +11 -8
  38. package/app/styles/components/form/error.scss +3 -3
  39. package/app/styles/components/form/field.scss +5 -4
  40. package/app/styles/components/form/group.scss +3 -2
  41. package/app/styles/components/form/helper-text.scss +1 -1
  42. package/app/styles/components/form/index.scss +1 -1
  43. package/app/styles/components/form/label.scss +2 -2
  44. package/app/styles/components/form/legend.scss +1 -1
  45. package/app/styles/components/form/radio-card.scss +146 -0
  46. package/app/styles/components/form/radio.scss +11 -8
  47. package/app/styles/components/form/select.scss +14 -12
  48. package/app/styles/components/form/text-input.scss +14 -13
  49. package/app/styles/components/form/textarea.scss +7 -7
  50. package/app/styles/components/form/toggle.scss +38 -36
  51. package/app/styles/components/icon-tile.scss +35 -37
  52. package/app/styles/components/link/inline.scss +3 -3
  53. package/app/styles/components/link/standalone.scss +13 -15
  54. package/app/styles/components/stepper/index.scss +2 -2
  55. package/app/styles/components/stepper/step-indicator.scss +23 -18
  56. package/app/styles/components/stepper/task-indicator.scss +45 -45
  57. package/app/styles/components/tag.scss +15 -15
  58. package/app/styles/components/toast.scss +3 -3
  59. package/app/styles/mixins/_focus-ring.scss +8 -8
  60. package/package.json +14 -8
@@ -5,20 +5,19 @@
5
5
  //
6
6
  //
7
7
 
8
- $hds-badge-types: ( 'flat','inverted','outlined' );
9
- $hds-badge-colors-accents: ( 'highlight', 'success', 'warning', 'critical' );
10
- $hds-badge-sizes: ( 'small', 'medium', 'large' );
11
-
12
- $hds-badge-border-width: 1px;
8
+ $hds-badge-types: ( "flat","inverted","outlined" );
9
+ $hds-badge-colors-accents: ( "highlight", "success", "warning", "critical" );
10
+ $hds-badge-sizes: ( "small", "medium", "large" );
11
+ $hds-badge-border-width: 1px;
13
12
 
14
13
 
15
14
  .hds-badge {
16
- align-items: center;
17
- border-radius: 5px;
18
- border: $hds-badge-border-width solid transparent;
19
15
  display: inline-flex;
16
+ align-items: center;
20
17
  max-width: 100%;
21
18
  vertical-align: middle;
19
+ border: $hds-badge-border-width solid transparent;
20
+ border-radius: 5px;
22
21
  }
23
22
 
24
23
  .hds-badge__icon {
@@ -28,8 +27,8 @@
28
27
 
29
28
  .hds-badge__text {
30
29
  flex: 1 0 0;
31
- font-family: var(--token-typography-font-stack-text);
32
30
  font-weight: var(--token-typography-font-weight-medium);
31
+ font-family: var(--token-typography-font-stack-text);
33
32
  }
34
33
 
35
34
 
@@ -42,7 +41,7 @@ $size-props: (
42
41
  "gap": 0.25rem,
43
42
  "height": 1.25rem,
44
43
  "icon-size": 0.75rem,
45
- "line-height": 1.23077, // 16px
44
+ "line-height": 1.2308, // 16px
46
45
  "padding-vertical": 0.125rem,
47
46
  "padding-horizontal": 0.375rem,
48
47
  ),
@@ -51,7 +50,7 @@ $size-props: (
51
50
  "gap": 0.25rem,
52
51
  "height": 1.5rem,
53
52
  "icon-size": 1rem,
54
- "line-height": 1.23077, // 16px
53
+ "line-height": 1.2308, // 16px
55
54
  "padding-vertical": 0.25rem,
56
55
  "padding-horizontal": 0.5rem,
57
56
  ),
@@ -72,8 +71,8 @@ $size-props: (
72
71
  padding: calc(#{map-get($size-props, $size, "padding-vertical")} - #{$hds-badge-border-width}) calc(#{map-get($size-props, $size, "padding-horizontal")} - #{$hds-badge-border-width});
73
72
 
74
73
  .hds-badge__icon {
75
- height: map-get($size-props, $size, "icon-size");
76
74
  width: map-get($size-props, $size, "icon-size");
75
+ height: map-get($size-props, $size, "icon-size");
77
76
  }
78
77
 
79
78
  .hds-badge__text {
@@ -92,56 +91,56 @@ $size-props: (
92
91
 
93
92
  .hds-badge--color-neutral {
94
93
  &.hds-badge--type-filled {
95
- background-color: var(--token-color-surface-strong);
96
94
  color: var(--token-color-foreground-primary);
95
+ background-color: var(--token-color-surface-strong);
97
96
  }
98
97
 
99
98
  &.hds-badge--type-inverted {
100
- background-color: var(--token-color-foreground-faint);
101
99
  color: var(--token-color-foreground-high-contrast);
100
+ background-color: var(--token-color-foreground-faint);
102
101
  }
103
102
 
104
103
  &.hds-badge--type-outlined {
104
+ color: var(--token-color-foreground-primary);
105
105
  background-color: transparent;
106
106
  border-color: var(--token-color-foreground-faint);
107
- color: var(--token-color-foreground-primary);
108
107
  }
109
108
  }
110
109
 
111
110
  .hds-badge--color-neutral-dark-mode {
112
111
  &.hds-badge--type-filled {
113
- background-color: var(--token-color-foreground-faint);
114
112
  color: var(--token-color-foreground-high-contrast);
113
+ background-color: var(--token-color-foreground-faint);
115
114
  }
116
115
 
117
116
  &.hds-badge--type-inverted {
118
- background-color: var(--token-color-surface-faint);
119
117
  color: var(--token-color-foreground-primary);
118
+ background-color: var(--token-color-surface-faint);
120
119
  }
121
120
 
122
121
  &.hds-badge--type-outlined {
122
+ color: var(--token-color-foreground-high-contrast);
123
123
  background-color: transparent;
124
124
  border-color: var(--token-color-palette-neutral-100);
125
- color: var(--token-color-foreground-high-contrast);
126
125
  }
127
126
  }
128
127
 
129
128
  @each $color in $hds-badge-colors-accents {
130
129
  .hds-badge--color-#{$color} {
131
130
  &.hds-badge--type-filled {
132
- background-color: var(--token-color-surface-#{$color});
133
131
  color: var(--token-color-foreground-#{$color}-on-surface);
132
+ background-color: var(--token-color-surface-#{$color});
134
133
  }
135
134
 
136
135
  &.hds-badge--type-inverted {
137
- background-color: var(--token-color-foreground-#{$color});
138
136
  color: var(--token-color-foreground-high-contrast);
137
+ background-color: var(--token-color-foreground-#{$color});
139
138
  }
140
139
 
141
140
  &.hds-badge--type-outlined {
141
+ color: var(--token-color-foreground-#{$color});
142
142
  background-color: transparent;
143
143
  border-color: currentColor;
144
- color: var(--token-color-foreground-#{$color});
145
144
  }
146
145
  }
147
- }
146
+ }
@@ -14,179 +14,179 @@ $hds-breadcrumb-item-visual-horizontal-padding: 4px;
14
14
 
15
15
  // MAIN CONTAINER (NAV)
16
16
  .hds-breadcrumb {
17
- position: relative;
17
+ position: relative;
18
18
  }
19
19
 
20
20
  // LIST (OL)
21
21
 
22
22
  .hds-breadcrumb__list {
23
- display: flex;
24
- list-style: none;
25
- margin: 0;
26
- padding: 0;
27
-
28
- .hds-breadcrumb--items-can-wrap & {
29
- flex-wrap: wrap;
30
- }
23
+ display: flex;
24
+ margin: 0;
25
+ padding: 0;
26
+ list-style: none;
27
+
28
+ .hds-breadcrumb--items-can-wrap & {
29
+ flex-wrap: wrap;
30
+ }
31
31
  }
32
32
 
33
33
  .hds-breadcrumb__sublist {
34
- list-style: none;
35
- margin: 0;
36
- padding: 0;
34
+ margin: 0;
35
+ padding: 0;
36
+ list-style: none;
37
37
  }
38
38
 
39
39
  // ITEM (LI)
40
40
 
41
41
  .hds-breadcrumb__item {
42
- align-items: center;
43
- display: flex;
44
- flex-direction: row;
45
- min-width: 0;
46
- position: relative;
47
-
48
- .hds-breadcrumb__list > & {
49
- &:not(:last-child)::after {
50
- color: var(--token-color-palette-neutral-300);
51
- content: "/";
52
- padding: 0 8px;
53
- }
42
+ position: relative;
43
+ display: flex;
44
+ flex-direction: row;
45
+ align-items: center;
46
+ min-width: 0;
47
+
48
+ .hds-breadcrumb__list > & {
49
+ &:not(:last-child)::after {
50
+ padding: 0 8px;
51
+ color: var(--token-color-palette-neutral-300);
52
+ content: "/";
54
53
  }
54
+ }
55
55
 
56
- .hds-breadcrumb__sublist > & + & {
57
- margin-top: 4px;
58
- }
56
+ .hds-breadcrumb__sublist > & + & {
57
+ margin-top: 4px;
58
+ }
59
59
  }
60
60
 
61
61
  .hds-breadcrumb__item--is-truncation {
62
- flex: none; // needed to avoid that the "flex" parent collapses the truncation element (it happens with very long strings and no-wrapping)
62
+ flex: none; // needed to avoid that the "flex" parent collapses the truncation element (it happens with very long strings and no-wrapping)
63
63
  }
64
64
 
65
65
  // LINK (A)
66
66
 
67
67
  .hds-breadcrumb__link {
68
- align-items: center;
69
- border-radius: $hds-breadcrumb-item-border-radius;
70
- color: var(--token-color-foreground-faint);
71
- display: flex;
72
- flex-direction: row;
73
- margin: 0 (-$hds-breadcrumb-item-visual-horizontal-padding); // we use a negative horizontal margin to counter-balance the horizonal padding (used to shift the focus from the content)
74
- min-width: 0;
75
- padding: 0 $hds-breadcrumb-item-visual-horizontal-padding;
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)
77
- text-decoration-color: transparent;
78
-
79
- &:hover,
80
- &.mock-hover {
81
- color: var(--token-color-palette-neutral-600);
82
-
83
- > .hds-breadcrumb__text {
84
- text-decoration-color: currentColor;
85
- }
68
+ display: flex;
69
+ flex-direction: row;
70
+ align-items: center;
71
+ min-width: 0;
72
+ margin: 0 (-$hds-breadcrumb-item-visual-horizontal-padding); // we use a negative horizontal margin to counter-balance the horizonal padding (used to shift the focus from the content)
73
+ padding: 0 $hds-breadcrumb-item-visual-horizontal-padding;
74
+ color: var(--token-color-foreground-faint);
75
+ border-radius: $hds-breadcrumb-item-border-radius;
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)
77
+ text-decoration-color: transparent;
78
+
79
+ &:hover,
80
+ &.mock-hover {
81
+ color: var(--token-color-palette-neutral-600);
82
+
83
+ > .hds-breadcrumb__text {
84
+ text-decoration-color: currentColor;
86
85
  }
86
+ }
87
87
 
88
- // we apply the focus directly to the element, without using a pseudo-element
89
- @include hds-focus-ring-basic();
88
+ // we apply the focus directly to the element, without using a pseudo-element
89
+ @include hds-focus-ring-basic();
90
90
 
91
- &:active,
92
- &.mock-active {
93
- color: var(--token-color-foreground-secondary);
91
+ &:active,
92
+ &.mock-active {
93
+ color: var(--token-color-foreground-secondary);
94
94
 
95
- > .hds-breadcrumb__text {
96
- text-decoration-color: currentColor;
97
- }
95
+ > .hds-breadcrumb__text {
96
+ text-decoration-color: currentColor;
98
97
  }
98
+ }
99
99
  }
100
100
 
101
101
  // CURRENT
102
102
 
103
103
  .hds-breadcrumb__current {
104
- align-items: center;
105
- color: var(--token-color-foreground-strong);
106
- display: flex;
107
- flex-direction: row;
108
- margin: 0 (-$hds-breadcrumb-item-visual-horizontal-padding); // we use a negative horizontal margin to counter-balance the horizonal padding (used to shift the focus from the content)
109
- min-width: 0;
110
- padding: 0 $hds-breadcrumb-item-visual-horizontal-padding;
104
+ display: flex;
105
+ flex-direction: row;
106
+ align-items: center;
107
+ min-width: 0;
108
+ margin: 0 (-$hds-breadcrumb-item-visual-horizontal-padding); // we use a negative horizontal margin to counter-balance the horizonal padding (used to shift the focus from the content)
109
+ padding: 0 $hds-breadcrumb-item-visual-horizontal-padding;
110
+ color: var(--token-color-foreground-strong);
111
111
  }
112
112
 
113
113
  // SUB-ELEMENTS
114
114
 
115
115
  .hds-breadcrumb__icon {
116
- flex: none;
117
- margin-right: 6px;
118
- height: 13px;
119
- width: 13px;
116
+ flex: none;
117
+ width: 13px;
118
+ height: 13px;
119
+ margin-right: 6px;
120
120
  }
121
121
 
122
122
  .hds-breadcrumb__text {
123
- font-family: var(--token-typography-font-stack-text);
124
- font-size: 0.8125rem; // 13px
125
- line-height: 1rem; // 16px
126
- overflow: hidden;
127
- // we use the extra vertical padding to force the height of the parent item to be exactly $hds-breadcrumb-item-height
128
- padding: calc((#{$hds-breadcrumb-item-height} - 1rem) / 2) 0;
129
- text-decoration: underline;
130
- text-decoration-color: transparent;
131
- text-overflow: ellipsis;
132
- white-space: nowrap;
133
-
134
- .hds-breadcrumb__sublist & {
135
- white-space: normal;
136
- }
123
+ // we use the extra vertical padding to force the height of the parent item to be exactly $hds-breadcrumb-item-height
124
+ padding: calc((#{$hds-breadcrumb-item-height} - 1rem) / 2) 0;
125
+ overflow: hidden;
126
+ font-size: 0.8125rem; // 13px
127
+ font-family: var(--token-typography-font-stack-text);
128
+ line-height: 1rem; // 16px
129
+ white-space: nowrap;
130
+ text-decoration: underline;
131
+ text-overflow: ellipsis;
132
+ text-decoration-color: transparent;
133
+
134
+ .hds-breadcrumb__sublist & {
135
+ white-space: normal;
136
+ }
137
137
  }
138
138
 
139
139
  // TRUNCATION
140
140
 
141
141
  .hds-breadcrumb__truncation-toggle {
142
- align-items: center;
143
- background-color: transparent;
144
- border: 1px solid transparent; // We need this to be transparent for a11y
145
- border-radius: $hds-breadcrumb-item-border-radius;
142
+ display: flex;
143
+ flex: none;
144
+ align-items: center;
145
+ justify-content: center;
146
+ width: $hds-breadcrumb-item-height;
147
+ height: $hds-breadcrumb-item-height;
148
+ margin: 0 (-$hds-breadcrumb-item-visual-horizontal-padding); // the horizontal negative margin applied here is for visual balance of the spacing between items
149
+ padding: 0;
150
+ color: var(--token-color-foreground-faint);
151
+ background-color: transparent;
152
+ border: 1px solid transparent; // We need this to be transparent for a11y
153
+ border-radius: $hds-breadcrumb-item-border-radius;
154
+ outline: none; // TODO check with @melanie
155
+ cursor: pointer;
156
+
157
+ &:hover,
158
+ &.mock-hover {
146
159
  color: var(--token-color-foreground-faint);
147
- cursor: pointer;
148
- display: flex;
149
- flex: none;
150
- height: $hds-breadcrumb-item-height;
151
- justify-content: center;
152
- margin: 0 (-$hds-breadcrumb-item-visual-horizontal-padding); // the horizontal negative margin applied here is for visual balance of the spacing between items
153
- outline: none; // TODO check with @melanie
154
- padding: 0;
155
- width: $hds-breadcrumb-item-height;
156
-
157
- &:hover,
158
- &.mock-hover {
159
- border-color: var(--token-color-border-strong);
160
- color: var(--token-color-foreground-faint);
161
- }
162
-
163
- // we apply the focus directly to the element, without using a pseudo-element
164
- @include hds-focus-ring-basic();
160
+ border-color: var(--token-color-border-strong);
161
+ }
165
162
 
166
- &:focus,
167
- &.mock-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
- }
163
+ // we apply the focus directly to the element, without using a pseudo-element
164
+ @include hds-focus-ring-basic();
171
165
 
172
- &:active,
173
- &.mock-active {
174
- background-color: var(--token-color-surface-interactive-active);
175
- border-color: var(--token-color-border-strong);
176
- color: var(--token-color-foreground-primary);
177
- }
166
+ &:focus,
167
+ &.mock-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
+
172
+ &:active,
173
+ &.mock-active {
174
+ color: var(--token-color-foreground-primary);
175
+ background-color: var(--token-color-surface-interactive-active);
176
+ border-color: var(--token-color-border-strong);
177
+ }
178
178
  }
179
179
 
180
180
  .hds-breadcrumb__truncation-content {
181
- background-color: var(--token-color-surface-primary);
182
- border-radius: 6px;
183
- box-shadow: var(--token-surface-high-box-shadow);
184
- left: -$hds-breadcrumb-item-visual-horizontal-padding;
185
- margin-top: 4px;
186
- max-width: 200px; // by design
187
- padding: 6px 12px;
188
- position: absolute;
189
- top: 100%;
190
- width: max-content;
191
- z-index: 300; // this is the z-index used in Structure for this kind of things, I am reusing the same value
181
+ position: absolute;
182
+ top: 100%;
183
+ left: -$hds-breadcrumb-item-visual-horizontal-padding;
184
+ z-index: 300; // this is the z-index used in Structure for this kind of things, I am reusing the same value
185
+ width: max-content;
186
+ max-width: 200px; // by design
187
+ margin-top: 4px;
188
+ padding: 6px 12px;
189
+ background-color: var(--token-color-surface-primary);
190
+ border-radius: 6px;
191
+ box-shadow: var(--token-surface-high-box-shadow);
192
192
  }
@@ -5,9 +5,9 @@
5
5
  //
6
6
 
7
7
  .hds-button-set {
8
- display: flex;
8
+ display: flex;
9
9
 
10
- > * + * {
11
- margin-left: 16px;
12
- }
13
- }
10
+ > * + * {
11
+ margin-left: 16px;
12
+ }
13
+ }