@gitlab/ui 97.0.0 → 97.1.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.
Files changed (34) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/dist/components/base/toggle/toggle.js +1 -1
  3. package/dist/components/base/token_selector/token_selector.js +17 -7
  4. package/dist/index.css +2 -2
  5. package/dist/index.css.map +1 -1
  6. package/dist/tailwind.css +1 -1
  7. package/dist/tailwind.css.map +1 -1
  8. package/dist/tokens/build/js/tokens.dark.js +2 -1
  9. package/dist/tokens/build/js/tokens.js +2 -1
  10. package/dist/tokens/css/tokens.css +1 -0
  11. package/dist/tokens/css/tokens.dark.css +1 -0
  12. package/dist/tokens/js/tokens.dark.js +1 -0
  13. package/dist/tokens/js/tokens.js +1 -0
  14. package/dist/tokens/json/tokens.dark.json +35 -0
  15. package/dist/tokens/json/tokens.json +35 -0
  16. package/dist/tokens/scss/_tokens.dark.scss +1 -0
  17. package/dist/tokens/scss/_tokens.scss +1 -0
  18. package/dist/tokens/scss/_tokens_custom_properties.scss +1 -0
  19. package/package.json +1 -1
  20. package/src/components/base/form/form_input/form_input.scss +1 -2
  21. package/src/components/base/toggle/toggle.scss +28 -7
  22. package/src/components/base/toggle/toggle.vue +1 -0
  23. package/src/components/base/token_selector/token_selector.scss +8 -3
  24. package/src/components/base/token_selector/token_selector.vue +17 -9
  25. package/src/tokens/build/css/tokens.css +1 -0
  26. package/src/tokens/build/css/tokens.dark.css +1 -0
  27. package/src/tokens/build/js/tokens.dark.js +1 -0
  28. package/src/tokens/build/js/tokens.js +1 -0
  29. package/src/tokens/build/json/tokens.dark.json +35 -0
  30. package/src/tokens/build/json/tokens.json +35 -0
  31. package/src/tokens/build/scss/_tokens.dark.scss +1 -0
  32. package/src/tokens/build/scss/_tokens.scss +1 -0
  33. package/src/tokens/build/scss/_tokens_custom_properties.scss +1 -0
  34. package/src/tokens/contextual/token-selector.tokens.json +20 -0
@@ -691,6 +691,7 @@ $gl-toggle-switch-icon-color-checked-hover: var(--gl-toggle-switch-icon-color-ch
691
691
  $gl-toggle-switch-icon-color-checked-focus: var(--gl-toggle-switch-icon-color-checked-focus);
692
692
  $gl-toggle-switch-icon-color-checked-active: var(--gl-toggle-switch-icon-color-checked-active);
693
693
  $gl-toggle-switch-icon-color-disabled: var(--gl-toggle-switch-icon-color-disabled);
694
+ $gl-token-selector-token-container-token-background-color-focus: var(--gl-token-selector-token-container-token-background-color-focus);
694
695
  $gl-token-foreground-color: var(--gl-token-foreground-color);
695
696
  $gl-token-background-color: var(--gl-token-background-color);
696
697
  $gl-control-background-color-default: var(--gl-control-background-color-default);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gitlab/ui",
3
- "version": "97.0.0",
3
+ "version": "97.1.0",
4
4
  "description": "GitLab UI Components",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",
@@ -21,8 +21,7 @@
21
21
  box-shadow: inset 0 0 0 $gl-border-size-1 var(--gl-control-border-color-hover);
22
22
  }
23
23
 
24
- &:read-only,
25
- &:not(:disabled):not(.form-control-plaintext):not([type='color']):read-only {
24
+ &:not(.gl-form-input-not-readonly):not(:disabled):not(.form-control-plaintext):not([type='color']):read-only {
26
25
  background: var(--gl-control-background-color-readonly);
27
26
  box-shadow: none;
28
27
  }
@@ -70,12 +70,16 @@ $toggle-height: 2.5 * $grid-size;
70
70
  position: relative;
71
71
  width: $toggle-width;
72
72
  height: $toggle-height;
73
- @apply gl-outline-none;
74
73
  user-select: none;
74
+ box-shadow: inset 0 0 0 $gl-border-size-1 var(--gl-action-strong-neutral-border-color-default);
75
75
  @apply gl-rounded-pill;
76
76
  @apply gl-duration-slow;
77
77
  @apply gl-leading-normal;
78
78
 
79
+ @media (forced-colors: active) {
80
+ border: 1px solid;
81
+ }
82
+
79
83
  &::selection,
80
84
  &::before::selection,
81
85
  &::after::selection {
@@ -85,22 +89,22 @@ $toggle-height: 2.5 * $grid-size;
85
89
  &:hover {
86
90
  color: var(--gl-toggle-switch-icon-color-unchecked-hover);
87
91
  background-color: var(--gl-action-strong-neutral-background-color-hover);
92
+ box-shadow: inset 0 0 0 $gl-border-size-1 var(--gl-action-strong-neutral-border-color-hover);
88
93
  }
89
94
 
90
95
  &:focus {
91
96
  color: var(--gl-toggle-switch-icon-color-unchecked-focus);
92
97
  background-color: var(--gl-action-strong-neutral-background-color-focus);
98
+ @include gl-focus($color: var(--gl-action-strong-neutral-border-color-focus), $important: true);
93
99
  }
94
100
 
95
101
  &:active {
96
102
  color: var(--gl-toggle-switch-icon-color-unchecked-active);
97
103
  background-color: var(--gl-action-strong-neutral-background-color-active);
98
- }
99
-
100
- &:active,
101
- &:focus,
102
- &:focus:active {
103
- @apply gl-focus;
104
+ @include gl-focus(
105
+ $color: var(--gl-action-strong-neutral-border-color-active),
106
+ $important: true
107
+ );
104
108
  }
105
109
 
106
110
  .toggle-loading {
@@ -141,20 +145,30 @@ $toggle-height: 2.5 * $grid-size;
141
145
  &.is-checked {
142
146
  color: var(--gl-toggle-switch-icon-color-checked-default);
143
147
  background-color: var(--gl-action-strong-confirm-background-color-default);
148
+ box-shadow: inset 0 0 0 $gl-border-size-1 var(--gl-action-strong-confirm-border-color-default);
144
149
 
145
150
  &:hover {
146
151
  color: var(--gl-toggle-switch-icon-color-checked-hover);
147
152
  background-color: var(--gl-action-strong-confirm-background-color-hover);
153
+ box-shadow: inset 0 0 0 $gl-border-size-1 var(--gl-action-strong-confirm-border-color-hover);
148
154
  }
149
155
 
150
156
  &:focus {
151
157
  color: var(--gl-toggle-switch-icon-color-checked-focus);
152
158
  background-color: var(--gl-action-strong-confirm-background-color-focus);
159
+ @include gl-focus(
160
+ $color: var(--gl-action-strong-confirm-border-color-focus),
161
+ $important: true
162
+ );
153
163
  }
154
164
 
155
165
  &:active {
156
166
  color: var(--gl-toggle-switch-icon-color-checked-active);
157
167
  background-color: var(--gl-action-strong-confirm-background-color-active);
168
+ @include gl-focus(
169
+ $color: var(--gl-action-strong-confirm-border-color-active),
170
+ $important: true
171
+ );
158
172
  }
159
173
 
160
174
  .toggle-icon {
@@ -168,10 +182,17 @@ $toggle-height: 2.5 * $grid-size;
168
182
  @apply gl-cursor-not-allowed;
169
183
  color: var(--gl-action-disabled-background-color);
170
184
  background-color: var(--gl-action-disabled-background-color);
185
+ box-shadow: inset 0 0 0 $gl-border-size-1 var(--gl-action-disabled-border-color);
171
186
 
172
187
  .toggle-icon {
173
188
  color: var(--gl-action-disabled-background-color);
174
189
  background-color: var(--gl-action-disabled-foreground-color);
175
190
  }
191
+
192
+ &:active,
193
+ &:focus,
194
+ &:focus:active {
195
+ @include gl-focus($color: var(--gl-action-disabled-border-color), $important: true);
196
+ }
176
197
  }
177
198
  }
@@ -179,6 +179,7 @@ export default {
179
179
  }"
180
180
  class="gl-toggle gl-shrink-0"
181
181
  type="button"
182
+ :disabled="disabled"
182
183
  @click.prevent="toggleFeature"
183
184
  >
184
185
  <gl-loading-icon v-if="isLoading" color="dark" class="toggle-loading" />
@@ -1,16 +1,21 @@
1
1
  // This is overridden in the `gitlab-org/gitlab` codebase so we need to increase specificity using `gl-token-selector`
2
2
  .gl-token-selector {
3
3
  &.gl-token-selector-focus-glow {
4
- @include gl-focus($color: $gray-900, $important: true);
4
+ @include gl-focus($color: var(--gl-control-border-color-focus), $important: true);
5
5
 
6
6
  &.is-invalid {
7
- @include gl-focus($color: $red-500, $important: true);
7
+ @include gl-focus($color: var(--gl-control-border-color-error), $important: true);
8
8
  }
9
9
  }
10
+
11
+ &.gl-token-selector-view-only {
12
+ background: var(--gl-control-background-color-readonly) !important;
13
+ box-shadow: none !important;
14
+ }
10
15
  }
11
16
 
12
17
  .gl-token-selector-token-container:focus .gl-token {
13
- @apply gl-bg-gray-300;
18
+ background-color: var(--gl-token-selector-token-container-token-background-color-focus);
14
19
  }
15
20
 
16
21
  .gl-token-selector-input {
@@ -187,13 +187,14 @@ export default {
187
187
  return false;
188
188
  },
189
189
  stateClass() {
190
- if (this.state === null) {
191
- return '!gl-shadow-inner-1-gray-400';
190
+ switch (this.state) {
191
+ case true:
192
+ return 'is-valid';
193
+ case false:
194
+ return 'is-invalid';
195
+ default:
196
+ return '';
192
197
  }
193
-
194
- return this.state
195
- ? 'is-valid !gl-shadow-inner-1-gray-400'
196
- : 'is-invalid !gl-shadow-inner-1-red-500';
197
198
  },
198
199
  hasSelectedTokens() {
199
200
  return this.selectedTokens.length > 0;
@@ -387,8 +388,15 @@ export default {
387
388
  <div>
388
389
  <div
389
390
  ref="container"
390
- class="gl-token-selector gl-form-input form-control form-control-plaintext gl-flex !gl-cursor-text gl-items-center !gl-px-3 !gl-py-2"
391
- :class="[inputFocused ? 'gl-token-selector-focus-glow' : '', containerClass, stateClass]"
391
+ class="gl-token-selector gl-form-input gl-form-input-not-readonly form-control gl-flex !gl-cursor-text gl-items-center !gl-px-3 !gl-py-2"
392
+ :class="[
393
+ {
394
+ 'gl-token-selector-focus-glow': inputFocused,
395
+ 'gl-token-selector-view-only': viewOnly,
396
+ },
397
+ containerClass,
398
+ stateClass,
399
+ ]"
392
400
  @click="handleContainerClick"
393
401
  >
394
402
  <!-- @slot Optional content to display a placeholder when tokens list is empty
@@ -417,7 +425,7 @@ export default {
417
425
  <input
418
426
  ref="textInput"
419
427
  type="text"
420
- class="gl-token-selector-input gl-h-auto gl-w-4/10 gl-grow gl-border-none gl-bg-transparent gl-px-1 gl-font-regular gl-text-base gl-leading-normal gl-text-gray-900 gl-outline-none"
428
+ class="gl-token-selector-input gl-h-auto gl-w-4/10 gl-grow gl-border-none gl-bg-transparent gl-px-1 gl-font-regular gl-text-base gl-leading-normal gl-text-default gl-outline-none"
421
429
  :value="inputText"
422
430
  :autocomplete="autocomplete"
423
431
  :aria-labelledby="ariaLabelledby"
@@ -498,6 +498,7 @@
498
498
  --gl-control-background-color-disabled: var(--gl-color-neutral-10); /* Used for disabled form control (checkbox, input, radio button, textarea) background. */
499
499
  --gl-control-background-color-default: var(--gl-color-neutral-0); /* Used for form control (input, radio button, checkbox, textarea) default background. */
500
500
  --gl-token-background-color: var(--gl-color-neutral-100); /* Used for the token background color. */
501
+ --gl-token-selector-token-container-token-background-color-focus: var(--gl-color-neutral-300); /* Used for the background color of a token in a token-selector when it's token-container is in the focus state. */
501
502
  --gl-tab-selected-indicator-color-default: var(--gl-color-blue-500); /* Used for the selected indicator of a tab. */
502
503
  --gl-spinner-segment-color-light: var(--gl-color-neutral-200); /* Used for the animated segment of a loading spinner on a dark background. */
503
504
  --gl-spinner-segment-color-default: var(--gl-color-neutral-700); /* Used for the animated segment of a loading spinner. */
@@ -498,6 +498,7 @@
498
498
  --gl-control-background-color-disabled: var(--gl-color-alpha-light-4); /* Used for disabled form control (checkbox, input, radio button, textarea) background. */
499
499
  --gl-control-background-color-default: var(--gl-color-alpha-dark-40); /* Used for form control (input, radio button, checkbox, textarea) default background. */
500
500
  --gl-token-background-color: var(--gl-color-neutral-800); /* Used for the token background color. */
501
+ --gl-token-selector-token-container-token-background-color-focus: var(--gl-color-neutral-600); /* Used for the background color of a token in a token-selector when it's token-container is in the focus state. */
501
502
  --gl-tab-selected-indicator-color-default: var(--gl-color-blue-400); /* Used for the selected indicator of a tab. */
502
503
  --gl-spinner-segment-color-light: var(--gl-color-neutral-200); /* Used for the animated segment of a loading spinner on a dark background. */
503
504
  --gl-spinner-segment-color-default: var(--gl-color-neutral-200); /* Used for the animated segment of a loading spinner. */
@@ -691,6 +691,7 @@ export const GL_TOGGLE_SWITCH_ICON_COLOR_CHECKED_HOVER = '#63a6e9'; // Used for
691
691
  export const GL_TOGGLE_SWITCH_ICON_COLOR_CHECKED_FOCUS = '#63a6e9'; // Used for the icon color of a checked toggle switch in the focus state.
692
692
  export const GL_TOGGLE_SWITCH_ICON_COLOR_CHECKED_ACTIVE = '#9dc7f1'; // Used for the icon color of a checked toggle switch in the active state.
693
693
  export const GL_TOGGLE_SWITCH_ICON_COLOR_DISABLED = '#28272d'; // Used for the icon color of a disabled toggle switch.
694
+ export const GL_TOKEN_SELECTOR_TOKEN_CONTAINER_TOKEN_BACKGROUND_COLOR_FOCUS = '#626168'; // Used for the background color of a token in a token-selector when it's token-container is in the focus state.
694
695
  export const GL_TOKEN_FOREGROUND_COLOR = '#ececef'; // Used for the token foreground color.
695
696
  export const GL_TOKEN_BACKGROUND_COLOR = '#3a383f'; // Used for the token background color.
696
697
  export const GL_CONTROL_BACKGROUND_COLOR_DEFAULT = 'rgba(05, 05, 06, 0.4)'; // Used for form control (input, radio button, checkbox, textarea) default background.
@@ -691,6 +691,7 @@ export const GL_TOGGLE_SWITCH_ICON_COLOR_CHECKED_HOVER = '#1068bf'; // Used for
691
691
  export const GL_TOGGLE_SWITCH_ICON_COLOR_CHECKED_FOCUS = '#1068bf'; // Used for the icon color of a checked toggle switch in the focus state.
692
692
  export const GL_TOGGLE_SWITCH_ICON_COLOR_CHECKED_ACTIVE = '#0b5cad'; // Used for the icon color of a checked toggle switch in the active state.
693
693
  export const GL_TOGGLE_SWITCH_ICON_COLOR_DISABLED = '#ececef'; // Used for the icon color of a disabled toggle switch.
694
+ export const GL_TOKEN_SELECTOR_TOKEN_CONTAINER_TOKEN_BACKGROUND_COLOR_FOCUS = '#a4a3a8'; // Used for the background color of a token in a token-selector when it's token-container is in the focus state.
694
695
  export const GL_TOKEN_FOREGROUND_COLOR = '#3a383f'; // Used for the token foreground color.
695
696
  export const GL_TOKEN_BACKGROUND_COLOR = '#dcdcde'; // Used for the token background color.
696
697
  export const GL_CONTROL_BACKGROUND_COLOR_DEFAULT = '#fff'; // Used for form control (input, radio button, checkbox, textarea) default background.
@@ -15349,6 +15349,41 @@
15349
15349
  }
15350
15350
  }
15351
15351
  },
15352
+ "token-selector": {
15353
+ "token-container": {
15354
+ "token": {
15355
+ "background": {
15356
+ "color": {
15357
+ "focus": {
15358
+ "value": "#626168",
15359
+ "$type": "color",
15360
+ "comment": "Used for the background color of a token in a token-selector when it's token-container is in the focus state.",
15361
+ "filePath": "src/tokens/contextual/token-selector.tokens.json",
15362
+ "isSource": true,
15363
+ "original": {
15364
+ "value": {
15365
+ "default": "{color.neutral.300}",
15366
+ "dark": "{color.neutral.600}"
15367
+ },
15368
+ "$type": "color",
15369
+ "comment": "Used for the background color of a token in a token-selector when it's token-container is in the focus state."
15370
+ },
15371
+ "name": "TOKEN_SELECTOR_TOKEN_CONTAINER_TOKEN_BACKGROUND_COLOR_FOCUS",
15372
+ "attributes": {},
15373
+ "path": [
15374
+ "token-selector",
15375
+ "token-container",
15376
+ "token",
15377
+ "background",
15378
+ "color",
15379
+ "focus"
15380
+ ]
15381
+ }
15382
+ }
15383
+ }
15384
+ }
15385
+ }
15386
+ },
15352
15387
  "token": {
15353
15388
  "foreground": {
15354
15389
  "color": {
@@ -15349,6 +15349,41 @@
15349
15349
  }
15350
15350
  }
15351
15351
  },
15352
+ "token-selector": {
15353
+ "token-container": {
15354
+ "token": {
15355
+ "background": {
15356
+ "color": {
15357
+ "focus": {
15358
+ "value": "#a4a3a8",
15359
+ "$type": "color",
15360
+ "comment": "Used for the background color of a token in a token-selector when it's token-container is in the focus state.",
15361
+ "filePath": "src/tokens/contextual/token-selector.tokens.json",
15362
+ "isSource": true,
15363
+ "original": {
15364
+ "value": {
15365
+ "default": "{color.neutral.300}",
15366
+ "dark": "{color.neutral.600}"
15367
+ },
15368
+ "$type": "color",
15369
+ "comment": "Used for the background color of a token in a token-selector when it's token-container is in the focus state."
15370
+ },
15371
+ "name": "TOKEN_SELECTOR_TOKEN_CONTAINER_TOKEN_BACKGROUND_COLOR_FOCUS",
15372
+ "attributes": {},
15373
+ "path": [
15374
+ "token-selector",
15375
+ "token-container",
15376
+ "token",
15377
+ "background",
15378
+ "color",
15379
+ "focus"
15380
+ ]
15381
+ }
15382
+ }
15383
+ }
15384
+ }
15385
+ }
15386
+ },
15352
15387
  "token": {
15353
15388
  "foreground": {
15354
15389
  "color": {
@@ -496,6 +496,7 @@ $gl-control-background-color-concatenation: $gl-color-alpha-light-4; // Used for
496
496
  $gl-control-background-color-disabled: $gl-color-alpha-light-4; // Used for disabled form control (checkbox, input, radio button, textarea) background.
497
497
  $gl-control-background-color-default: $gl-color-alpha-dark-40; // Used for form control (input, radio button, checkbox, textarea) default background.
498
498
  $gl-token-background-color: $gl-color-neutral-800; // Used for the token background color.
499
+ $gl-token-selector-token-container-token-background-color-focus: $gl-color-neutral-600; // Used for the background color of a token in a token-selector when it's token-container is in the focus state.
499
500
  $gl-tab-selected-indicator-color-default: $gl-color-blue-400; // Used for the selected indicator of a tab.
500
501
  $gl-spinner-segment-color-light: $gl-color-neutral-200; // Used for the animated segment of a loading spinner on a dark background.
501
502
  $gl-spinner-segment-color-default: $gl-color-neutral-200; // Used for the animated segment of a loading spinner.
@@ -496,6 +496,7 @@ $gl-control-background-color-concatenation: $gl-color-neutral-10; // Used for th
496
496
  $gl-control-background-color-disabled: $gl-color-neutral-10; // Used for disabled form control (checkbox, input, radio button, textarea) background.
497
497
  $gl-control-background-color-default: $gl-color-neutral-0; // Used for form control (input, radio button, checkbox, textarea) default background.
498
498
  $gl-token-background-color: $gl-color-neutral-100; // Used for the token background color.
499
+ $gl-token-selector-token-container-token-background-color-focus: $gl-color-neutral-300; // Used for the background color of a token in a token-selector when it's token-container is in the focus state.
499
500
  $gl-tab-selected-indicator-color-default: $gl-color-blue-500; // Used for the selected indicator of a tab.
500
501
  $gl-spinner-segment-color-light: $gl-color-neutral-200; // Used for the animated segment of a loading spinner on a dark background.
501
502
  $gl-spinner-segment-color-default: $gl-color-neutral-700; // Used for the animated segment of a loading spinner.
@@ -691,6 +691,7 @@ $gl-toggle-switch-icon-color-checked-hover: var(--gl-toggle-switch-icon-color-ch
691
691
  $gl-toggle-switch-icon-color-checked-focus: var(--gl-toggle-switch-icon-color-checked-focus);
692
692
  $gl-toggle-switch-icon-color-checked-active: var(--gl-toggle-switch-icon-color-checked-active);
693
693
  $gl-toggle-switch-icon-color-disabled: var(--gl-toggle-switch-icon-color-disabled);
694
+ $gl-token-selector-token-container-token-background-color-focus: var(--gl-token-selector-token-container-token-background-color-focus);
694
695
  $gl-token-foreground-color: var(--gl-token-foreground-color);
695
696
  $gl-token-background-color: var(--gl-token-background-color);
696
697
  $gl-control-background-color-default: var(--gl-control-background-color-default);
@@ -0,0 +1,20 @@
1
+ {
2
+ "token-selector": {
3
+ "token-container": {
4
+ "token": {
5
+ "background": {
6
+ "color": {
7
+ "focus": {
8
+ "$value": {
9
+ "default": "{color.neutral.300}",
10
+ "dark": "{color.neutral.600}"
11
+ },
12
+ "$type": "color",
13
+ "$description": "Used for the background color of a token in a token-selector when it's token-container is in the focus state."
14
+ }
15
+ }
16
+ }
17
+ }
18
+ }
19
+ }
20
+ }