@gitlab/ui 32.31.0 → 32.32.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gitlab/ui",
3
- "version": "32.31.0",
3
+ "version": "32.32.0",
4
4
  "description": "GitLab UI Components",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",
@@ -295,7 +295,6 @@ export const glIconChevronRight = '#{'data:image/svg+xml}'
295
295
  export const glIconChevronDown = '#{'data:image/svg+xml}'
296
296
  export const defaultIconSize = '1rem'
297
297
  export const glIconSizes = '8 12 14 16 24 32 48 72'
298
- export const glDeprecatedIconSizes = '8 12 14 16 24 32 48 72 10 18'
299
298
  export const glDropdownWidth = '15rem'
300
299
  export const glDropdownWidthNarrow = '10rem'
301
300
  export const glDropdownWidthWide = '25rem'
@@ -1557,11 +1557,6 @@
1557
1557
  "value": "8 12 14 16 24 32 48 72",
1558
1558
  "compiledValue": "8 12 14 16 24 32 48 72"
1559
1559
  },
1560
- {
1561
- "name": "$gl-deprecated-icon-sizes",
1562
- "value": "join($gl-icon-sizes, 10 18)",
1563
- "compiledValue": "8 12 14 16 24 32 48 72 10 18"
1564
- },
1565
1560
  {
1566
1561
  "name": "$gl-dropdown-width",
1567
1562
  "value": "px-to-rem(240px)",
@@ -1,6 +1,6 @@
1
1
  .gl-icon {
2
2
  fill: currentColor;
3
- @each $size in $gl-deprecated-icon-sizes {
3
+ @each $size in $gl-icon-sizes {
4
4
  &.s#{$size} {
5
5
  width: #{$size}px;
6
6
  height: #{$size}px;
@@ -25,6 +25,7 @@ describe('Icon component', () => {
25
25
  });
26
26
  };
27
27
 
28
+ const validateSize = (size) => Icon.props.size.validator(size);
28
29
  const validateName = (name) => Icon.props.name.validator(name);
29
30
 
30
31
  afterEach(() => {
@@ -52,35 +53,14 @@ describe('Icon component', () => {
52
53
  });
53
54
 
54
55
  describe('size validator', () => {
55
- beforeEach(() => {
56
- consoleSpy = jest.spyOn(console, 'warn').mockImplementation();
57
- });
58
-
59
56
  const maxSize = Math.max(...iconSizeOptions);
60
57
 
61
- it('fails with size outside options', async () => {
62
- createComponent({
63
- size: maxSize + 10,
64
- });
65
-
66
- expect(consoleSpy).toBeCalledWith(
67
- `[gitlab-ui] Unexpected value '${maxSize + 10}' was provided for the icon size`
68
- );
69
- });
70
-
71
- it('passes with use-deprecated-sizes', () => {
72
- createComponent({
73
- size: maxSize + 10,
74
- useDeprecatedSizes: true,
75
- });
76
-
77
- expect(consoleSpy).not.toBeCalled();
58
+ it('fails with size outside options', () => {
59
+ expect(validateSize(maxSize + 10)).toBe(false);
78
60
  });
79
61
 
80
62
  it('passes with size in options', () => {
81
- createComponent({ size: maxSize });
82
-
83
- expect(consoleSpy).not.toBeCalled();
63
+ expect(validateSize(maxSize)).toBe(true);
84
64
  });
85
65
  });
86
66
 
@@ -55,15 +55,7 @@ export default {
55
55
  type: Number,
56
56
  required: false,
57
57
  default: 16,
58
- },
59
- /**
60
- * Is used to deprecate 10&18 icon sizes iteratively.
61
- * More info here https://gitlab.com/gitlab-org/gitlab-ui/-/issues/1232
62
- */
63
- useDeprecatedSizes: {
64
- type: Boolean,
65
- required: false,
66
- default: false,
58
+ validator: (value) => iconSizeOptions.includes(value),
67
59
  },
68
60
  },
69
61
  computed: {
@@ -74,13 +66,6 @@ export default {
74
66
  return this.size ? `s${this.size}` : '';
75
67
  },
76
68
  },
77
-
78
- created() {
79
- if (!iconSizeOptions.includes(this.size) && !this.useDeprecatedSizes) {
80
- // eslint-disable-next-line no-console
81
- console.warn(`[gitlab-ui] Unexpected value '${this.size}' was provided for the icon size`);
82
- }
83
- },
84
69
  };
85
70
  </script>
86
71
 
@@ -427,12 +427,7 @@ $gl-icon-chevron-down: 'data:image/svg+xml;utf8,<svg viewBox="0 0 16 16" xmlns="
427
427
 
428
428
  // Icons
429
429
  $default-icon-size: px-to-rem(16px);
430
- // $gl-deprecated-icon-sizes is used for css classes generation as there are still instances around codebase
431
- // where $gl-icon-sizes is a new list of supported icon sizes and will be used for icon size validation
432
- // $gl-deprecated-icon-sizes should be replaced with $gl-icon-sizes in scope
433
- // of this issue https://gitlab.com/gitlab-org/gitlab-ui/-/issues/1232
434
430
  $gl-icon-sizes: 8 12 14 16 24 32 48 72;
435
- $gl-deprecated-icon-sizes: join($gl-icon-sizes, 10 18);
436
431
 
437
432
  // Dropdowns
438
433
  $gl-dropdown-width: px-to-rem(240px);