@gitlab/ui 81.0.0 → 82.0.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": "81.0.0",
3
+ "version": "82.0.0",
4
4
  "description": "GitLab UI Components",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",
@@ -17,8 +17,9 @@
17
17
  "files": [
18
18
  "src",
19
19
  "dist",
20
- "translations.json",
20
+ "translations.js",
21
21
  "tailwind.defaults.js",
22
+ "!src/vendor",
22
23
  "!*.stories.js",
23
24
  "!*.snap",
24
25
  "!*.spec.{js,scss}"
@@ -63,12 +64,12 @@
63
64
  "stylelint": "stylelint 'src/**/*.scss'",
64
65
  "prestylelint": "yarn generate-utilities",
65
66
  "stylelint:fix": "yarn stylelint --fix",
66
- "markdownlint": "markdownlint '**/*.md' --ignore node_modules --ignore CHANGELOG.md",
67
+ "markdownlint": "markdownlint '**/*.md' --ignore node_modules --ignore CHANGELOG.md --ignore src/vendor",
67
68
  "markdownlint:fix": "yarn markdownlint --fix",
68
69
  "lint": "run-p prettier eslint stylelint markdownlint",
69
70
  "lint:fix": "run-s eslint:fix prettier:fix stylelint:fix markdownlint:fix",
70
71
  "generate:component": "plop",
71
- "translations:collect": "make translations.json",
72
+ "translations:collect": "make translations.js",
72
73
  "tailwind-config-viewer": "tailwind-config-viewer -o"
73
74
  },
74
75
  "dependencies": {
@@ -107,7 +108,7 @@
107
108
  "@gitlab/eslint-plugin": "19.5.0",
108
109
  "@gitlab/fonts": "^1.3.0",
109
110
  "@gitlab/stylelint-config": "6.1.0",
110
- "@gitlab/svgs": "3.101.0",
111
+ "@gitlab/svgs": "3.102.0",
111
112
  "@jest/test-sequencer": "^29.7.0",
112
113
  "@rollup/plugin-commonjs": "^11.1.0",
113
114
  "@rollup/plugin-node-resolve": "^7.1.3",
@@ -132,6 +133,9 @@
132
133
  "@vue/test-utils-vue3": "npm:@vue/test-utils@2.2.0",
133
134
  "@vue/vue2-jest": "29.0.0",
134
135
  "@vue/vue3-jest": "^29.1.1",
136
+ "@yarnpkg/lockfile": "^1.1.0",
137
+ "acorn": "^8.11.3",
138
+ "acorn-walk": "^8.3.2",
135
139
  "autoprefixer": "^9.7.6",
136
140
  "axe-core": "^4.2.3",
137
141
  "babel-jest": "29.0.1",
@@ -146,6 +150,7 @@
146
150
  "eslint-import-resolver-jest": "3.0.2",
147
151
  "eslint-plugin-cypress": "3.3.0",
148
152
  "eslint-plugin-storybook": "0.8.0",
153
+ "gitlab-api-async-iterator": "^1.3.1",
149
154
  "glob": "10.3.3",
150
155
  "identity-obj-proxy": "^3.0.0",
151
156
  "inquirer-select-directory": "^1.2.0",
@@ -181,6 +181,11 @@ export default {
181
181
  default: null,
182
182
  validator: (value) => Object.keys(datepickerWidthOptionsMap).includes(value),
183
183
  },
184
+ state: {
185
+ type: Boolean,
186
+ required: false,
187
+ default: null,
188
+ },
184
189
  },
185
190
  data() {
186
191
  return {
@@ -382,6 +387,7 @@ export default {
382
387
  :autocomplete="inputAutocomplete"
383
388
  :disabled="disabled"
384
389
  :aria-label="inputLabel"
390
+ :state="state"
385
391
  @keydown.enter="onKeydown"
386
392
  />
387
393
  </slot>
@@ -83,6 +83,11 @@ export default {
83
83
  required: false,
84
84
  default: '',
85
85
  },
86
+ startPickerState: {
87
+ type: Boolean,
88
+ required: false,
89
+ default: null,
90
+ },
86
91
  endPickerClass: {
87
92
  type: String,
88
93
  required: false,
@@ -98,6 +103,11 @@ export default {
98
103
  required: false,
99
104
  default: '',
100
105
  },
106
+ endPickerState: {
107
+ type: Boolean,
108
+ required: false,
109
+ default: null,
110
+ },
101
111
  labelClass: {
102
112
  type: String,
103
113
  required: false,
@@ -277,6 +287,7 @@ export default {
277
287
  :target="startPickerTarget"
278
288
  :container="startPickerContainer"
279
289
  :start-opened="startOpened"
290
+ :state="startPickerState"
280
291
  :width="width"
281
292
  @input="onStartDateSelected"
282
293
  @open="onStartPickerOpen"
@@ -303,6 +314,7 @@ export default {
303
314
  :start-opened="openToCalendar"
304
315
  :default-date="toCalendarDefaultDate"
305
316
  :width="width"
317
+ :state="endPickerState"
306
318
  @input="onEndDateSelected"
307
319
  @open="onEndPickerOpen"
308
320
  @close="onEndPickerClose"
@@ -1,5 +1,11 @@
1
1
  <script>
2
2
  import { BFormText } from 'bootstrap-vue';
3
3
 
4
- export default BFormText;
4
+ export default {
5
+ ...BFormText.options,
6
+ name: 'GlFormText',
7
+ render(createElement, context) {
8
+ return BFormText.options.render(createElement, context);
9
+ },
10
+ };
5
11
  </script>
@@ -54,8 +54,8 @@ $label-close-button: '.gl-label-close.gl-button';
54
54
  @include gl-display-flex;
55
55
  width: px-to-rem(14px);
56
56
  height: px-to-rem(14px);
57
- margin-left: #{-$gl-spacing-scale-1 - ($gl-spacing-scale-1 / 2)};
58
- margin-right: #{$gl-spacing-scale-2 - ($gl-spacing-scale-1 / 2)};
57
+ margin-left: calc(#{-$gl-spacing-scale-1} - (#{$gl-spacing-scale-1} / 2));
58
+ margin-right: calc(#{$gl-spacing-scale-2} - (#{$gl-spacing-scale-1} / 2));
59
59
  @include gl-p-0;
60
60
  @include gl-rounded-full;
61
61
  @include gl-shadow-none;
@@ -1,5 +1,6 @@
1
1
  <script>
2
2
  import GlIcon from '../../../../../base/icon/icon.vue';
3
+ import GlLoadingIcon from '../../../../../base/loading_icon/loading_icon.vue';
3
4
  import { GlTooltipDirective } from '../../../../../../directives/tooltip';
4
5
  import GlDuoUserFeedback from '../../../user_feedback/user_feedback.vue';
5
6
  import GlFormGroup from '../../../../../base/form/form_group/form_group.vue';
@@ -37,6 +38,7 @@ export default {
37
38
  GlFormGroup,
38
39
  GlFormTextarea,
39
40
  GlIcon,
41
+ GlLoadingIcon,
40
42
  },
41
43
  directives: {
42
44
  SafeHtml,
@@ -199,7 +201,9 @@ export default {
199
201
  <documentation-sources v-if="sources" :sources="sources" />
200
202
 
201
203
  <div class="gl-display-flex gl-align-items-flex-end gl-mt-4 duo-chat-message-feedback">
204
+ <gl-loading-icon v-if="isChunk" class="gl-pt-4" variant="dots" inline />
202
205
  <gl-duo-user-feedback
206
+ v-if="!isChunk"
203
207
  :feedback-received="hasFeedback"
204
208
  :modal-title="$options.i18n.MODAL.TITLE"
205
209
  :modal-alert="$options.i18n.MODAL.ALERT_TEXT"
package/src/config.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { BVConfigPlugin } from 'bootstrap-vue';
2
2
  import Vue from 'vue';
3
- import translationKeys from '../translations.json';
3
+ import translationKeys from '../translations';
4
4
  import { tooltipDelay } from './utils/constants';
5
5
 
6
6
  const bFormTextGlobalConfig = {
@@ -1,3 +1,5 @@
1
+ @use 'sass:math';
2
+
1
3
  /*
2
4
  * SASS preserves units in arithmetic operations. For example:
3
5
  * 12em * 0 = 0em. This function return the unit of a numeric value.
@@ -10,7 +12,7 @@
10
12
 
11
13
  @function strip-unit($number) {
12
14
  @if type-of($number) == 'number' and not unitless($number) {
13
- @return $number / extract-unit($number);
15
+ @return math.div($number, extract-unit($number));
14
16
  }
15
17
 
16
18
  @return $number;
@@ -21,10 +23,7 @@
21
23
  @return $value;
22
24
  }
23
25
 
24
- // Using / for division outside of calc() is deprecated and will be removed in Dart Sass 2.0.0
25
- // We can't update this yet since GitLab uses SassC, which doesn't support math.div
26
- // See https://gitlab.com/gitlab-org/gitlab-ui/-/issues/1954#note_1078281533
27
- $converted: $value / $font-size-base;
26
+ $converted: math.div($value, $font-size-base);
28
27
 
29
28
  @return strip-unit($converted) * 1rem;
30
29
  }
@@ -57,14 +56,8 @@
57
56
  $min-width: px-to-rem($min-width);
58
57
  $max-width: px-to-rem($max-width);
59
58
 
60
- // Using / for division outside of calc() is deprecated and will be removed in Dart Sass 2.0.0
61
- // We can't update this yet since GitLab uses SassC, which doesn't support math.div
62
- // See https://gitlab.com/gitlab-org/gitlab-ui/-/issues/1954#note_1078281533
63
- $slope: ($max - $min) / ($max-width - $min-width);
59
+ $slope: math.div($max - $min, $max-width - $min-width);
64
60
  $intersection: (-$min-width * $slope) + $min;
65
61
 
66
- // Use calc() inside of clamp() function to work around SassC
67
- // compilation failure.
68
- // See https://gitlab.com/gitlab-org/gitlab-ui/-/merge_requests/2972
69
- @return clamp(#{$min}, calc(#{$intersection} + #{$slope * 100vw}), #{$max});
62
+ @return clamp(#{$min}, #{$intersection} + #{$slope * 100vw}, #{$max});
70
63
  }
@@ -10,8 +10,6 @@
10
10
  // to use Custom Properties instead
11
11
 
12
12
  .gl-dark {
13
- --color-body-bg: #1f1f1f;
14
-
15
13
  // Note that we are assigning variables with different values due to the way GitLab inverts variables in dark mode.
16
14
  // e.g. text color is usually $gray-900, but in dark mode $gray-900 variable gets inverted to $gray-50
17
15
  --gl-text-color: #{$gray-50};
@@ -23,9 +21,7 @@
23
21
 
24
22
  &,
25
23
  body {
26
- // We can delete these once $body-bg and $body-color
27
- // variables in variables.scss are updated to use CSS custom properties
28
- background-color: var(--color-body-bg);
29
- color: var(--gl-text-color);
24
+ background-color: var(--gl-background-color-default);
25
+ color: var(--gl-text-color-default);
30
26
  }
31
27
  }
@@ -0,0 +1,13 @@
1
+ /* eslint-disable import/no-default-export */
2
+ export default {
3
+ 'ClearIconButton.title': 'Clear',
4
+ 'GlBreadcrumb.showMoreLabel': 'Show more breadcrumbs',
5
+ 'GlCollapsibleListbox.srOnlyResultsLabel': 'Results count',
6
+ 'GlKeysetPagination.navigationLabel': 'Pagination',
7
+ 'GlKeysetPagination.nextText': 'Next',
8
+ 'GlKeysetPagination.prevText': 'Previous',
9
+ 'GlSearchBoxByType.clearButtonTitle': 'Clear',
10
+ 'GlSearchBoxByType.input.placeholder': 'Search',
11
+ 'GlSorting.sortAscending': 'Sort direction: ascending',
12
+ 'GlSorting.sortDescending': 'Sort direction: descending',
13
+ };
package/translations.json DELETED
@@ -1,12 +0,0 @@
1
- {
2
- "ClearIconButton.title": "Clear",
3
- "GlBreadcrumb.showMoreLabel": "Show more breadcrumbs",
4
- "GlCollapsibleListbox.srOnlyResultsLabel": "Results count",
5
- "GlKeysetPagination.navigationLabel": "Pagination",
6
- "GlKeysetPagination.nextText": "Next",
7
- "GlKeysetPagination.prevText": "Previous",
8
- "GlSearchBoxByType.clearButtonTitle": "Clear",
9
- "GlSearchBoxByType.input.placeholder": "Search",
10
- "GlSorting.sortAscending": "Sort direction: ascending",
11
- "GlSorting.sortDescending": "Sort direction: descending"
12
- }