@gitlab/ui 64.22.0 → 64.24.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": "64.22.0",
3
+ "version": "64.24.0",
4
4
  "description": "GitLab UI Components",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",
@@ -91,7 +91,7 @@
91
91
  "@gitlab/eslint-plugin": "19.0.0",
92
92
  "@gitlab/fonts": "^1.2.0",
93
93
  "@gitlab/stylelint-config": "4.1.0",
94
- "@gitlab/svgs": "3.55.0",
94
+ "@gitlab/svgs": "3.57.0",
95
95
  "@rollup/plugin-commonjs": "^11.1.0",
96
96
  "@rollup/plugin-node-resolve": "^7.1.3",
97
97
  "@rollup/plugin-replace": "^2.3.2",
@@ -118,9 +118,9 @@
118
118
  "babel-loader": "^8.0.5",
119
119
  "babel-plugin-require-context-hook": "^1.0.0",
120
120
  "bootstrap": "4.6.2",
121
- "cypress": "12.17.1",
121
+ "cypress": "12.17.2",
122
122
  "emoji-regex": "^10.0.0",
123
- "eslint": "8.44.0",
123
+ "eslint": "8.45.0",
124
124
  "eslint-import-resolver-jest": "3.0.2",
125
125
  "eslint-plugin-cypress": "2.13.3",
126
126
  "eslint-plugin-storybook": "0.6.12",
@@ -24,5 +24,8 @@ interface FieldDefinition<TValue> {
24
24
 
25
25
  // Properties that are passed to the actual input for this field.
26
26
  inputAttrs?: {};
27
+
28
+ // Properties that are passed to the group wrapping this field.
29
+ groupAttrs?: {};
27
30
  }
28
31
  ```
@@ -24,6 +24,7 @@ const TEST_FIELDS = {
24
24
  (val) => (val % 2 === 1 ? 'Count must be even' : ''),
25
25
  ],
26
26
  inputAttrs: { size: 'xs', type: 'number' },
27
+ groupAttrs: { class: 'unique-class' },
27
28
  },
28
29
  allCaps: {
29
30
  label: 'All caps (optional)',
@@ -68,6 +69,7 @@ describe('GlFormFields', () => {
68
69
  label: formGroup.attributes('label'),
69
70
  state: formGroup.attributes('state'),
70
71
  invalidFeedback: formGroup.attributes('invalid-feedback'),
72
+ class: formGroup.attributes('class'),
71
73
  input: {
72
74
  // Ensure that "value" is present even if undefined
73
75
  value: input.attributes('value'),
@@ -110,6 +112,7 @@ describe('GlFormFields', () => {
110
112
  label: TEST_FIELDS.username.label,
111
113
  state: undefined,
112
114
  invalidFeedback: '',
115
+ class: undefined,
113
116
  input: {
114
117
  id: 'gl-form-field-testunique',
115
118
  value: undefined,
@@ -119,6 +122,7 @@ describe('GlFormFields', () => {
119
122
  label: TEST_FIELDS.evenCount.label,
120
123
  state: undefined,
121
124
  invalidFeedback: '',
125
+ class: TEST_FIELDS.evenCount.groupAttrs.class,
122
126
  input: {
123
127
  id: 'gl-form-field-testunique',
124
128
  value: '0',
@@ -129,6 +133,7 @@ describe('GlFormFields', () => {
129
133
  label: TEST_FIELDS.allCaps.label,
130
134
  state: undefined,
131
135
  invalidFeedback: '',
136
+ class: undefined,
132
137
  input: {
133
138
  id: 'gl-form-field-testunique',
134
139
  value: undefined,
@@ -222,6 +227,7 @@ describe('GlFormFields', () => {
222
227
  label: TEST_FIELDS.username.label,
223
228
  invalidFeedback: 'User name is required',
224
229
  state: undefined,
230
+ class: undefined,
225
231
  input: {
226
232
  value: undefined,
227
233
  id: 'gl-form-field-testunique',
@@ -231,6 +237,7 @@ describe('GlFormFields', () => {
231
237
  label: TEST_FIELDS.evenCount.label,
232
238
  invalidFeedback: 'Count is required',
233
239
  state: undefined,
240
+ class: TEST_FIELDS.evenCount.groupAttrs.class,
234
241
  input: expect.objectContaining({
235
242
  value: '0',
236
243
  id: 'gl-form-field-testunique',
@@ -240,6 +247,7 @@ describe('GlFormFields', () => {
240
247
  label: TEST_FIELDS.allCaps.label,
241
248
  invalidFeedback: '',
242
249
  state: undefined,
250
+ class: undefined,
243
251
  input: {
244
252
  value: undefined,
245
253
  id: 'gl-form-field-testunique',
@@ -274,6 +282,7 @@ describe('GlFormFields', () => {
274
282
  label: TEST_FIELDS.evenCount.label,
275
283
  invalidFeedback: 'Count must be even',
276
284
  state: undefined,
285
+ class: TEST_FIELDS.evenCount.groupAttrs.class,
277
286
  input: {
278
287
  ...TEST_FIELDS.evenCount.inputAttrs,
279
288
  id: 'gl-form-field-testunique',
@@ -24,8 +24,9 @@ const Template = () => ({
24
24
  validators: [required('NAME IS REQUIRED!!!')],
25
25
  },
26
26
  password: {
27
- label: 'Password',
27
+ label: 'Password with group styling',
28
28
  inputAttrs: { type: 'password' },
29
+ groupAttrs: { class: 'gl-bg-purple-50 gl-w-20' },
29
30
  validators: [required('Password is required')],
30
31
  },
31
32
  confirmPassword: {
@@ -25,6 +25,7 @@ export default {
25
25
  * @typedef {object} FieldDefinition
26
26
  * @template TValue=string
27
27
  * @property {string} label - Label text to show for this field.
28
+ * @property {undefined | Object} groupAttrs - Properties that are passed to the group wrapping this field.
28
29
  * @property {undefined | Object} inputAttrs - Properties that are passed to the actual input for this field.
29
30
  * @property {undefined | function(string): TValue} mapValue - Function that maps the inputted string value to the field's actual value (e.g. a Number).
30
31
  * @property {undefined | Array<function(TValue): string | undefined>=} validators - Collection of validator functions.
@@ -188,6 +189,7 @@ export default {
188
189
  <div>
189
190
  <gl-form-group
190
191
  v-for="(field, fieldName) in fieldsToRender"
192
+ v-bind="field.groupAttrs"
191
193
  :key="fieldName"
192
194
  :label="field.label"
193
195
  :label-for="field.id"
@@ -216,6 +216,18 @@ export default {
216
216
  },
217
217
  };
218
218
  },
219
+ toggleListeners() {
220
+ return this.toggleOptions.listeners;
221
+ },
222
+
223
+ toggleAttributes() {
224
+ const { listeners, is, ...attributes } = this.toggleOptions;
225
+
226
+ return attributes;
227
+ },
228
+ toggleComponent() {
229
+ return this.toggleOptions.is;
230
+ },
219
231
  toggleElement() {
220
232
  return this.$refs.toggle.$el || this.$refs.toggle?.firstElementChild;
221
233
  },
@@ -400,12 +412,12 @@ export default {
400
412
  <template>
401
413
  <div v-outside="close" class="gl-new-dropdown" :class="{ 'gl-display-block!': block }">
402
414
  <component
403
- :is="toggleOptions.is"
404
- v-bind="toggleOptions"
415
+ :is="toggleComponent"
416
+ v-bind="toggleAttributes"
405
417
  :id="toggleId"
406
418
  ref="toggle"
407
419
  data-testid="base-dropdown-toggle"
408
- v-on="toggleOptions.listeners"
420
+ v-on="toggleListeners"
409
421
  >
410
422
  <!-- @slot Custom toggle button content -->
411
423
  <slot name="toggle">
@@ -51,13 +51,12 @@
51
51
  .gl-tab-nav-item-active {
52
52
  @include gl-font-weight-bold;
53
53
  @include gl-text-gray-900;
54
- @include gl-inset-border-b-2-theme-accent;
54
+ @include gl-inset-border-b-2-blue-500;
55
55
 
56
56
  &:active,
57
57
  &:focus,
58
58
  &:focus:active {
59
- box-shadow: inset 0 -#{$gl-border-size-2} 0 0 var(--gl-theme-accent, $theme-indigo-500),
60
- $focus-ring;
59
+ box-shadow: inset 0 -#{$gl-border-size-2} 0 0 $blue-500, $focus-ring;
61
60
  @include gl-outline-none;
62
61
  }
63
62
  }
@@ -2048,6 +2048,14 @@
2048
2048
  box-shadow: inset 0 0 0 $gl-border-size-1 $blue-600 !important
2049
2049
  }
2050
2050
 
2051
+ .gl-inset-border-b-2-blue-500 {
2052
+ box-shadow: inset 0 -#{$gl-border-size-2} 0 0 $blue-500
2053
+ }
2054
+
2055
+ .gl-inset-border-b-2-blue-500\! {
2056
+ box-shadow: inset 0 -#{$gl-border-size-2} 0 0 $blue-500 !important
2057
+ }
2058
+
2051
2059
  .gl-inset-border-1-green-500 {
2052
2060
  box-shadow: inset 0 0 0 $gl-border-size-1 $green-500
2053
2061
  }
@@ -85,6 +85,10 @@
85
85
  box-shadow: inset 0 0 0 $gl-border-size-1 $blue-600;
86
86
  }
87
87
 
88
+ @mixin gl-inset-border-b-2-blue-500 {
89
+ box-shadow: inset 0 -#{$gl-border-size-2} 0 0 $blue-500;
90
+ }
91
+
88
92
  @mixin gl-inset-border-1-green-500 {
89
93
  box-shadow: inset 0 0 0 $gl-border-size-1 $green-500;
90
94
  }