@gitlab/ui 124.4.0 → 124.4.2

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 (27) hide show
  1. package/dist/components/base/accordion/accordion.js +4 -4
  2. package/dist/components/base/collapse/collapse.js +6 -0
  3. package/dist/components/base/dropdown/dropdown.js +69 -0
  4. package/dist/components/base/form/form_group/form_group.js +12 -0
  5. package/dist/components/base/form/form_select/form_select.js +7 -1
  6. package/dist/components/base/form/form_textarea/form_textarea.js +10 -1
  7. package/dist/components/base/loading_icon/loading_icon.js +11 -2
  8. package/dist/components/base/modal/modal.js +33 -0
  9. package/dist/components/base/pagination/pagination.js +3 -0
  10. package/dist/components/base/table/table.js +24 -1
  11. package/dist/components/base/table_lite/table_lite.js +9 -1
  12. package/dist/index.css +1 -1
  13. package/dist/index.css.map +1 -1
  14. package/dist/tokens/tailwind/tokens.cjs +547 -110
  15. package/package.json +5 -5
  16. package/src/components/base/accordion/accordion.vue +4 -4
  17. package/src/components/base/breadcrumb/breadcrumb.scss +2 -1
  18. package/src/components/base/collapse/collapse.vue +6 -0
  19. package/src/components/base/dropdown/dropdown.vue +69 -0
  20. package/src/components/base/form/form_group/form_group.vue +12 -0
  21. package/src/components/base/form/form_select/form_select.vue +7 -1
  22. package/src/components/base/form/form_textarea/form_textarea.vue +10 -1
  23. package/src/components/base/loading_icon/loading_icon.vue +11 -2
  24. package/src/components/base/modal/modal.vue +33 -0
  25. package/src/components/base/pagination/pagination.vue +3 -0
  26. package/src/components/base/table/table.vue +24 -0
  27. package/src/components/base/table_lite/table_lite.vue +15 -1
@@ -12,16 +12,16 @@ var script = {
12
12
  };
13
13
  },
14
14
  props: {
15
- /*
16
- When true, will have the effect of closing other accordion items when one accordion item is visible.
15
+ /**
16
+ * When true, will have the effect of closing other accordion items when one accordion item is visible.
17
17
  */
18
18
  autoCollapse: {
19
19
  type: Boolean,
20
20
  required: false,
21
21
  default: false
22
22
  },
23
- /*
24
- The header tag used in the accordion (h1/h2/h3/h4/h5/h6). This overrides the value provided by GlAccordion. For accessibility this should be set to an appropriate value in the context where the accordion is used.
23
+ /**
24
+ * The header tag used in the accordion (h1/h2/h3/h4/h5/h6). This overrides the value provided by GlAccordion. For accessibility this should be set to an appropriate value in the context where the accordion is used.
25
25
  */
26
26
  headerLevel: {
27
27
  type: Number,
@@ -9,11 +9,17 @@ var script = {
9
9
  event: 'input'
10
10
  },
11
11
  props: {
12
+ /**
13
+ * Controls the visibility state of the collapse.
14
+ */
12
15
  visible: {
13
16
  type: Boolean,
14
17
  default: false,
15
18
  required: false
16
19
  },
20
+ /**
21
+ * HTML tag to use for the collapse container element.
22
+ */
17
23
  tag: {
18
24
  type: String,
19
25
  required: false,
@@ -46,119 +46,188 @@ var script = {
46
46
  mixins: [ButtonMixin],
47
47
  inheritAttrs: false,
48
48
  props: {
49
+ /**
50
+ * Text to display in the dropdown header.
51
+ */
49
52
  headerText: {
50
53
  type: String,
51
54
  required: false,
52
55
  default: ''
53
56
  },
57
+ /**
58
+ * When true, hides the border below the dropdown header.
59
+ */
54
60
  hideHeaderBorder: {
55
61
  type: Boolean,
56
62
  required: false,
57
63
  default: true
58
64
  },
65
+ /**
66
+ * When true, displays a "Clear all" button in the dropdown.
67
+ */
59
68
  showClearAll: {
60
69
  type: Boolean,
61
70
  required: false,
62
71
  default: false
63
72
  },
73
+ /**
74
+ * Text for the "Clear all" button.
75
+ */
64
76
  clearAllText: {
65
77
  type: String,
66
78
  required: false,
67
79
  default: 'Clear all'
68
80
  },
81
+ /**
82
+ * CSS class(es) to apply to the "Clear all" button text.
83
+ */
69
84
  clearAllTextClass: {
70
85
  type: String,
71
86
  required: false,
72
87
  default: 'gl-px-5'
73
88
  },
89
+ /**
90
+ * Text to display on the dropdown toggle button.
91
+ */
74
92
  text: {
75
93
  type: String,
76
94
  required: false,
77
95
  default: ''
78
96
  },
97
+ /**
98
+ * When true, displays a title above highlighted items.
99
+ */
79
100
  showHighlightedItemsTitle: {
80
101
  type: Boolean,
81
102
  required: false,
82
103
  default: false
83
104
  },
105
+ /**
106
+ * Title text to display above highlighted items.
107
+ */
84
108
  highlightedItemsTitle: {
85
109
  type: String,
86
110
  required: false,
87
111
  default: 'Selected'
88
112
  },
113
+ /**
114
+ * CSS class(es) to apply to the highlighted items title.
115
+ */
89
116
  highlightedItemsTitleClass: {
90
117
  type: String,
91
118
  required: false,
92
119
  default: 'gl-px-5'
93
120
  },
121
+ /**
122
+ * When true, visually hides the button text but keeps it accessible to screen readers.
123
+ */
94
124
  textSrOnly: {
95
125
  type: Boolean,
96
126
  required: false,
97
127
  default: false
98
128
  },
129
+ /**
130
+ * When true, renders the dropdown as a split button with separate action and toggle areas.
131
+ */
99
132
  split: {
100
133
  type: Boolean,
101
134
  required: false,
102
135
  default: false
103
136
  },
137
+ /**
138
+ * Category of the dropdown button.
139
+ */
104
140
  category: {
105
141
  type: String,
106
142
  required: false,
107
143
  default: buttonCategoryOptions.primary,
108
144
  validator: value => Object.keys(buttonCategoryOptions).includes(value)
109
145
  },
146
+ /**
147
+ * Visual variant of the dropdown button.
148
+ */
110
149
  variant: {
111
150
  type: String,
112
151
  required: false,
113
152
  default: dropdownVariantOptions.default,
114
153
  validator: value => Object.keys(dropdownVariantOptions).includes(value)
115
154
  },
155
+ /**
156
+ * Size of the dropdown button.
157
+ */
116
158
  size: {
117
159
  type: String,
118
160
  required: false,
119
161
  default: 'medium',
120
162
  validator: value => Object.keys(buttonSizeOptions).includes(value)
121
163
  },
164
+ /**
165
+ * Icon name to display in the dropdown button.
166
+ */
122
167
  icon: {
123
168
  type: String,
124
169
  required: false,
125
170
  default: null
126
171
  },
172
+ /**
173
+ * When true, renders the dropdown button at 100% width.
174
+ */
127
175
  block: {
128
176
  type: Boolean,
129
177
  required: false,
130
178
  default: false
131
179
  },
180
+ /**
181
+ * When true, disables the dropdown button and prevents interaction.
182
+ */
132
183
  disabled: {
133
184
  type: Boolean,
134
185
  required: false,
135
186
  default: false
136
187
  },
188
+ /**
189
+ * When true, displays a loading indicator in the dropdown button.
190
+ */
137
191
  loading: {
138
192
  type: Boolean,
139
193
  required: false,
140
194
  default: false
141
195
  },
196
+ /**
197
+ * CSS class(es) to apply to the dropdown toggle button.
198
+ */
142
199
  toggleClass: {
143
200
  type: [String, Array, Object],
144
201
  required: false,
145
202
  default: null
146
203
  },
204
+ /**
205
+ * When true, aligns the dropdown menu to the right.
206
+ */
147
207
  right: {
148
208
  type: Boolean,
149
209
  required: false,
150
210
  default: false
151
211
  },
212
+ /**
213
+ * Custom Popper.js options for dropdown positioning.
214
+ */
152
215
  popperOpts: {
153
216
  type: Object,
154
217
  required: false,
155
218
  default: null
156
219
  },
220
+ /**
221
+ * When true, prevents the dropdown from flipping to fit in the viewport.
222
+ */
157
223
  noFlip: {
158
224
  type: Boolean,
159
225
  required: false,
160
226
  default: false
161
227
  },
228
+ /**
229
+ * URL for the split button's main action (when split is true).
230
+ */
162
231
  splitHref: {
163
232
  type: String,
164
233
  required: false,
@@ -10,21 +10,33 @@ var script = {
10
10
  },
11
11
  inheritAttrs: false,
12
12
  props: {
13
+ /**
14
+ * Additional CSS class(es) to apply to the label element.
15
+ */
13
16
  labelClass: {
14
17
  type: [String, Array, Object],
15
18
  required: false,
16
19
  default: null
17
20
  },
21
+ /**
22
+ * Descriptive text to display below the label.
23
+ */
18
24
  labelDescription: {
19
25
  type: String,
20
26
  required: false,
21
27
  default: ''
22
28
  },
29
+ /**
30
+ * When true, displays optional text next to the label.
31
+ */
23
32
  optional: {
24
33
  type: Boolean,
25
34
  required: false,
26
35
  default: false
27
36
  },
37
+ /**
38
+ * Text to display when the field is optional.
39
+ */
28
40
  optionalText: {
29
41
  type: String,
30
42
  required: false,
@@ -11,7 +11,7 @@ var script = {
11
11
  inheritAttrs: false,
12
12
  props: {
13
13
  /**
14
- * Maximum width of the Select
14
+ * Width of the select element.
15
15
  */
16
16
  width: {
17
17
  type: [String, Object],
@@ -22,11 +22,17 @@ var script = {
22
22
  return widths.every(width => Object.values(formInputWidths).includes(width));
23
23
  }
24
24
  },
25
+ /**
26
+ * Additional CSS class(es) to apply to the select element.
27
+ */
25
28
  selectClass: {
26
29
  type: [String, Object, Array],
27
30
  required: false,
28
31
  default: ''
29
32
  },
33
+ /**
34
+ * Number of visible options in the select dropdown. When greater than 1, displays as a scrollable list box.
35
+ */
30
36
  selectSize: {
31
37
  type: Number,
32
38
  required: false,
@@ -23,11 +23,17 @@ var script = {
23
23
  required: false,
24
24
  default: ''
25
25
  },
26
+ /**
27
+ * When true, prevents the textarea from being resized by the user (hides the resize handle).
28
+ */
26
29
  noResize: {
27
30
  type: Boolean,
28
31
  required: false,
29
32
  default: true
30
33
  },
34
+ /**
35
+ * When true, emits a submit event when Ctrl+Enter or Cmd+Enter is pressed.
36
+ */
31
37
  submitOnEnter: {
32
38
  type: Boolean,
33
39
  required: false,
@@ -42,13 +48,16 @@ var script = {
42
48
  default: null
43
49
  },
44
50
  /**
45
- * Classes for textarea component when `characterCountLimit` is set.
51
+ * Additional CSS class(es) to apply to the textarea element.
46
52
  */
47
53
  textareaClasses: {
48
54
  type: [String, Object, Array],
49
55
  required: false,
50
56
  default: null
51
57
  },
58
+ /**
59
+ * Number of visible text rows in the textarea.
60
+ */
52
61
  rows: {
53
62
  type: [Number, String],
54
63
  required: false,
@@ -17,13 +17,16 @@ var script = {
17
17
  name: 'GlLoadingIcon',
18
18
  props: {
19
19
  /**
20
- * Aria-label.
20
+ * Accessible label for screen readers.
21
21
  */
22
22
  label: {
23
23
  type: String,
24
24
  required: false,
25
25
  default: 'Loading'
26
26
  },
27
+ /**
28
+ * Size of the loading icon. Options: 'sm' (16px), 'md' (24px), 'lg' (32px), 'xl' (64px).
29
+ */
27
30
  size: {
28
31
  type: String,
29
32
  required: false,
@@ -32,6 +35,9 @@ var script = {
32
35
  return sizes.indexOf(value) !== -1;
33
36
  }
34
37
  },
38
+ /**
39
+ * Color variant of the loading icon. Options: 'dark', 'light'.
40
+ */
35
41
  color: {
36
42
  type: String,
37
43
  required: false,
@@ -40,6 +46,9 @@ var script = {
40
46
  return Object.keys(colors).includes(value);
41
47
  }
42
48
  },
49
+ /**
50
+ * Visual variant of the loading icon. Options: 'spinner', 'dots'.
51
+ */
43
52
  variant: {
44
53
  type: String,
45
54
  required: false,
@@ -49,7 +58,7 @@ var script = {
49
58
  }
50
59
  },
51
60
  /**
52
- * Wrap in a span or div.
61
+ * When true, wraps the loading icon in a span instead of a div for inline display.
53
62
  */
54
63
  inline: {
55
64
  type: Boolean,
@@ -24,43 +24,67 @@ var script = {
24
24
  event: 'change'
25
25
  },
26
26
  props: {
27
+ /**
28
+ * Unique identifier for the modal. Used to control the modal programmatically.
29
+ */
27
30
  modalId: {
28
31
  type: String,
29
32
  required: true
30
33
  },
34
+ /**
35
+ * HTML tag to use for the modal title. Options: 'h1', 'h2', 'h3', 'h4', 'h5', 'h6'.
36
+ */
31
37
  titleTag: {
32
38
  type: String,
33
39
  required: false,
34
40
  default: 'h4'
35
41
  },
42
+ /**
43
+ * Title text to display in the modal header.
44
+ */
36
45
  title: {
37
46
  type: String,
38
47
  required: false,
39
48
  default: null
40
49
  },
50
+ /**
51
+ * Additional CSS class(es) to apply to the modal.
52
+ */
41
53
  modalClass: {
42
54
  type: String,
43
55
  required: false,
44
56
  default: ''
45
57
  },
58
+ /**
59
+ * Configuration object for the primary action button. Should contain 'text' and optionally 'attributes' properties.
60
+ */
46
61
  actionPrimary: {
47
62
  type: Object,
48
63
  required: false,
49
64
  default: null,
50
65
  validator: obj => validatorHelper(obj)
51
66
  },
67
+ /**
68
+ * Configuration object for the secondary action button. Should contain 'text' and optionally 'attributes' properties.
69
+ */
52
70
  actionSecondary: {
53
71
  type: Object,
54
72
  required: false,
55
73
  default: null,
56
74
  validator: obj => validatorHelper(obj)
57
75
  },
76
+ /**
77
+ * Configuration object for the cancel button. Should contain 'text' and optionally 'attributes' properties.
78
+ */
58
79
  actionCancel: {
59
80
  type: Object,
60
81
  required: false,
61
82
  default: null,
62
83
  validator: obj => validatorHelper(obj)
63
84
  },
85
+ /**
86
+ * Size of the modal. Options: 'sm', 'md', 'lg'.
87
+ */
64
88
  size: {
65
89
  type: String,
66
90
  required: false,
@@ -75,16 +99,25 @@ var script = {
75
99
  required: false,
76
100
  default: () => translate('GlModal.closeButtonTitle', 'Close')
77
101
  },
102
+ /**
103
+ * Controls the visibility state of the modal.
104
+ */
78
105
  visible: {
79
106
  type: Boolean,
80
107
  required: false,
81
108
  default: false
82
109
  },
110
+ /**
111
+ * Accessible label for the modal. Used for the aria-label attribute.
112
+ */
83
113
  ariaLabel: {
84
114
  type: String,
85
115
  required: false,
86
116
  default: ''
87
117
  },
118
+ /**
119
+ * When true, prevents the modal from automatically focusing an element when shown.
120
+ */
88
121
  noFocusOnShow: {
89
122
  type: Boolean,
90
123
  required: false,
@@ -22,6 +22,9 @@ var script = {
22
22
  event: 'input'
23
23
  },
24
24
  props: {
25
+ /**
26
+ * The current page number. Must be greater than 0.
27
+ */
25
28
  value: {
26
29
  type: Number,
27
30
  required: false,
@@ -22,22 +22,45 @@ var script = {
22
22
  },
23
23
  inheritAttrs: false,
24
24
  props: {
25
+ /**
26
+ * Additional CSS class(es) to apply to the table element.
27
+ */
25
28
  tableClass,
29
+ /**
30
+ * Array of items displayed in the table as rows.
31
+ */
32
+ items: {
33
+ type: Array,
34
+ required: false,
35
+ default: () => []
36
+ },
37
+ /**
38
+ * Array of field definitions for table columns. Each field can be a string (column key) or an object with properties like 'key', 'label', 'sortable', 'thClass', etc.
39
+ */
26
40
  fields: {
27
41
  type: Array,
28
42
  required: false,
29
43
  default: null
30
44
  },
45
+ /**
46
+ * When true, makes the table header sticky so it remains visible when scrolling.
47
+ */
31
48
  stickyHeader: {
32
49
  type: Boolean,
33
50
  default: false,
34
51
  required: false
35
52
  },
53
+ /**
54
+ * The field key to sort by.
55
+ */
36
56
  sortBy: {
37
57
  type: String,
38
58
  required: false,
39
59
  default: undefined
40
60
  },
61
+ /**
62
+ * When true, sorts in descending order. When false, sorts in ascending order.
63
+ */
41
64
  sortDesc: {
42
65
  type: Boolean,
43
66
  required: false,
@@ -126,7 +149,7 @@ var script = {
126
149
  const __vue_script__ = script;
127
150
 
128
151
  /* template */
129
- var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('b-table',_vm._g(_vm._b({attrs:{"table-class":_vm.localTableClass,"fields":_vm.computedFields,"sort-by":_vm.localSortBy,"sort-desc":_vm.localSortDesc,"no-sort-reset":""},on:{"update:sortBy":function($event){_vm.localSortBy=$event;},"update:sort-by":function($event){_vm.localSortBy=$event;},"update:sortDesc":function($event){_vm.localSortDesc=$event;},"update:sort-desc":function($event){_vm.localSortDesc=$event;}},scopedSlots:_vm._u([_vm._l((Object.keys(_vm.$scopedSlots)),function(slotName){return {key:slotName,fn:function(scope){return [_vm._t(slotName,null,null,scope)]}}}),_vm._l((_vm.headSlots),function(headSlotName){return {key:headSlotName,fn:function(scope){return [_c('div',{key:headSlotName,staticClass:"gl-flex"},[_vm._t(headSlotName,function(){return [_c('span',[_vm._v(_vm._s(scope.label))])]},null,scope),(_vm.isSortable(scope))?[_c('div',{staticClass:"gl-table-th-sort-icon-wrapper gl-flex gl-w-5 gl-justify-center"},[_c('span',{class:{ 'gl-hidden': !_vm.activeSortingColumn(scope) },attrs:{"name":"sort-icon","data-testid":"sort-icon"}},[_vm._v("\n "+_vm._s(_vm.getSortingIcon(scope))+"\n ")])])]:_vm._e()],2)]}}}),{key:"empty",fn:function(scope){return [_vm._t("empty",function(){return [_c('p',{staticClass:"gl-mb-0 gl-py-2 gl-text-subtle"},[_vm._v(_vm._s(scope.emptyText))])]},null,scope)]}}],null,true)},'b-table',_vm.$attrs,false),_vm.$listeners))};
152
+ var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('b-table',_vm._g(_vm._b({attrs:{"table-class":_vm.localTableClass,"fields":_vm.computedFields,"items":_vm.items,"sort-by":_vm.localSortBy,"sort-desc":_vm.localSortDesc,"no-sort-reset":""},on:{"update:sortBy":function($event){_vm.localSortBy=$event;},"update:sort-by":function($event){_vm.localSortBy=$event;},"update:sortDesc":function($event){_vm.localSortDesc=$event;},"update:sort-desc":function($event){_vm.localSortDesc=$event;}},scopedSlots:_vm._u([_vm._l((Object.keys(_vm.$scopedSlots)),function(slotName){return {key:slotName,fn:function(scope){return [_vm._t(slotName,null,null,scope)]}}}),_vm._l((_vm.headSlots),function(headSlotName){return {key:headSlotName,fn:function(scope){return [_c('div',{key:headSlotName,staticClass:"gl-flex"},[_vm._t(headSlotName,function(){return [_c('span',[_vm._v(_vm._s(scope.label))])]},null,scope),(_vm.isSortable(scope))?[_c('div',{staticClass:"gl-table-th-sort-icon-wrapper gl-flex gl-w-5 gl-justify-center"},[_c('span',{class:{ 'gl-hidden': !_vm.activeSortingColumn(scope) },attrs:{"name":"sort-icon","data-testid":"sort-icon"}},[_vm._v("\n "+_vm._s(_vm.getSortingIcon(scope))+"\n ")])])]:_vm._e()],2)]}}}),{key:"empty",fn:function(scope){return [_vm._t("empty",function(){return [_c('p',{staticClass:"gl-mb-0 gl-py-2 gl-text-subtle"},[_vm._v(_vm._s(scope.emptyText))])]},null,scope)]}}],null,true)},'b-table',_vm.$attrs,false),_vm.$listeners))};
130
153
  var __vue_staticRenderFns__ = [];
131
154
 
132
155
  /* style */
@@ -12,6 +12,14 @@ var script = {
12
12
  inheritAttrs: false,
13
13
  props: {
14
14
  tableClass,
15
+ /**
16
+ * Array of items displayed in the table as rows.
17
+ */
18
+ items: {
19
+ type: Array,
20
+ required: false,
21
+ default: () => []
22
+ },
15
23
  fields: {
16
24
  type: Array,
17
25
  required: false,
@@ -37,7 +45,7 @@ var script = {
37
45
  const __vue_script__ = script;
38
46
 
39
47
  /* template */
40
- var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('b-table-lite',_vm._g(_vm._b({attrs:{"table-class":_vm.localTableClass,"fields":_vm.fields},scopedSlots:_vm._u([_vm._l((Object.keys(_vm.$scopedSlots)),function(slot){return {key:slot,fn:function(scope){return [_vm._t(slot,null,null,scope)]}}})],null,true)},'b-table-lite',_vm.$attrs,false),_vm.$listeners))};
48
+ var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('b-table-lite',_vm._g(_vm._b({attrs:{"table-class":_vm.localTableClass,"fields":_vm.fields,"items":_vm.items},scopedSlots:_vm._u([_vm._l((Object.keys(_vm.$scopedSlots)),function(slot){return {key:slot,fn:function(scope){return [_vm._t(slot,null,null,scope)]}}})],null,true)},'b-table-lite',_vm.$attrs,false),_vm.$listeners))};
41
49
  var __vue_staticRenderFns__ = [];
42
50
 
43
51
  /* style */