@gitlab/ui 87.6.0 → 87.7.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 (33) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/dist/components/base/new_dropdowns/disclosure/disclosure_dropdown.js +4 -1
  3. package/dist/components/base/new_dropdowns/listbox/listbox.js +4 -1
  4. package/dist/config.js +22 -3
  5. package/dist/index.css +1 -1
  6. package/dist/index.css.map +1 -1
  7. package/dist/index.js +1 -0
  8. package/dist/tokens/build/js/tokens.dark.js +16 -11
  9. package/dist/tokens/build/js/tokens.js +16 -11
  10. package/dist/tokens/css/tokens.css +15 -10
  11. package/dist/tokens/css/tokens.dark.css +15 -10
  12. package/dist/tokens/js/tokens.dark.js +15 -10
  13. package/dist/tokens/js/tokens.js +15 -10
  14. package/dist/tokens/json/tokens.dark.json +145 -20
  15. package/dist/tokens/json/tokens.json +145 -20
  16. package/dist/tokens/scss/_tokens.dark.scss +15 -10
  17. package/dist/tokens/scss/_tokens.scss +15 -10
  18. package/dist/tokens/scss/_tokens_custom_properties.scss +5 -0
  19. package/package.json +1 -1
  20. package/src/components/base/new_dropdowns/disclosure/disclosure_dropdown.vue +4 -1
  21. package/src/components/base/new_dropdowns/listbox/listbox.vue +4 -1
  22. package/src/config.js +21 -2
  23. package/src/index.js +1 -0
  24. package/src/tokens/build/css/tokens.css +15 -10
  25. package/src/tokens/build/css/tokens.dark.css +15 -10
  26. package/src/tokens/build/js/tokens.dark.js +15 -10
  27. package/src/tokens/build/js/tokens.js +15 -10
  28. package/src/tokens/build/json/tokens.dark.json +145 -20
  29. package/src/tokens/build/json/tokens.json +145 -20
  30. package/src/tokens/build/scss/_tokens.dark.scss +15 -10
  31. package/src/tokens/build/scss/_tokens.scss +15 -10
  32. package/src/tokens/build/scss/_tokens_custom_properties.scss +5 -0
  33. package/src/tokens/feedback.tokens.json +60 -10
package/CHANGELOG.md CHANGED
@@ -1,3 +1,17 @@
1
+ # [87.7.0](https://gitlab.com/gitlab-org/gitlab-ui/compare/v87.6.1...v87.7.0) (2024-08-01)
2
+
3
+
4
+ ### Features
5
+
6
+ * Add boolean flag for improvedHideHeuristics in Config ([1fa7037](https://gitlab.com/gitlab-org/gitlab-ui/commit/1fa703735f10a3cfa3539c3c7d5d7950a6c6257e))
7
+
8
+ ## [87.6.1](https://gitlab.com/gitlab-org/gitlab-ui/compare/v87.6.0...v87.6.1) (2024-08-01)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * **GlFormDate:** Add missing export ([314b172](https://gitlab.com/gitlab-org/gitlab-ui/commit/314b172513730e3c59a48e319a1f49f64c3eb5ef))
14
+
1
15
  # [87.6.0](https://gitlab.com/gitlab-org/gitlab-ui/compare/v87.5.1...v87.6.0) (2024-07-31)
2
16
 
3
17
 
@@ -1,6 +1,7 @@
1
1
  import clamp from 'lodash/clamp';
2
2
  import uniqueId from 'lodash/uniqueId';
3
3
  import { stopEvent, filterVisible } from '../../../../utils/utils';
4
+ import { glDropdownConfig } from '../../../../config';
4
5
  import { GL_DROPDOWN_SHOWN, GL_DROPDOWN_HIDDEN, GL_DROPDOWN_BEFORE_CLOSE, GL_DROPDOWN_FOCUS_CONTENT, POSITION_ABSOLUTE, POSITION_FIXED, HOME, END, ARROW_UP, ARROW_DOWN, ENTER, SPACE, GL_DROPDOWN_CONTENTS_CLASS } from '../constants';
5
6
  import { buttonCategoryOptions, dropdownVariantOptions, buttonSizeOptions, dropdownPlacements } from '../../../../utils/constants';
6
7
  import GlBaseDropdown, { BASE_DROPDOWN_CLASS } from '../base_dropdown/base_dropdown';
@@ -215,7 +216,9 @@ var script = {
215
216
  improvedHideHeuristics: {
216
217
  type: Boolean,
217
218
  required: false,
218
- default: false
219
+ default() {
220
+ return Boolean(glDropdownConfig.useImprovedHideHeuristics);
221
+ }
219
222
  }
220
223
  },
221
224
  data() {
@@ -2,6 +2,7 @@ import clamp from 'lodash/clamp';
2
2
  import uniqueId from 'lodash/uniqueId';
3
3
  import isNil from 'lodash/isNil';
4
4
  import { stopEvent } from '../../../../utils/utils';
5
+ import { glDropdownConfig } from '../../../../config';
5
6
  import { GL_DROPDOWN_SHOWN, GL_DROPDOWN_HIDDEN, POSITION_ABSOLUTE, POSITION_FIXED, GL_DROPDOWN_CONTENTS_CLASS, HOME, END, ARROW_UP, ARROW_DOWN } from '../constants';
6
7
  import { buttonCategoryOptions, dropdownVariantOptions, buttonSizeOptions, dropdownPlacements } from '../../../../utils/constants';
7
8
  import GlButton from '../../button/button';
@@ -336,7 +337,9 @@ var script = {
336
337
  improvedHideHeuristics: {
337
338
  type: Boolean,
338
339
  required: false,
339
- default: false
340
+ default() {
341
+ return Boolean(glDropdownConfig.useImprovedHideHeuristics);
342
+ }
340
343
  }
341
344
  },
342
345
  data() {
package/dist/config.js CHANGED
@@ -35,6 +35,7 @@ try {
35
35
  // localStorage doesn't exist (or the value is not properly formatted)
36
36
  }
37
37
  const i18n = translationKeys;
38
+ const glDropdownConfig = {};
38
39
  let configured = false;
39
40
 
40
41
  /**
@@ -43,11 +44,12 @@ let configured = false;
43
44
  * @typedef {object} GitLabUIConfiguration
44
45
  * @template TValue=string
45
46
  * @property {undefined | Object} translations Generic translations for component labels to fall back to.
46
- * @property {boolean} disableTranslations Whether translation capabilities should be disabled. Suppresses the warning about missing translations.
47
+ * @property {boolean} [useImprovedHideHeuristics] Temporary flag to enable improved hide heuristics for dropdowns.
47
48
  */
48
49
  const setConfigs = function () {
49
50
  let {
50
- translations
51
+ translations,
52
+ useImprovedHideHeuristics
51
53
  } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
52
54
  if (configured) {
53
55
  if (process.env.NODE_ENV === 'development') {
@@ -80,7 +82,24 @@ const setConfigs = function () {
80
82
  }
81
83
  Object.assign(i18n, translations);
82
84
  }
85
+
86
+ // Temporary flag to enable the improved hide heuristics feature.
87
+ // This flag allows the feature to be opt-in during the rollout phase,
88
+ // giving us the flexibility to test and validate its impact on user experience.
89
+
90
+ // The global variable `useImprovedHideHeuristics` is set to a boolean value
91
+ // to indicate whether the improved hide heuristics should be used.
92
+
93
+ // Future Plan:
94
+ // Once the improved hide heuristics feature is validated and stable,
95
+ // we will remove this temporary flag and make the feature the default behavior.
96
+ // At that point, there will be no need for opt-in or opt-out mechanisms for this feature.
97
+ if (typeof useImprovedHideHeuristics === 'boolean') {
98
+ Object.assign(glDropdownConfig, {
99
+ useImprovedHideHeuristics
100
+ });
101
+ }
83
102
  };
84
103
 
85
104
  export default setConfigs;
86
- export { i18n };
105
+ export { glDropdownConfig, i18n };