@gitlab/ui 66.12.0 → 66.13.1

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 (31) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/dist/components/base/broadcast_message/broadcast_message.js +1 -1
  3. package/dist/components/base/datepicker/datepicker.js +29 -6
  4. package/dist/components/base/form/form_input/form_input.js +24 -4
  5. package/dist/components/base/form/form_select/form_select.js +24 -4
  6. package/dist/index.css +1 -1
  7. package/dist/index.css.map +1 -1
  8. package/dist/tokens/css/tokens.css +1 -1
  9. package/dist/tokens/css/tokens.dark.css +1 -1
  10. package/dist/tokens/js/tokens.dark.js +1 -1
  11. package/dist/tokens/js/tokens.js +1 -1
  12. package/dist/tokens/scss/_tokens.dark.scss +1 -1
  13. package/dist/tokens/scss/_tokens.scss +1 -1
  14. package/dist/utility_classes.css +1 -1
  15. package/dist/utility_classes.css.map +1 -1
  16. package/dist/utils/constants.js +7 -1
  17. package/package.json +17 -17
  18. package/src/components/base/broadcast_message/broadcast_message.scss +7 -0
  19. package/src/components/base/broadcast_message/broadcast_message.vue +2 -2
  20. package/src/components/base/datepicker/datepicker.spec.js +17 -0
  21. package/src/components/base/datepicker/datepicker.stories.js +20 -4
  22. package/src/components/base/datepicker/datepicker.vue +33 -5
  23. package/src/components/base/form/form_input/form_input.spec.js +52 -0
  24. package/src/components/base/form/form_input/form_input.stories.js +10 -0
  25. package/src/components/base/form/form_input/form_input.vue +25 -4
  26. package/src/components/base/form/form_select/form_select.spec.js +25 -0
  27. package/src/components/base/form/form_select/form_select.stories.js +7 -0
  28. package/src/components/base/form/form_select/form_select.vue +25 -4
  29. package/src/scss/utilities.scss +2 -2
  30. package/src/scss/utility-mixins/text.scss +1 -1
  31. package/src/utils/constants.js +7 -0
package/CHANGELOG.md CHANGED
@@ -1,3 +1,18 @@
1
+ ## [66.13.1](https://gitlab.com/gitlab-org/gitlab-ui/compare/v66.13.0...v66.13.1) (2023-09-25)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * **css:** update gl-overflow-break-word mixin ([5280a70](https://gitlab.com/gitlab-org/gitlab-ui/commit/5280a70c13a9cd00887d9844b705d64a5675eadc))
7
+ * **GlBroadcastMessage:** Fix broadcast message word break issue ([83363ff](https://gitlab.com/gitlab-org/gitlab-ui/commit/83363ff8a8d7e2ede363dcd137d231611a4722f0))
8
+
9
+ # [66.13.0](https://gitlab.com/gitlab-org/gitlab-ui/compare/v66.12.0...v66.13.0) (2023-09-21)
10
+
11
+
12
+ ### Features
13
+
14
+ * **GlFormInut, GlFormSelect, GlDatepicker:** Add prop width, deprecate prop size ([6de322c](https://gitlab.com/gitlab-org/gitlab-ui/commit/6de322c20f7fb2f2f7922392da513167f3bd2530))
15
+
1
16
  # [66.12.0](https://gitlab.com/gitlab-org/gitlab-ui/compare/v66.11.0...v66.12.0) (2023-09-21)
2
17
 
3
18
 
@@ -77,7 +77,7 @@ var script = {
77
77
  const __vue_script__ = script;
78
78
 
79
79
  /* template */
80
- var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"gl-broadcast-message",class:(_vm.theme + " " + _vm.type)},[_c('div',{staticClass:"gl-broadcast-message-content"},[_c('div',{staticClass:"gl-broadcast-message-icon gl-line-height-normal"},[_c('gl-icon',{attrs:{"name":_vm.iconName}})],1),_vm._v(" "),_c('div',{staticClass:"gl-my-n1"},[_c('h2',{staticClass:"gl-sr-only"},[_vm._v("Admin message")]),_vm._v(" "),_vm._t("default")],2)]),_vm._v(" "),(_vm.showDismissButton)?_c('close-button',{ref:"dismiss",staticClass:"gl-close-btn-color-inherit gl-broadcast-message-dismiss",attrs:{"label":_vm.dismissLabel},on:{"click":_vm.onDismiss}}):_vm._e()],1)};
80
+ var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"gl-broadcast-message",class:(_vm.theme + " " + _vm.type)},[_c('div',{staticClass:"gl-broadcast-message-content"},[_c('div',{staticClass:"gl-broadcast-message-icon"},[_c('gl-icon',{attrs:{"name":_vm.iconName}})],1),_vm._v(" "),_c('div',{staticClass:"gl-broadcast-message-text"},[_c('h2',{staticClass:"gl-sr-only"},[_vm._v("Admin message")]),_vm._v(" "),_vm._t("default")],2)]),_vm._v(" "),(_vm.showDismissButton)?_c('close-button',{ref:"dismiss",staticClass:"gl-close-btn-color-inherit gl-broadcast-message-dismiss",attrs:{"label":_vm.dismissLabel},on:{"click":_vm.onDismiss}}):_vm._e()],1)};
81
81
  var __vue_staticRenderFns__ = [];
82
82
 
83
83
  /* style */
@@ -1,6 +1,6 @@
1
1
  import isString from 'lodash/isString';
2
2
  import Pikaday from 'pikaday';
3
- import { defaultDateFormat, datepickerSizeOptionsMap } from '../../../utils/constants';
3
+ import { defaultDateFormat, datepickerWidthOptionsMap, datepickerSizeOptionsMap } from '../../../utils/constants';
4
4
  import { areDatesEqual } from '../../../utils/datetime_utility';
5
5
  import GlButton from '../button/button';
6
6
  import GlFormInput from '../form/form_input/form_input';
@@ -173,10 +173,27 @@ var script = {
173
173
  required: false,
174
174
  default: null
175
175
  },
176
+ /**
177
+ * Maximum width of the Datepicker
178
+ */
179
+ width: {
180
+ type: String,
181
+ required: false,
182
+ default: null,
183
+ validator: value => Object.keys(datepickerWidthOptionsMap).includes(value)
184
+ },
185
+ /**
186
+ * ⚠️ DEPRECATED:
187
+ *
188
+ * Will be replaced by the
189
+ * property width
190
+ *
191
+ * Maximum width of the Datepicker
192
+ */
176
193
  size: {
177
194
  type: String,
178
195
  required: false,
179
- default: 'medium',
196
+ default: null,
180
197
  validator: value => Object.keys(datepickerSizeOptionsMap).includes(value)
181
198
  }
182
199
  },
@@ -211,10 +228,16 @@ var script = {
211
228
  return null;
212
229
  },
213
230
  datepickerClasses() {
214
- return ['gl-datepicker', 'd-inline-block', 'gl-w-full', `gl-form-input-${this.datepickerSize}`];
215
- },
216
- datepickerSize() {
217
- return datepickerSizeOptionsMap[this.size];
231
+ return ['gl-datepicker', 'd-inline-block', 'gl-w-full', `gl-form-input-${this.computedWidth}`];
232
+ },
233
+ computedWidth() {
234
+ if (this.width) {
235
+ return this.width;
236
+ // eslint-disable-next-line no-else-return
237
+ } else if (this.size) {
238
+ return datepickerSizeOptionsMap[this.size];
239
+ }
240
+ return 'md';
218
241
  }
219
242
  },
220
243
  watch: {
@@ -19,6 +19,23 @@ var script = {
19
19
  /**
20
20
  * Maximum width of the input
21
21
  */
22
+ width: {
23
+ type: [String, Object],
24
+ required: false,
25
+ default: null,
26
+ validator: value => {
27
+ const widths = isObject(value) ? Object.values(value) : [value];
28
+ return widths.every(width => Object.values(formInputSizes).includes(width));
29
+ }
30
+ },
31
+ /**
32
+ * ⚠️ DEPRECATED:
33
+ *
34
+ * Will be replaced by the
35
+ * property width
36
+ *
37
+ * Maximum width of the input
38
+ */
22
39
  size: {
23
40
  type: [String, Object],
24
41
  required: false,
@@ -30,21 +47,24 @@ var script = {
30
47
  }
31
48
  },
32
49
  computed: {
50
+ computedWidth() {
51
+ return this.width ? this.width : this.size;
52
+ },
33
53
  cssClasses() {
34
- if (this.size === null) {
54
+ if (this.computedWidth === null) {
35
55
  return [];
36
56
  }
37
- if (isObject(this.size)) {
57
+ if (isObject(this.computedWidth)) {
38
58
  const {
39
59
  default: defaultSize,
40
60
  ...nonDefaultSizes
41
- } = this.size;
61
+ } = this.computedWidth;
42
62
  return [...(defaultSize ? [`gl-form-input-${defaultSize}`] : []), ...Object.entries(nonDefaultSizes).map(_ref => {
43
63
  let [breakpoint, size] = _ref;
44
64
  return `gl-${breakpoint}-form-input-${size}`;
45
65
  })];
46
66
  }
47
- return [`gl-form-input-${this.size}`];
67
+ return [`gl-form-input-${this.computedWidth}`];
48
68
  },
49
69
  listeners() {
50
70
  var _this = this;
@@ -13,6 +13,23 @@ var script = {
13
13
  /**
14
14
  * Maximum width of the Select
15
15
  */
16
+ width: {
17
+ type: [String, Object],
18
+ required: false,
19
+ default: null,
20
+ validator: value => {
21
+ const widths = isObject(value) ? Object.values(value) : [value];
22
+ return widths.every(width => Object.values(formInputSizes).includes(width));
23
+ }
24
+ },
25
+ /**
26
+ * ⚠️ DEPRECATED:
27
+ *
28
+ * Will be replaced by the
29
+ * property width
30
+ *
31
+ * Maximum width of the Select
32
+ */
16
33
  size: {
17
34
  type: [String, Object],
18
35
  required: false,
@@ -24,21 +41,24 @@ var script = {
24
41
  }
25
42
  },
26
43
  computed: {
44
+ computedWidth() {
45
+ return this.width ? this.width : this.size;
46
+ },
27
47
  cssClasses() {
28
- if (this.size === null) {
48
+ if (this.computedWidth === null) {
29
49
  return [];
30
50
  }
31
- if (isObject(this.size)) {
51
+ if (isObject(this.computedWidth)) {
32
52
  const {
33
53
  default: defaultSize,
34
54
  ...nonDefaultSizes
35
- } = this.size;
55
+ } = this.computedWidth;
36
56
  return [...(defaultSize ? [`gl-form-select-${defaultSize}`] : []), ...Object.entries(nonDefaultSizes).map(_ref => {
37
57
  let [breakpoint, size] = _ref;
38
58
  return `gl-${breakpoint}-form-select-${size}`;
39
59
  })];
40
60
  }
41
- return [`gl-form-select-${this.size}`];
61
+ return [`gl-form-select-${this.computedWidth}`];
42
62
  }
43
63
  }
44
64
  };