@gitlab/ui 43.1.0 → 43.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gitlab/ui",
3
- "version": "43.1.0",
3
+ "version": "43.2.0",
4
4
  "description": "GitLab UI Components",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",
@@ -79,22 +79,22 @@
79
79
  },
80
80
  "devDependencies": {
81
81
  "@arkweid/lefthook": "0.7.7",
82
- "@babel/core": "^7.18.9",
83
- "@babel/preset-env": "^7.18.9",
82
+ "@babel/core": "^7.18.10",
83
+ "@babel/preset-env": "^7.18.10",
84
84
  "@gitlab/eslint-plugin": "15.0.0",
85
85
  "@gitlab/stylelint-config": "4.1.0",
86
86
  "@gitlab/svgs": "2.33.0",
87
87
  "@rollup/plugin-commonjs": "^11.1.0",
88
88
  "@rollup/plugin-node-resolve": "^7.1.3",
89
89
  "@rollup/plugin-replace": "^2.3.2",
90
- "@storybook/addon-a11y": "6.5.9",
91
- "@storybook/addon-docs": "6.5.9",
92
- "@storybook/addon-essentials": "6.5.9",
93
- "@storybook/addon-storyshots": "6.5.9",
94
- "@storybook/addon-storyshots-puppeteer": "6.5.9",
95
- "@storybook/addon-viewport": "6.5.9",
96
- "@storybook/theming": "6.5.9",
97
- "@storybook/vue": "6.5.9",
90
+ "@storybook/addon-a11y": "6.5.10",
91
+ "@storybook/addon-docs": "6.5.10",
92
+ "@storybook/addon-essentials": "6.5.10",
93
+ "@storybook/addon-storyshots": "6.5.10",
94
+ "@storybook/addon-storyshots-puppeteer": "6.5.10",
95
+ "@storybook/addon-viewport": "6.5.10",
96
+ "@storybook/theming": "6.5.10",
97
+ "@storybook/vue": "6.5.10",
98
98
  "@vue/test-utils": "1.3.0",
99
99
  "@vue/vue2-jest": "27.0.0",
100
100
  "autoprefixer": "^9.7.6",
@@ -508,15 +508,15 @@ export default {
508
508
  },
509
509
  argTypes: {
510
510
  category: {
511
- options: buttonCategoryOptions,
511
+ options: Object.keys(buttonCategoryOptions),
512
512
  control: 'select',
513
513
  },
514
514
  variant: {
515
- options: buttonVariantOptions,
515
+ options: Object.keys(buttonVariantOptions),
516
516
  control: 'select',
517
517
  },
518
518
  size: {
519
- options: buttonSizeOptions,
519
+ options: Object.keys(buttonSizeOptions),
520
520
  control: 'select',
521
521
  },
522
522
  target: {
@@ -45,22 +45,18 @@
45
45
 
46
46
  h1,
47
47
  .gl-h1 {
48
- @include gl-font-size-markdown-h1;
49
- @include gl-line-height-32;
50
48
  @include gl-fluid-font-size(
51
- $min: $gl-font-size-markdown-h1-md,
49
+ $min: $gl-font-size-markdown-h1,
52
50
  $max: $gl-font-size-markdown-h1-xl
53
51
  );
54
- @include gl-fluid-line-height($min: $gl-line-height-36, $max: $gl-line-height-52);
52
+ @include gl-fluid-line-height($min: $gl-line-height-32, $max: $gl-line-height-52);
55
53
  @include gl-mt-0;
56
54
  }
57
55
 
58
56
  h2,
59
57
  .gl-h2 {
60
- @include gl-font-size-markdown-h2;
61
- @include gl-line-height-28;
62
58
  @include gl-fluid-font-size(
63
- $min: $gl-font-size-markdown-h2-md,
59
+ $min: $gl-font-size-markdown-h2,
64
60
  $max: $gl-font-size-markdown-h2-xl
65
61
  );
66
62
  @include gl-fluid-line-height($min: $gl-line-height-28, $max: $gl-line-height-36);
@@ -69,10 +65,8 @@
69
65
 
70
66
  h3,
71
67
  .gl-h3 {
72
- @include gl-font-size-markdown-h3;
73
- @include gl-line-height-24;
74
68
  @include gl-fluid-font-size(
75
- $min: $gl-font-size-markdown-h3-md,
69
+ $min: $gl-font-size-markdown-h3,
76
70
  $max: $gl-font-size-markdown-h3-xl
77
71
  );
78
72
  @include gl-fluid-line-height($min: $gl-line-height-24, $max: $gl-line-height-28);
@@ -239,10 +233,8 @@
239
233
 
240
234
  h1,
241
235
  .gl-h1 {
242
- @include gl-font-size-compact-markdown-h1;
243
- @include gl-line-height-24;
244
236
  @include gl-fluid-font-size(
245
- $min: $gl-font-size-compact-markdown-h1-md,
237
+ $min: $gl-font-size-compact-markdown-h1,
246
238
  $max: $gl-font-size-compact-markdown-h1-xl
247
239
  );
248
240
  @include gl-fluid-line-height($min: $gl-line-height-24, $max: $gl-line-height-28);
@@ -65,7 +65,7 @@ export default {
65
65
  argTypes: {
66
66
  ...disableControls(['name']),
67
67
  labelPosition: {
68
- options: toggleLabelPosition,
68
+ options: Object.keys(toggleLabelPosition),
69
69
  control: 'select',
70
70
  },
71
71
  label: {
@@ -49,3 +49,13 @@
49
49
  @function if-important($important) {
50
50
  @return #{if($important, '!important', '')};
51
51
  }
52
+
53
+ @function clamp-between($min, $max, $min-width: $breakpoint-md, $max-width: $breakpoint-xl) {
54
+ $min-width: px-to-rem($min-width);
55
+ $max-width: px-to-rem($max-width);
56
+
57
+ $slope: ($max - $min) / ($max-width - $min-width);
58
+ $intersection: (-$min-width * $slope) + $min;
59
+
60
+ @return clamp(#{$min}, #{$intersection} + #{$slope * 100vw}, #{$max});
61
+ }
@@ -21,30 +21,14 @@
21
21
  * should be numeric.
22
22
  *
23
23
  * Values are expected in rem units.
24
+ * Fluid range: between 48rem (768px) – 75rem (1200px).
24
25
  *
25
26
  * @param $property Property name, i.e. line-height, font-size, width, height, etc.
26
- * @param $property-min Property value lower bound.
27
- * @param $property-max Property value upper bound.
27
+ * @param $min Property value lower bound.
28
+ * @param $max Property value upper bound.
28
29
  */
29
- @mixin gl-responsive-property(
30
- $property,
31
- $property-min,
32
- $property-max,
33
- $breakpoint-min: $breakpoint-md,
34
- $breakpoint-max: $breakpoint-xl
35
- ) {
36
- $property-range: ($property-max - $property-min) / 1rem;
37
- $breakpoint-range: px-to-rem($breakpoint-max - $breakpoint-min) / 1rem;
38
-
39
- @media (min-width: $breakpoint-min) {
40
- #{$property}: calc(
41
- #{$property-min} + #{$property-range} * ((100vw - #{$breakpoint-min}) / #{$breakpoint-range})
42
- );
43
- }
44
-
45
- @media (min-width: $breakpoint-max) {
46
- #{$property}: $property-max;
47
- }
30
+ @mixin gl-responsive-property($property, $min, $max) {
31
+ #{$property}: clamp-between($min, $max);
48
32
  }
49
33
 
50
34
  /**
@@ -9,14 +9,8 @@
9
9
  @include gl-fluid-font-size(2rem, 3.5rem);
10
10
  }
11
11
  @include expect {
12
- @media (min-width: 768px) {
13
- // prettier-ignore
14
- font-size: calc( 2rem + 1.5 * ((100vw - 768px) / 27));
15
- }
16
-
17
- @media (min-width: 1200px) {
18
- font-size: 3.5rem;
19
- }
12
+ // prettier-ignore
13
+ font-size: clamp(2rem, #{-0.66667rem} + #{5.55556vw}, 3.5rem);
20
14
  }
21
15
  }
22
16
  }
@@ -29,14 +23,8 @@
29
23
  @include gl-fluid-line-height(2rem, 3.5rem);
30
24
  }
31
25
  @include expect {
32
- @media (min-width: 768px) {
33
- // prettier-ignore
34
- line-height: calc( 2rem + 1.5 * ((100vw - 768px) / 27));
35
- }
36
-
37
- @media (min-width: 1200px) {
38
- line-height: 3.5rem;
39
- }
26
+ // prettier-ignore
27
+ line-height: clamp(2rem, #{-0.66667rem} + #{5.55556vw}, 3.5rem);
40
28
  }
41
29
  }
42
30
  }
@@ -26,25 +26,19 @@
26
26
  }
27
27
 
28
28
  .h-display {
29
- @include gl-font-size-h-display;
30
- @include gl-line-height-32;
31
- @include gl-fluid-font-size($min: $gl-font-size-h-display-md, $max: $gl-font-size-h-display-xl);
32
- @include gl-fluid-line-height($min: $gl-line-height-36, $max: $gl-line-height-52);
29
+ @include gl-fluid-font-size($min: $gl-font-size-h-display, $max: $gl-font-size-h-display-xl);
30
+ @include gl-fluid-line-height($min: $gl-line-height-32, $max: $gl-line-height-52);
33
31
  }
34
32
 
35
33
  h1,
36
34
  .gl-h1 {
37
- @include gl-font-size-h1;
38
- @include gl-line-height-28;
39
- @include gl-fluid-font-size($min: $gl-font-size-h1-md, $max: $gl-font-size-h1-xl);
35
+ @include gl-fluid-font-size($min: $gl-font-size-h1, $max: $gl-font-size-h1-xl);
40
36
  @include gl-fluid-line-height($min: $gl-line-height-28, $max: $gl-line-height-36);
41
37
  }
42
38
 
43
39
  h2,
44
40
  .gl-h2 {
45
- @include gl-font-size-h2;
46
- @include gl-line-height-24;
47
- @include gl-fluid-font-size($min: $gl-font-size-h2-md, $max: $gl-font-size-h2-xl);
41
+ @include gl-fluid-font-size($min: $gl-font-size-h2, $max: $gl-font-size-h2-xl);
48
42
  @include gl-fluid-line-height($min: $gl-line-height-24, $max: $gl-line-height-28);
49
43
  }
50
44