@hashicorp/design-system-components 2.14.2 → 2.15.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,18 @@
|
|
|
1
1
|
# @hashicorp/design-system-components
|
|
2
2
|
|
|
3
|
+
## 2.15.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#1690](https://github.com/hashicorp/design-system/pull/1690) [`33df4e25e`](https://github.com/hashicorp/design-system/commit/33df4e25e7bff4dabbba3744128449e2b99d4911) Thanks [@didoo](https://github.com/didoo)! - `Button` - updated horizontal padding of icon-only variant
|
|
8
|
+
`Dropdown::ToggleIcon` - updated sizing of the "small" variant to match the height of the "small" variant `Button`
|
|
9
|
+
|
|
10
|
+
### Patch Changes
|
|
11
|
+
|
|
12
|
+
- [#1736](https://github.com/hashicorp/design-system/pull/1736) [`541d22442`](https://github.com/hashicorp/design-system/commit/541d22442396d33850a68a61e2781094df1b121a) Thanks [@didoo](https://github.com/didoo)! - `Pagination` - Removed handling of query parameters from `onPageSizeChange` function.
|
|
13
|
+
|
|
14
|
+
_Notice: while technically this is a breaking change, we consider this a fast-follow fix for the previous release._
|
|
15
|
+
|
|
3
16
|
## 2.14.2
|
|
4
17
|
|
|
5
18
|
### Patch Changes
|
|
@@ -158,6 +158,11 @@ export default class HdsButtonIndexComponent extends Component {
|
|
|
158
158
|
classes.push('hds-button--width-full');
|
|
159
159
|
}
|
|
160
160
|
|
|
161
|
+
// add a class if it's icon-only
|
|
162
|
+
if (this.isIconOnly) {
|
|
163
|
+
classes.push('hds-button--is-icon-only');
|
|
164
|
+
}
|
|
165
|
+
|
|
161
166
|
return classes.join(' ');
|
|
162
167
|
}
|
|
163
168
|
}
|
|
@@ -7,15 +7,12 @@ import Component from '@glimmer/component';
|
|
|
7
7
|
import { tracked } from '@glimmer/tracking';
|
|
8
8
|
import { action } from '@ember/object';
|
|
9
9
|
import { assert } from '@ember/debug';
|
|
10
|
-
import { inject as service } from '@ember/service';
|
|
11
10
|
|
|
12
11
|
// for context about the decision to use these values, see:
|
|
13
12
|
// https://hashicorp.slack.com/archives/C03A0N1QK8S/p1673546329082759
|
|
14
13
|
export const DEFAULT_PAGE_SIZES = [10, 30, 50];
|
|
15
14
|
|
|
16
15
|
export default class HdsPaginationCompactIndexComponent extends Component {
|
|
17
|
-
@service router;
|
|
18
|
-
|
|
19
16
|
// This private variable is used to differentiate between
|
|
20
17
|
// "uncontrolled" component (where the state is handled internally) and
|
|
21
18
|
// "controlled" component (where the state is handled externally, by the consumer's code).
|
|
@@ -109,10 +106,6 @@ export default class HdsPaginationCompactIndexComponent extends Component {
|
|
|
109
106
|
return pageSizes;
|
|
110
107
|
}
|
|
111
108
|
|
|
112
|
-
get routeQueryParams() {
|
|
113
|
-
return this.router.currentRoute?.queryParams || {};
|
|
114
|
-
}
|
|
115
|
-
|
|
116
109
|
buildQueryParamsObject(page, pageSize) {
|
|
117
110
|
if (this.isControlled) {
|
|
118
111
|
return this.args.queryFunction(page, pageSize);
|
|
@@ -162,15 +155,6 @@ export default class HdsPaginationCompactIndexComponent extends Component {
|
|
|
162
155
|
onPageSizeChange(newPageSize) {
|
|
163
156
|
let { onPageSizeChange } = this.args;
|
|
164
157
|
|
|
165
|
-
// we need to manually update the query parameters in the route (it's not a link!)
|
|
166
|
-
if (this.isControlled) {
|
|
167
|
-
// we pass `null` as value for the `page` argument, so consumers can handle this condition accordingly (probably will just change the side of the data/array slice)
|
|
168
|
-
const queryParams = this.buildQueryParamsObject(null, newPageSize);
|
|
169
|
-
this.router.transitionTo({ queryParams });
|
|
170
|
-
} else {
|
|
171
|
-
this.currentPageSize = newPageSize;
|
|
172
|
-
}
|
|
173
|
-
|
|
174
158
|
// invoke the callback function
|
|
175
159
|
if (typeof onPageSizeChange === 'function') {
|
|
176
160
|
onPageSizeChange(newPageSize);
|
|
@@ -75,14 +75,14 @@ $hds-dropdown-toggle-border-radius: $hds-button-border-radius;
|
|
|
75
75
|
|
|
76
76
|
.hds-dropdown-toggle-icon--size-small {
|
|
77
77
|
.hds-dropdown-toggle-icon__wrapper {
|
|
78
|
-
width:
|
|
79
|
-
height:
|
|
78
|
+
width: 24px; // same as the `button[small]` minus 2*2px becaus there are a 1px padding and 1px border to take into account
|
|
79
|
+
height: 24px;
|
|
80
80
|
}
|
|
81
81
|
}
|
|
82
82
|
|
|
83
83
|
.hds-dropdown-toggle-icon--size-medium {
|
|
84
84
|
.hds-dropdown-toggle-icon__wrapper {
|
|
85
|
-
width: 32px;
|
|
85
|
+
width: 32px; // same as the `button[medium]` minus 2*2px becaus there are a 1px padding and 1px border to take into account
|
|
86
86
|
height: 32px;
|
|
87
87
|
}
|
|
88
88
|
}
|
|
@@ -14,21 +14,24 @@ $size-props: (
|
|
|
14
14
|
"font-size": 0.8125rem, // 13px;
|
|
15
15
|
"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)
|
|
16
16
|
"min-height": 1.75rem, // 28px
|
|
17
|
-
"padding": 0.375rem
|
|
17
|
+
"padding-vertical": 0.375rem, // 6px - here we're taking into account the 1px border
|
|
18
|
+
"padding-horizontal": 0.6875rem, // 11px - here we're taking into account the 1px border
|
|
18
19
|
"icon-size": 0.75rem, // 12px
|
|
19
20
|
),
|
|
20
21
|
"medium": (
|
|
21
22
|
"font-size": 0.875rem, // 14px
|
|
22
23
|
"line-height": 1rem,// 16px
|
|
23
24
|
"min-height": 2.25rem, // 36px
|
|
24
|
-
"padding": 0.5625rem
|
|
25
|
+
"padding-vertical": 0.5625rem, // 9px - here we're taking into account the 1px border
|
|
26
|
+
"padding-horizontal": 0.9375rem, // 15px - here we're taking into account the 1px border
|
|
25
27
|
"icon-size": 1rem, // 16px
|
|
26
28
|
),
|
|
27
29
|
"large": (
|
|
28
30
|
"font-size": 1rem, // 16px
|
|
29
31
|
"line-height": 1.5rem, // 24px
|
|
30
32
|
"min-height": 3rem, // 48px
|
|
31
|
-
"padding": 0.6875rem
|
|
33
|
+
"padding-vertical": 0.6875rem, // 11px - here we're taking into account the 1px border
|
|
34
|
+
"padding-horizontal": 1.1875rem, // 19px - here we're taking into account the 1px border
|
|
32
35
|
"icon-size": 1.5rem, // 24px
|
|
33
36
|
)
|
|
34
37
|
);
|
|
@@ -271,7 +274,7 @@ $size-props: (
|
|
|
271
274
|
@each $size in $hds-button-sizes {
|
|
272
275
|
.#{$blockName}--size-#{$size} {
|
|
273
276
|
min-height: map-get($size-props, $size, "min-height");
|
|
274
|
-
padding: map-get($size-props, $size, "padding");
|
|
277
|
+
padding: map-get($size-props, $size, "padding-vertical") map-get($size-props, $size, "padding-horizontal");
|
|
275
278
|
|
|
276
279
|
.#{$blockName}__icon {
|
|
277
280
|
width: map-get($size-props, $size, "icon-size");
|
|
@@ -282,6 +285,13 @@ $size-props: (
|
|
|
282
285
|
font-size: map-get($size-props, $size, "font-size");
|
|
283
286
|
line-height: map-get($size-props, $size, "line-height");
|
|
284
287
|
}
|
|
288
|
+
|
|
289
|
+
&.#{$blockName}--is-icon-only {
|
|
290
|
+
// overrides to have the icon-only button squared
|
|
291
|
+
min-width: map-get($size-props, $size, "min-height");
|
|
292
|
+
padding-right: map-get($size-props, $size, "padding-vertical");
|
|
293
|
+
padding-left: map-get($size-props, $size, "padding-vertical");
|
|
294
|
+
}
|
|
285
295
|
}
|
|
286
296
|
}
|
|
287
297
|
}
|