@gitlab/ui 123.2.0 → 123.3.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/dist/components/base/button/button.js +21 -2
- package/dist/components/base/new_dropdowns/disclosure/disclosure_dropdown.js +9 -1
- package/dist/index.css +2 -2
- package/dist/index.css.map +1 -1
- package/dist/tokens/build/js/tokens.dark.js +2 -1
- package/dist/tokens/build/js/tokens.js +2 -1
- package/dist/tokens/css/tokens.css +1 -0
- package/dist/tokens/css/tokens.dark.css +1 -0
- package/dist/tokens/figma/contextual.tokens.json +18 -0
- package/dist/tokens/js/tokens.dark.js +1 -0
- package/dist/tokens/js/tokens.js +1 -0
- package/dist/tokens/json/tokens.dark.json +41 -0
- package/dist/tokens/json/tokens.json +41 -0
- package/dist/tokens/scss/_tokens.dark.scss +1 -0
- package/dist/tokens/scss/_tokens.scss +1 -0
- package/dist/tokens/scss/_tokens_custom_properties.scss +1 -0
- package/package.json +5 -5
- package/src/components/base/button/button.scss +23 -4
- package/src/components/base/button/button.vue +27 -2
- package/src/components/base/new_dropdowns/disclosure/disclosure_dropdown.vue +8 -1
- package/src/tokens/build/css/tokens.css +1 -0
- package/src/tokens/build/css/tokens.dark.css +1 -0
- package/src/tokens/build/figma/contextual.tokens.json +18 -0
- package/src/tokens/build/js/tokens.dark.js +1 -0
- package/src/tokens/build/js/tokens.js +1 -0
- package/src/tokens/build/json/tokens.dark.json +41 -0
- package/src/tokens/build/json/tokens.json +41 -0
- package/src/tokens/build/scss/_tokens.dark.scss +1 -0
- package/src/tokens/build/scss/_tokens.scss +1 -0
- package/src/tokens/build/scss/_tokens_custom_properties.scss +1 -0
- package/src/tokens/contextual/button.tokens.json +18 -0
|
@@ -214,13 +214,29 @@ export default {
|
|
|
214
214
|
// so we must set it as `null` here to be a true tri-state prop
|
|
215
215
|
default: null,
|
|
216
216
|
},
|
|
217
|
+
/**
|
|
218
|
+
* Display a count badge next to the button text.
|
|
219
|
+
*/
|
|
220
|
+
count: {
|
|
221
|
+
type: Number,
|
|
222
|
+
required: false,
|
|
223
|
+
default: null,
|
|
224
|
+
},
|
|
225
|
+
/**
|
|
226
|
+
* Screen reader text to provide context for the count value.
|
|
227
|
+
*/
|
|
228
|
+
countSrText: {
|
|
229
|
+
type: String,
|
|
230
|
+
required: false,
|
|
231
|
+
default: null,
|
|
232
|
+
},
|
|
217
233
|
},
|
|
218
234
|
computed: {
|
|
219
235
|
hasIcon() {
|
|
220
236
|
return this.icon !== '';
|
|
221
237
|
},
|
|
222
238
|
hasIconOnly() {
|
|
223
|
-
return isSlotEmpty(this, 'default') && this.hasIcon;
|
|
239
|
+
return isSlotEmpty(this, 'default') && this.hasIcon && this.count == null;
|
|
224
240
|
},
|
|
225
241
|
isButtonDisabled() {
|
|
226
242
|
return this.disabled || this.loading;
|
|
@@ -329,6 +345,9 @@ export default {
|
|
|
329
345
|
|
|
330
346
|
return this.tag;
|
|
331
347
|
},
|
|
348
|
+
hasCount() {
|
|
349
|
+
return this.count != null && this.count >= 0;
|
|
350
|
+
},
|
|
332
351
|
},
|
|
333
352
|
mounted() {
|
|
334
353
|
// eslint-disable-next-line @gitlab/vue-prefer-dollar-scopedslots
|
|
@@ -373,6 +392,12 @@ export default {
|
|
|
373
392
|
<gl-loading-icon v-if="loading" inline class="gl-button-icon gl-button-loading-indicator" />
|
|
374
393
|
<gl-icon v-if="hasIcon && !(hasIconOnly && loading)" class="gl-button-icon" :name="icon" />
|
|
375
394
|
<slot name="emoji"></slot>
|
|
376
|
-
<span v-if="!hasIconOnly" :class="buttonTextClasses" class="gl-button-text"
|
|
395
|
+
<span v-if="!hasIconOnly" :class="buttonTextClasses" class="gl-button-text">
|
|
396
|
+
<slot></slot>
|
|
397
|
+
<span v-if="hasCount" class="gl-button-count">
|
|
398
|
+
{{ count }}
|
|
399
|
+
<span v-if="countSrText" class="gl-sr-only">{{ countSrText }}</span>
|
|
400
|
+
</span>
|
|
401
|
+
</span>
|
|
377
402
|
</component>
|
|
378
403
|
</template>
|
|
@@ -347,7 +347,14 @@ export default {
|
|
|
347
347
|
if (
|
|
348
348
|
this.autoClose &&
|
|
349
349
|
e.target.closest(ITEM_SELECTOR) &&
|
|
350
|
-
|
|
350
|
+
// The optional chaining here is to accommodate specs that use shallow mounting.
|
|
351
|
+
// Ideally, those specs would either:
|
|
352
|
+
// - stub out the `BaseDropdown` component to include a stub `containsElement` method, or
|
|
353
|
+
// - use a full mount.
|
|
354
|
+
//
|
|
355
|
+
// Unfortunately, GitLab has many specs which do neither of these. So the simpler thing to do
|
|
356
|
+
// is to optionally chain the method call here.
|
|
357
|
+
this.$refs.baseDropdown.containsElement?.(e.target)
|
|
351
358
|
) {
|
|
352
359
|
this.closeAndFocus();
|
|
353
360
|
}
|
|
@@ -774,6 +774,7 @@
|
|
|
774
774
|
--gl-button-disabled-foreground-color: var(--gl-color-neutral-500); /** Used for the foreground of a disabled button. */
|
|
775
775
|
--gl-button-disabled-background-color: var(--gl-color-neutral-10); /** Used for the background of a disabled button. */
|
|
776
776
|
--gl-button-disabled-border-color: var(--gl-color-neutral-100); /** Used for the border of a disabled button. */
|
|
777
|
+
--gl-button-count-background-color: var(--gl-color-alpha-dark-8); /** Used for the background of a button count element. */
|
|
777
778
|
--gl-chart-axis-line-color: var(--gl-color-neutral-200); /** Used in charts for axis line color. */
|
|
778
779
|
--gl-chart-threshold-line-color: var(--gl-color-red-500); /** Used in charts to divide a threshold area in a chart from other data. */
|
|
779
780
|
--gl-chart-zoom-filler-color: var(--gl-color-alpha-dark-8); /** Used in charts for the overlay color when zooming in on a specific area of data. */
|
|
@@ -774,6 +774,7 @@
|
|
|
774
774
|
--gl-button-disabled-foreground-color: var(--gl-color-neutral-400); /** Used for the foreground of a disabled button. */
|
|
775
775
|
--gl-button-disabled-background-color: rgba(137, 136, 141, 0.16); /** Used for the background of a disabled button. */
|
|
776
776
|
--gl-button-disabled-border-color: var(--gl-color-alpha-0); /** Used for the border of a disabled button. */
|
|
777
|
+
--gl-button-count-background-color: var(--gl-color-alpha-light-16); /** Used for the background of a button count element. */
|
|
777
778
|
--gl-chart-axis-line-color: var(--gl-color-neutral-700); /** Used in charts for axis line color. */
|
|
778
779
|
--gl-chart-threshold-line-color: var(--gl-color-red-600); /** Used in charts to divide a threshold area in a chart from other data. */
|
|
779
780
|
--gl-chart-zoom-filler-color: var(--gl-color-alpha-light-16); /** Used in charts for the overlay color when zooming in on a specific area of data. */
|
|
@@ -4129,6 +4129,24 @@
|
|
|
4129
4129
|
}
|
|
4130
4130
|
}
|
|
4131
4131
|
},
|
|
4132
|
+
"count": {
|
|
4133
|
+
"background": {
|
|
4134
|
+
"color": {
|
|
4135
|
+
"$value": {
|
|
4136
|
+
"default": "{color.alpha.dark.8}",
|
|
4137
|
+
"dark": "{color.alpha.light.16}"
|
|
4138
|
+
},
|
|
4139
|
+
"$type": "color",
|
|
4140
|
+
"$description": "Used for the background of a button count element.",
|
|
4141
|
+
"$extensions": {
|
|
4142
|
+
"com.figma.scope": [
|
|
4143
|
+
"FRAME_FILL",
|
|
4144
|
+
"SHAPE_FILL"
|
|
4145
|
+
]
|
|
4146
|
+
}
|
|
4147
|
+
}
|
|
4148
|
+
}
|
|
4149
|
+
},
|
|
4132
4150
|
"$extensions": {
|
|
4133
4151
|
"com.gitlab.locked": true
|
|
4134
4152
|
}
|
|
@@ -678,6 +678,7 @@ export const GL_BUTTON_SELECTED_BORDER_COLOR_ACTIVE = 'transparent';
|
|
|
678
678
|
export const GL_BUTTON_DISABLED_FOREGROUND_COLOR = '#89888d';
|
|
679
679
|
export const GL_BUTTON_DISABLED_BACKGROUND_COLOR = 'rgba(137, 136, 141, 0.16)';
|
|
680
680
|
export const GL_BUTTON_DISABLED_BORDER_COLOR = 'transparent';
|
|
681
|
+
export const GL_BUTTON_COUNT_BACKGROUND_COLOR = 'rgba(255, 255, 255, 0.16)';
|
|
681
682
|
export const GL_CARD_BORDER_RADIUS = '0.25rem';
|
|
682
683
|
export const GL_CHART_AXIS_POINTER_COLOR = '#bfbfc3';
|
|
683
684
|
export const GL_CHART_AXIS_LINE_COLOR = '#4c4b51';
|
|
@@ -678,6 +678,7 @@ export const GL_BUTTON_SELECTED_BORDER_COLOR_ACTIVE = '#626168';
|
|
|
678
678
|
export const GL_BUTTON_DISABLED_FOREGROUND_COLOR = '#737278';
|
|
679
679
|
export const GL_BUTTON_DISABLED_BACKGROUND_COLOR = '#fbfafd';
|
|
680
680
|
export const GL_BUTTON_DISABLED_BORDER_COLOR = '#dcdcde';
|
|
681
|
+
export const GL_BUTTON_COUNT_BACKGROUND_COLOR = 'rgba(05, 05, 06, 0.08)';
|
|
681
682
|
export const GL_CARD_BORDER_RADIUS = '0.25rem';
|
|
682
683
|
export const GL_CHART_AXIS_POINTER_COLOR = '#626168';
|
|
683
684
|
export const GL_CHART_AXIS_LINE_COLOR = '#bfbfc3';
|
|
@@ -19404,6 +19404,47 @@
|
|
|
19404
19404
|
]
|
|
19405
19405
|
}
|
|
19406
19406
|
}
|
|
19407
|
+
},
|
|
19408
|
+
"count": {
|
|
19409
|
+
"background": {
|
|
19410
|
+
"color": {
|
|
19411
|
+
"key": "{button.count.background.color}",
|
|
19412
|
+
"$value": "rgba(255, 255, 255, 0.16)",
|
|
19413
|
+
"$type": "color",
|
|
19414
|
+
"$description": "Used for the background of a button count element.",
|
|
19415
|
+
"$extensions": {
|
|
19416
|
+
"com.figma.scope": [
|
|
19417
|
+
"FRAME_FILL",
|
|
19418
|
+
"SHAPE_FILL"
|
|
19419
|
+
]
|
|
19420
|
+
},
|
|
19421
|
+
"filePath": "src/tokens/contextual/button.tokens.json",
|
|
19422
|
+
"isSource": true,
|
|
19423
|
+
"original": {
|
|
19424
|
+
"$value": {
|
|
19425
|
+
"default": "{color.alpha.dark.8}",
|
|
19426
|
+
"dark": "{color.alpha.light.16}"
|
|
19427
|
+
},
|
|
19428
|
+
"$type": "color",
|
|
19429
|
+
"$description": "Used for the background of a button count element.",
|
|
19430
|
+
"$extensions": {
|
|
19431
|
+
"com.figma.scope": [
|
|
19432
|
+
"FRAME_FILL",
|
|
19433
|
+
"SHAPE_FILL"
|
|
19434
|
+
]
|
|
19435
|
+
},
|
|
19436
|
+
"key": "{button.count.background.color}"
|
|
19437
|
+
},
|
|
19438
|
+
"name": "BUTTON_COUNT_BACKGROUND_COLOR",
|
|
19439
|
+
"attributes": {},
|
|
19440
|
+
"path": [
|
|
19441
|
+
"button",
|
|
19442
|
+
"count",
|
|
19443
|
+
"background",
|
|
19444
|
+
"color"
|
|
19445
|
+
]
|
|
19446
|
+
}
|
|
19447
|
+
}
|
|
19407
19448
|
}
|
|
19408
19449
|
},
|
|
19409
19450
|
"card": {
|
|
@@ -19404,6 +19404,47 @@
|
|
|
19404
19404
|
]
|
|
19405
19405
|
}
|
|
19406
19406
|
}
|
|
19407
|
+
},
|
|
19408
|
+
"count": {
|
|
19409
|
+
"background": {
|
|
19410
|
+
"color": {
|
|
19411
|
+
"key": "{button.count.background.color}",
|
|
19412
|
+
"$value": "rgba(05, 05, 06, 0.08)",
|
|
19413
|
+
"$type": "color",
|
|
19414
|
+
"$description": "Used for the background of a button count element.",
|
|
19415
|
+
"$extensions": {
|
|
19416
|
+
"com.figma.scope": [
|
|
19417
|
+
"FRAME_FILL",
|
|
19418
|
+
"SHAPE_FILL"
|
|
19419
|
+
]
|
|
19420
|
+
},
|
|
19421
|
+
"filePath": "src/tokens/contextual/button.tokens.json",
|
|
19422
|
+
"isSource": true,
|
|
19423
|
+
"original": {
|
|
19424
|
+
"$value": {
|
|
19425
|
+
"default": "{color.alpha.dark.8}",
|
|
19426
|
+
"dark": "{color.alpha.light.16}"
|
|
19427
|
+
},
|
|
19428
|
+
"$type": "color",
|
|
19429
|
+
"$description": "Used for the background of a button count element.",
|
|
19430
|
+
"$extensions": {
|
|
19431
|
+
"com.figma.scope": [
|
|
19432
|
+
"FRAME_FILL",
|
|
19433
|
+
"SHAPE_FILL"
|
|
19434
|
+
]
|
|
19435
|
+
},
|
|
19436
|
+
"key": "{button.count.background.color}"
|
|
19437
|
+
},
|
|
19438
|
+
"name": "BUTTON_COUNT_BACKGROUND_COLOR",
|
|
19439
|
+
"attributes": {},
|
|
19440
|
+
"path": [
|
|
19441
|
+
"button",
|
|
19442
|
+
"count",
|
|
19443
|
+
"background",
|
|
19444
|
+
"color"
|
|
19445
|
+
]
|
|
19446
|
+
}
|
|
19447
|
+
}
|
|
19407
19448
|
}
|
|
19408
19449
|
},
|
|
19409
19450
|
"card": {
|
|
@@ -772,6 +772,7 @@ $gl-button-selected-border-color-active: $gl-color-alpha-0; // Used for the bord
|
|
|
772
772
|
$gl-button-disabled-foreground-color: $gl-color-neutral-400; // Used for the foreground of a disabled button.
|
|
773
773
|
$gl-button-disabled-background-color: rgba(137, 136, 141, 0.16); // Used for the background of a disabled button.
|
|
774
774
|
$gl-button-disabled-border-color: $gl-color-alpha-0; // Used for the border of a disabled button.
|
|
775
|
+
$gl-button-count-background-color: $gl-color-alpha-light-16; // Used for the background of a button count element.
|
|
775
776
|
$gl-chart-axis-line-color: $gl-color-neutral-700; // Used in charts for axis line color.
|
|
776
777
|
$gl-chart-threshold-line-color: $gl-color-red-600; // Used in charts to divide a threshold area in a chart from other data.
|
|
777
778
|
$gl-chart-zoom-filler-color: $gl-color-alpha-light-16; // Used in charts for the overlay color when zooming in on a specific area of data.
|
|
@@ -772,6 +772,7 @@ $gl-button-selected-border-color-active: $gl-color-neutral-600; // Used for the
|
|
|
772
772
|
$gl-button-disabled-foreground-color: $gl-color-neutral-500; // Used for the foreground of a disabled button.
|
|
773
773
|
$gl-button-disabled-background-color: $gl-color-neutral-10; // Used for the background of a disabled button.
|
|
774
774
|
$gl-button-disabled-border-color: $gl-color-neutral-100; // Used for the border of a disabled button.
|
|
775
|
+
$gl-button-count-background-color: $gl-color-alpha-dark-8; // Used for the background of a button count element.
|
|
775
776
|
$gl-chart-axis-line-color: $gl-color-neutral-200; // Used in charts for axis line color.
|
|
776
777
|
$gl-chart-threshold-line-color: $gl-color-red-500; // Used in charts to divide a threshold area in a chart from other data.
|
|
777
778
|
$gl-chart-zoom-filler-color: $gl-color-alpha-dark-8; // Used in charts for the overlay color when zooming in on a specific area of data.
|
|
@@ -619,6 +619,7 @@ $gl-button-selected-border-color-active: var(--gl-button-selected-border-color-a
|
|
|
619
619
|
$gl-button-disabled-foreground-color: var(--gl-button-disabled-foreground-color);
|
|
620
620
|
$gl-button-disabled-background-color: var(--gl-button-disabled-background-color);
|
|
621
621
|
$gl-button-disabled-border-color: var(--gl-button-disabled-border-color);
|
|
622
|
+
$gl-button-count-background-color: var(--gl-button-count-background-color);
|
|
622
623
|
$gl-card-border-radius: var(--gl-card-border-radius);
|
|
623
624
|
$gl-chart-axis-pointer-color: var(--gl-chart-axis-pointer-color);
|
|
624
625
|
$gl-chart-axis-line-color: var(--gl-chart-axis-line-color);
|
|
@@ -1591,6 +1591,24 @@
|
|
|
1591
1591
|
}
|
|
1592
1592
|
}
|
|
1593
1593
|
}
|
|
1594
|
+
},
|
|
1595
|
+
"count": {
|
|
1596
|
+
"background": {
|
|
1597
|
+
"color": {
|
|
1598
|
+
"$value": {
|
|
1599
|
+
"default": "{color.alpha.dark.8}",
|
|
1600
|
+
"dark": "{color.alpha.light.16}"
|
|
1601
|
+
},
|
|
1602
|
+
"$type": "color",
|
|
1603
|
+
"$description": "Used for the background of a button count element.",
|
|
1604
|
+
"$extensions": {
|
|
1605
|
+
"com.figma.scope": [
|
|
1606
|
+
"FRAME_FILL",
|
|
1607
|
+
"SHAPE_FILL"
|
|
1608
|
+
]
|
|
1609
|
+
}
|
|
1610
|
+
}
|
|
1611
|
+
}
|
|
1594
1612
|
}
|
|
1595
1613
|
}
|
|
1596
1614
|
}
|