@gitlab/ui 128.12.0 → 128.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gitlab/ui",
3
- "version": "128.12.0",
3
+ "version": "128.13.1",
4
4
  "description": "GitLab UI Components",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",
@@ -37,6 +37,7 @@
37
37
  "prebuild": "yarn build-tokens",
38
38
  "copy-fonts": "make copy-fonts",
39
39
  "build-tokens": "make tokens",
40
+ "sync-tokens": "node --env-file=.figma.env bin/figma_sync_tokens.mjs",
40
41
  "clean": "rm -r dist storybook",
41
42
  "cy:edge": "cypress run --browser edge --env grepTags=-@storybook",
42
43
  "cy:run": "cypress run --browser firefox --env grepTags=-@storybook",
@@ -131,7 +132,7 @@
131
132
  "autoprefixer": "10.4.24",
132
133
  "axe-playwright": "^2.2.2",
133
134
  "babel-loader": "^9.2.1",
134
- "cypress": "15.9.0",
135
+ "cypress": "15.10.0",
135
136
  "cypress-real-events": "^1.15.0",
136
137
  "dompurify": "^3.1.2",
137
138
  "emoji-regex": "^10.6.0",
@@ -142,14 +143,14 @@
142
143
  "jest-circus": "30.2.0",
143
144
  "jest-environment-jsdom": "30.2.0",
144
145
  "jest-image-snapshot": "^6.5.1",
145
- "merge-cobertura": "^1.0.4",
146
+ "merge-cobertura": "^1.0.5",
146
147
  "mockdate": "^3.0.5",
147
- "module-alias": "^2.2.3",
148
+ "module-alias": "^2.3.4",
148
149
  "pikaday": "^1.8.0",
149
- "playwright": "^1.58.1",
150
- "playwright-core": "^1.58.1",
150
+ "playwright": "^1.58.2",
151
+ "playwright-core": "^1.58.2",
151
152
  "postcss": "8.5.6",
152
- "postcss-loader": "8.2.0",
153
+ "postcss-loader": "8.2.1",
153
154
  "postcss-scss": "4.0.9",
154
155
  "react": "18.3.1",
155
156
  "react-dom": "18.3.1",
@@ -165,7 +166,7 @@
165
166
  "start-server-and-test": "^2.1.3",
166
167
  "storybook": "^7.6.20",
167
168
  "storybook-dark-mode": "4.0.2",
168
- "style-dictionary": "^5.2.0",
169
+ "style-dictionary": "^5.3.1",
169
170
  "style-loader": "^4",
170
171
  "tailwindcss": "3.4.19",
171
172
  "vue": "2.7.16",
@@ -37,7 +37,7 @@ export default {
37
37
  default: '',
38
38
  },
39
39
  /**
40
- * Layout of label and text: 'horizontal' for inline/flex or 'vertical' for block.
40
+ * Layout of label and text: 'horizontal' for line or 'vertical' for stacked
41
41
  */
42
42
  layout: {
43
43
  type: String,
@@ -1,5 +1,6 @@
1
1
  <script>
2
2
  import uniqueId from 'lodash/uniqueId';
3
+ import isBoolean from 'lodash/isBoolean';
3
4
  import {
4
5
  arrow,
5
6
  computePosition,
@@ -119,6 +120,14 @@ export default {
119
120
  required: false,
120
121
  default: false,
121
122
  },
123
+ /**
124
+ * Controls the validation state appearance of the component. `true` for valid, `false` for invalid, or `null` for no validation state
125
+ */
126
+ state: {
127
+ type: Boolean,
128
+ required: false,
129
+ default: null,
130
+ },
122
131
  placement: {
123
132
  type: String,
124
133
  required: false,
@@ -245,6 +254,15 @@ export default {
245
254
  isCaretOnly() {
246
255
  return !this.noCaret && !this.icon && this.hasNoVisibleToggleText;
247
256
  },
257
+ computedState() {
258
+ // If not a boolean, ensure that value is null
259
+ return isBoolean(this.state) ? this.state : null;
260
+ },
261
+ stateClass() {
262
+ if (this.computedState === true) return 'is-valid';
263
+ if (this.computedState === false) return 'is-invalid';
264
+ return null;
265
+ },
248
266
  isDefaultToggle() {
249
267
  return !this.$scopedSlots.toggle;
250
268
  },
@@ -298,6 +316,7 @@ export default {
298
316
  'gl-new-dropdown-toggle-no-caret': this.noCaret,
299
317
  'gl-new-dropdown-caret-only btn-icon': this.isCaretOnly,
300
318
  },
319
+ this.stateClass,
301
320
  ];
302
321
  },
303
322
  toggleButtonTextClasses() {
@@ -590,7 +609,7 @@ export default {
590
609
  this.$emit(GL_DROPDOWN_SHOWN);
591
610
  } else {
592
611
  this.stopFloating();
593
- this.$emit(GL_DROPDOWN_HIDDEN);
612
+ this.$emit(GL_DROPDOWN_HIDDEN, event);
594
613
  }
595
614
 
596
615
  // this is to check whether `toggle` was prevented or not
@@ -35,6 +35,14 @@
35
35
  width: auto;
36
36
  }
37
37
  }
38
+
39
+ &.is-invalid {
40
+ @apply gl-border-control-error;
41
+
42
+ &:focus {
43
+ @apply gl-border-control-error;
44
+ }
45
+ }
38
46
  }
39
47
 
40
48
  .gl-new-dropdown-button-text {
@@ -166,6 +166,14 @@ export default {
166
166
  required: false,
167
167
  default: false,
168
168
  },
169
+ /**
170
+ * Controls the validation state appearance of the component. `true` for valid, `false` for invalid, or `null` for no validation state
171
+ */
172
+ state: {
173
+ type: Boolean,
174
+ required: false,
175
+ default: null,
176
+ },
169
177
  /**
170
178
  * Set to "true" when dropdown content (items) is loading
171
179
  * It will render a small loader in the dropdown toggle and make it disabled
@@ -687,7 +695,7 @@ export default {
687
695
  */
688
696
  this.$emit(GL_DROPDOWN_SHOWN);
689
697
  },
690
- onHide() {
698
+ onHide(event) {
691
699
  /**
692
700
  * Emitted when dropdown is hidden
693
701
  *
@@ -695,6 +703,8 @@ export default {
695
703
  */
696
704
  this.$emit(GL_DROPDOWN_HIDDEN);
697
705
  this.nextFocusedItemIndex = null;
706
+ // Emit native blur event for form validation in FormGroup
707
+ this.$emit('blur', event);
698
708
  },
699
709
  getNextIndex(currentIndex, keyCode, totalLength) {
700
710
  // For UP: move up or wrap to end
@@ -977,6 +987,7 @@ export default {
977
987
  :has-searchable-listbox="searchable"
978
988
  :has-external-label="isInFormGroup"
979
989
  :listbox-id="listboxIdComputed"
990
+ :state="state"
980
991
  :toggle-id="toggleIdComputed"
981
992
  :toggle-text="listboxToggleText"
982
993
  :toggle-class="toggleButtonClasses"
@@ -3751,7 +3751,7 @@
3751
3751
  },
3752
3752
  "font-size-500": {
3753
3753
  "$value": {
3754
- "value": 18,
3754
+ "value": 20,
3755
3755
  "unit": "px"
3756
3756
  },
3757
3757
  "$type": "dimension",
@@ -3764,7 +3764,7 @@
3764
3764
  },
3765
3765
  "font-size-600": {
3766
3766
  "$value": {
3767
- "value": 21,
3767
+ "value": 25,
3768
3768
  "unit": "px"
3769
3769
  },
3770
3770
  "$type": "dimension",
@@ -3777,7 +3777,7 @@
3777
3777
  },
3778
3778
  "font-size-700": {
3779
3779
  "$value": {
3780
- "value": 24,
3780
+ "value": 30,
3781
3781
  "unit": "px"
3782
3782
  },
3783
3783
  "$type": "dimension",
@@ -3790,7 +3790,7 @@
3790
3790
  },
3791
3791
  "font-size-800": {
3792
3792
  "$value": {
3793
- "value": 28,
3793
+ "value": 36,
3794
3794
  "unit": "px"
3795
3795
  },
3796
3796
  "$type": "dimension",
@@ -3766,7 +3766,7 @@
3766
3766
  },
3767
3767
  "font-size-500": {
3768
3768
  "$value": {
3769
- "value": 18,
3769
+ "value": 20,
3770
3770
  "unit": "px"
3771
3771
  },
3772
3772
  "$type": "dimension",
@@ -3779,7 +3779,7 @@
3779
3779
  },
3780
3780
  "font-size-600": {
3781
3781
  "$value": {
3782
- "value": 21,
3782
+ "value": 25,
3783
3783
  "unit": "px"
3784
3784
  },
3785
3785
  "$type": "dimension",
@@ -3792,7 +3792,7 @@
3792
3792
  },
3793
3793
  "font-size-700": {
3794
3794
  "$value": {
3795
- "value": 24,
3795
+ "value": 30,
3796
3796
  "unit": "px"
3797
3797
  },
3798
3798
  "$type": "dimension",
@@ -3805,7 +3805,7 @@
3805
3805
  },
3806
3806
  "font-size-800": {
3807
3807
  "$value": {
3808
- "value": 28,
3808
+ "value": 36,
3809
3809
  "unit": "px"
3810
3810
  },
3811
3811
  "$type": "dimension",