@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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gitlab/ui",
3
- "version": "124.4.0",
3
+ "version": "124.4.2",
4
4
  "description": "GitLab UI Components",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",
@@ -120,9 +120,9 @@
120
120
  "@storybook/vue3": "^7.6.20",
121
121
  "@storybook/vue3-webpack5": "^7.6.20",
122
122
  "@types/jest-image-snapshot": "^6.4.0",
123
- "@vue/compat": "^3.5.22",
124
- "@vue/compiler-sfc": "^3.5.22",
125
- "@vue/server-renderer": "^3.5.22",
123
+ "@vue/compat": "^3.5.24",
124
+ "@vue/compiler-sfc": "^3.5.24",
125
+ "@vue/server-renderer": "^3.5.24",
126
126
  "@vue/test-utils": "1.3.6",
127
127
  "@vue/test-utils-vue3": "npm:@vue/test-utils@^2.4.6",
128
128
  "@vue/vue2-jest": "29.2.6",
@@ -137,7 +137,7 @@
137
137
  "cypress-real-events": "^1.15.0",
138
138
  "dompurify": "^3.1.2",
139
139
  "emoji-regex": "^10.6.0",
140
- "esbuild": "^0.25.12",
140
+ "esbuild": "^0.26.0",
141
141
  "gitlab-api-async-iterator": "^1.3.1",
142
142
  "glob": "11.0.3",
143
143
  "globby": "^14.1.0",
@@ -11,16 +11,16 @@ export default {
11
11
  };
12
12
  },
13
13
  props: {
14
- /*
15
- When true, will have the effect of closing other accordion items when one accordion item is visible.
14
+ /**
15
+ * When true, will have the effect of closing other accordion items when one accordion item is visible.
16
16
  */
17
17
  autoCollapse: {
18
18
  type: Boolean,
19
19
  required: false,
20
20
  default: false,
21
21
  },
22
- /*
23
- 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.
22
+ /**
23
+ * 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.
24
24
  */
25
25
  headerLevel: {
26
26
  type: Number,
@@ -48,7 +48,8 @@ $breadcrumb-max-width: $grid-size * 16;
48
48
  }
49
49
  }
50
50
 
51
- .gl-breadcrumb-item:last-child > a {
51
+ .gl-breadcrumb-item:last-child > a,
52
+ .gl-breadcrumb-item:has(+ .gl-breadcrumb-clipboard-button) > a {
52
53
  @apply gl-text-default;
53
54
  @apply gl-font-bold;
54
55
  }
@@ -7,11 +7,17 @@ export default {
7
7
  event: 'input',
8
8
  },
9
9
  props: {
10
+ /**
11
+ * Controls the visibility state of the collapse.
12
+ */
10
13
  visible: {
11
14
  type: Boolean,
12
15
  default: false,
13
16
  required: false,
14
17
  },
18
+ /**
19
+ * HTML tag to use for the collapse container element.
20
+ */
15
21
  tag: {
16
22
  type: String,
17
23
  required: false,
@@ -52,119 +52,188 @@ export default {
52
52
  mixins: [ButtonMixin],
53
53
  inheritAttrs: false,
54
54
  props: {
55
+ /**
56
+ * Text to display in the dropdown header.
57
+ */
55
58
  headerText: {
56
59
  type: String,
57
60
  required: false,
58
61
  default: '',
59
62
  },
63
+ /**
64
+ * When true, hides the border below the dropdown header.
65
+ */
60
66
  hideHeaderBorder: {
61
67
  type: Boolean,
62
68
  required: false,
63
69
  default: true,
64
70
  },
71
+ /**
72
+ * When true, displays a "Clear all" button in the dropdown.
73
+ */
65
74
  showClearAll: {
66
75
  type: Boolean,
67
76
  required: false,
68
77
  default: false,
69
78
  },
79
+ /**
80
+ * Text for the "Clear all" button.
81
+ */
70
82
  clearAllText: {
71
83
  type: String,
72
84
  required: false,
73
85
  default: 'Clear all',
74
86
  },
87
+ /**
88
+ * CSS class(es) to apply to the "Clear all" button text.
89
+ */
75
90
  clearAllTextClass: {
76
91
  type: String,
77
92
  required: false,
78
93
  default: 'gl-px-5',
79
94
  },
95
+ /**
96
+ * Text to display on the dropdown toggle button.
97
+ */
80
98
  text: {
81
99
  type: String,
82
100
  required: false,
83
101
  default: '',
84
102
  },
103
+ /**
104
+ * When true, displays a title above highlighted items.
105
+ */
85
106
  showHighlightedItemsTitle: {
86
107
  type: Boolean,
87
108
  required: false,
88
109
  default: false,
89
110
  },
111
+ /**
112
+ * Title text to display above highlighted items.
113
+ */
90
114
  highlightedItemsTitle: {
91
115
  type: String,
92
116
  required: false,
93
117
  default: 'Selected',
94
118
  },
119
+ /**
120
+ * CSS class(es) to apply to the highlighted items title.
121
+ */
95
122
  highlightedItemsTitleClass: {
96
123
  type: String,
97
124
  required: false,
98
125
  default: 'gl-px-5',
99
126
  },
127
+ /**
128
+ * When true, visually hides the button text but keeps it accessible to screen readers.
129
+ */
100
130
  textSrOnly: {
101
131
  type: Boolean,
102
132
  required: false,
103
133
  default: false,
104
134
  },
135
+ /**
136
+ * When true, renders the dropdown as a split button with separate action and toggle areas.
137
+ */
105
138
  split: {
106
139
  type: Boolean,
107
140
  required: false,
108
141
  default: false,
109
142
  },
143
+ /**
144
+ * Category of the dropdown button.
145
+ */
110
146
  category: {
111
147
  type: String,
112
148
  required: false,
113
149
  default: buttonCategoryOptions.primary,
114
150
  validator: (value) => Object.keys(buttonCategoryOptions).includes(value),
115
151
  },
152
+ /**
153
+ * Visual variant of the dropdown button.
154
+ */
116
155
  variant: {
117
156
  type: String,
118
157
  required: false,
119
158
  default: dropdownVariantOptions.default,
120
159
  validator: (value) => Object.keys(dropdownVariantOptions).includes(value),
121
160
  },
161
+ /**
162
+ * Size of the dropdown button.
163
+ */
122
164
  size: {
123
165
  type: String,
124
166
  required: false,
125
167
  default: 'medium',
126
168
  validator: (value) => Object.keys(buttonSizeOptions).includes(value),
127
169
  },
170
+ /**
171
+ * Icon name to display in the dropdown button.
172
+ */
128
173
  icon: {
129
174
  type: String,
130
175
  required: false,
131
176
  default: null,
132
177
  },
178
+ /**
179
+ * When true, renders the dropdown button at 100% width.
180
+ */
133
181
  block: {
134
182
  type: Boolean,
135
183
  required: false,
136
184
  default: false,
137
185
  },
186
+ /**
187
+ * When true, disables the dropdown button and prevents interaction.
188
+ */
138
189
  disabled: {
139
190
  type: Boolean,
140
191
  required: false,
141
192
  default: false,
142
193
  },
194
+ /**
195
+ * When true, displays a loading indicator in the dropdown button.
196
+ */
143
197
  loading: {
144
198
  type: Boolean,
145
199
  required: false,
146
200
  default: false,
147
201
  },
202
+ /**
203
+ * CSS class(es) to apply to the dropdown toggle button.
204
+ */
148
205
  toggleClass: {
149
206
  type: [String, Array, Object],
150
207
  required: false,
151
208
  default: null,
152
209
  },
210
+ /**
211
+ * When true, aligns the dropdown menu to the right.
212
+ */
153
213
  right: {
154
214
  type: Boolean,
155
215
  required: false,
156
216
  default: false,
157
217
  },
218
+ /**
219
+ * Custom Popper.js options for dropdown positioning.
220
+ */
158
221
  popperOpts: {
159
222
  type: Object,
160
223
  required: false,
161
224
  default: null,
162
225
  },
226
+ /**
227
+ * When true, prevents the dropdown from flipping to fit in the viewport.
228
+ */
163
229
  noFlip: {
164
230
  type: Boolean,
165
231
  required: false,
166
232
  default: false,
167
233
  },
234
+ /**
235
+ * URL for the split button's main action (when split is true).
236
+ */
168
237
  splitHref: {
169
238
  type: String,
170
239
  required: false,
@@ -10,21 +10,33 @@ export default {
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 @@ export default {
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],
@@ -23,11 +23,17 @@ export default {
23
23
  return widths.every((width) => Object.values(formInputWidths).includes(width));
24
24
  },
25
25
  },
26
+ /**
27
+ * Additional CSS class(es) to apply to the select element.
28
+ */
26
29
  selectClass: {
27
30
  type: [String, Object, Array],
28
31
  required: false,
29
32
  default: '',
30
33
  },
34
+ /**
35
+ * Number of visible options in the select dropdown. When greater than 1, displays as a scrollable list box.
36
+ */
31
37
  selectSize: {
32
38
  type: Number,
33
39
  required: false,
@@ -24,11 +24,17 @@ export default {
24
24
  required: false,
25
25
  default: '',
26
26
  },
27
+ /**
28
+ * When true, prevents the textarea from being resized by the user (hides the resize handle).
29
+ */
27
30
  noResize: {
28
31
  type: Boolean,
29
32
  required: false,
30
33
  default: true,
31
34
  },
35
+ /**
36
+ * When true, emits a submit event when Ctrl+Enter or Cmd+Enter is pressed.
37
+ */
32
38
  submitOnEnter: {
33
39
  type: Boolean,
34
40
  required: false,
@@ -43,13 +49,16 @@ export default {
43
49
  default: null,
44
50
  },
45
51
  /**
46
- * Classes for textarea component when `characterCountLimit` is set.
52
+ * Additional CSS class(es) to apply to the textarea element.
47
53
  */
48
54
  textareaClasses: {
49
55
  type: [String, Object, Array],
50
56
  required: false,
51
57
  default: null,
52
58
  },
59
+ /**
60
+ * Number of visible text rows in the textarea.
61
+ */
53
62
  rows: {
54
63
  type: [Number, String],
55
64
  required: false,
@@ -15,13 +15,16 @@ export default {
15
15
  name: 'GlLoadingIcon',
16
16
  props: {
17
17
  /**
18
- * Aria-label.
18
+ * Accessible label for screen readers.
19
19
  */
20
20
  label: {
21
21
  type: String,
22
22
  required: false,
23
23
  default: 'Loading',
24
24
  },
25
+ /**
26
+ * Size of the loading icon. Options: 'sm' (16px), 'md' (24px), 'lg' (32px), 'xl' (64px).
27
+ */
25
28
  size: {
26
29
  type: String,
27
30
  required: false,
@@ -30,6 +33,9 @@ export default {
30
33
  return sizes.indexOf(value) !== -1;
31
34
  },
32
35
  },
36
+ /**
37
+ * Color variant of the loading icon. Options: 'dark', 'light'.
38
+ */
33
39
  color: {
34
40
  type: String,
35
41
  required: false,
@@ -38,6 +44,9 @@ export default {
38
44
  return Object.keys(colors).includes(value);
39
45
  },
40
46
  },
47
+ /**
48
+ * Visual variant of the loading icon. Options: 'spinner', 'dots'.
49
+ */
41
50
  variant: {
42
51
  type: String,
43
52
  required: false,
@@ -47,7 +56,7 @@ export default {
47
56
  },
48
57
  },
49
58
  /**
50
- * Wrap in a span or div.
59
+ * When true, wraps the loading icon in a span instead of a div for inline display.
51
60
  */
52
61
  inline: {
53
62
  type: Boolean,
@@ -29,43 +29,67 @@ export default {
29
29
  event: 'change',
30
30
  },
31
31
  props: {
32
+ /**
33
+ * Unique identifier for the modal. Used to control the modal programmatically.
34
+ */
32
35
  modalId: {
33
36
  type: String,
34
37
  required: true,
35
38
  },
39
+ /**
40
+ * HTML tag to use for the modal title. Options: 'h1', 'h2', 'h3', 'h4', 'h5', 'h6'.
41
+ */
36
42
  titleTag: {
37
43
  type: String,
38
44
  required: false,
39
45
  default: 'h4',
40
46
  },
47
+ /**
48
+ * Title text to display in the modal header.
49
+ */
41
50
  title: {
42
51
  type: String,
43
52
  required: false,
44
53
  default: null,
45
54
  },
55
+ /**
56
+ * Additional CSS class(es) to apply to the modal.
57
+ */
46
58
  modalClass: {
47
59
  type: String,
48
60
  required: false,
49
61
  default: '',
50
62
  },
63
+ /**
64
+ * Configuration object for the primary action button. Should contain 'text' and optionally 'attributes' properties.
65
+ */
51
66
  actionPrimary: {
52
67
  type: Object,
53
68
  required: false,
54
69
  default: null,
55
70
  validator: (obj) => validatorHelper(obj),
56
71
  },
72
+ /**
73
+ * Configuration object for the secondary action button. Should contain 'text' and optionally 'attributes' properties.
74
+ */
57
75
  actionSecondary: {
58
76
  type: Object,
59
77
  required: false,
60
78
  default: null,
61
79
  validator: (obj) => validatorHelper(obj),
62
80
  },
81
+ /**
82
+ * Configuration object for the cancel button. Should contain 'text' and optionally 'attributes' properties.
83
+ */
63
84
  actionCancel: {
64
85
  type: Object,
65
86
  required: false,
66
87
  default: null,
67
88
  validator: (obj) => validatorHelper(obj),
68
89
  },
90
+ /**
91
+ * Size of the modal. Options: 'sm', 'md', 'lg'.
92
+ */
69
93
  size: {
70
94
  type: String,
71
95
  required: false,
@@ -80,16 +104,25 @@ export default {
80
104
  required: false,
81
105
  default: () => translate('GlModal.closeButtonTitle', 'Close'),
82
106
  },
107
+ /**
108
+ * Controls the visibility state of the modal.
109
+ */
83
110
  visible: {
84
111
  type: Boolean,
85
112
  required: false,
86
113
  default: false,
87
114
  },
115
+ /**
116
+ * Accessible label for the modal. Used for the aria-label attribute.
117
+ */
88
118
  ariaLabel: {
89
119
  type: String,
90
120
  required: false,
91
121
  default: '',
92
122
  },
123
+ /**
124
+ * When true, prevents the modal from automatically focusing an element when shown.
125
+ */
93
126
  noFocusOnShow: {
94
127
  type: Boolean,
95
128
  required: false,
@@ -22,6 +22,9 @@ export default {
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,
@@ -20,22 +20,45 @@ export default {
20
20
  },
21
21
  inheritAttrs: false,
22
22
  props: {
23
+ /**
24
+ * Additional CSS class(es) to apply to the table element.
25
+ */
23
26
  tableClass,
27
+ /**
28
+ * Array of items displayed in the table as rows.
29
+ */
30
+ items: {
31
+ type: Array,
32
+ required: false,
33
+ default: () => [],
34
+ },
35
+ /**
36
+ * 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.
37
+ */
24
38
  fields: {
25
39
  type: Array,
26
40
  required: false,
27
41
  default: null,
28
42
  },
43
+ /**
44
+ * When true, makes the table header sticky so it remains visible when scrolling.
45
+ */
29
46
  stickyHeader: {
30
47
  type: Boolean,
31
48
  default: false,
32
49
  required: false,
33
50
  },
51
+ /**
52
+ * The field key to sort by.
53
+ */
34
54
  sortBy: {
35
55
  type: String,
36
56
  required: false,
37
57
  default: undefined,
38
58
  },
59
+ /**
60
+ * When true, sorts in descending order. When false, sorts in ascending order.
61
+ */
39
62
  sortDesc: {
40
63
  type: Boolean,
41
64
  required: false,
@@ -114,6 +137,7 @@ export default {
114
137
  <b-table
115
138
  :table-class="localTableClass"
116
139
  :fields="computedFields"
140
+ :items="items"
117
141
  :sort-by.sync="localSortBy"
118
142
  :sort-desc.sync="localSortDesc"
119
143
  no-sort-reset
@@ -11,6 +11,14 @@ export default {
11
11
  inheritAttrs: false,
12
12
  props: {
13
13
  tableClass,
14
+ /**
15
+ * Array of items displayed in the table as rows.
16
+ */
17
+ items: {
18
+ type: Array,
19
+ required: false,
20
+ default: () => [],
21
+ },
14
22
  fields: {
15
23
  type: Array,
16
24
  required: false,
@@ -34,7 +42,13 @@ export default {
34
42
  </script>
35
43
 
36
44
  <template>
37
- <b-table-lite :table-class="localTableClass" :fields="fields" v-bind="$attrs" v-on="$listeners">
45
+ <b-table-lite
46
+ :table-class="localTableClass"
47
+ :fields="fields"
48
+ :items="items"
49
+ v-bind="$attrs"
50
+ v-on="$listeners"
51
+ >
38
52
  <template v-for="slot in Object.keys($scopedSlots)" #[slot]="scope">
39
53
  <!-- @slot See https://bootstrap-vue.org/docs/components/table#comp-ref-b-table-lite-slots for available slots. -->
40
54
  <slot :name="slot" v-bind="scope"></slot>