@gitlab/ui 93.4.0 → 94.0.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.
Files changed (47) hide show
  1. package/CHANGELOG.md +49 -0
  2. package/dist/components/base/table/table.js +22 -1
  3. package/dist/index.css +2 -4
  4. package/dist/index.css.map +1 -1
  5. package/dist/index.js +9 -0
  6. package/package.json +3 -3
  7. package/src/components/base/alert/alert.scss +2 -2
  8. package/src/components/base/avatar/avatar.scss +1 -1
  9. package/src/components/base/breadcrumb/breadcrumb.scss +1 -1
  10. package/src/components/base/button/button.scss +16 -16
  11. package/src/components/base/datepicker/datepicker.scss +1 -1
  12. package/src/components/base/dropdown/dropdown.scss +1 -1
  13. package/src/components/base/dropdown/dropdown_item.scss +10 -10
  14. package/src/components/base/dropdown/dropdown_section_header.scss +2 -2
  15. package/src/components/base/filtered_search/filtered_search.scss +1 -1
  16. package/src/components/base/filtered_search/filtered_search_suggestion.scss +2 -2
  17. package/src/components/base/filtered_search/filtered_search_token.scss +6 -6
  18. package/src/components/base/form/form_select/form_select.scss +1 -1
  19. package/src/components/base/infinite_scroll/infinite_scroll.scss +2 -2
  20. package/src/components/base/label/label.scss +1 -1
  21. package/src/components/base/loading_icon/loading_icon.scss +2 -2
  22. package/src/components/base/markdown/markdown.scss +9 -9
  23. package/src/components/base/markdown/markdown_typescale_demo.html +2 -2
  24. package/src/components/base/modal/modal.scss +1 -1
  25. package/src/components/base/new_dropdowns/disclosure/disclosure_dropdown.scss +1 -1
  26. package/src/components/base/new_dropdowns/dropdown.scss +1 -1
  27. package/src/components/base/new_dropdowns/dropdown_item.scss +11 -11
  28. package/src/components/base/new_dropdowns/listbox/listbox.scss +2 -2
  29. package/src/components/base/pagination/pagination.scss +8 -8
  30. package/src/components/base/path/path.scss +1 -1
  31. package/src/components/base/search_box_by_type/search_box_by_type.scss +3 -3
  32. package/src/components/base/segmented_control/segmented_control.scss +8 -8
  33. package/src/components/base/table/table.md +17 -0
  34. package/src/components/base/table/table.scss +12 -11
  35. package/src/components/base/table/table.vue +18 -2
  36. package/src/components/base/toast/toast.scss +1 -1
  37. package/src/components/base/toggle/toggle.scss +9 -9
  38. package/src/components/base/token/token.scss +3 -3
  39. package/src/components/base/token_selector/token_selector.scss +1 -1
  40. package/src/components/charts/legend/legend.scss +1 -1
  41. package/src/components/charts/single_stat/single_stat.scss +1 -1
  42. package/src/components/experimental/duo/chat/components/duo_chat_loader/duo_chat_loader.scss +1 -1
  43. package/src/components/experimental/duo/chat/components/duo_chat_message/duo_chat_message.scss +2 -2
  44. package/src/components/experimental/duo/chat/duo_chat.scss +2 -2
  45. package/src/components/shared_components/clear_icon_button/clear_icon_button.scss +2 -2
  46. package/src/index.js +9 -0
  47. package/src/scss/typescale/_index.scss +3 -3
@@ -2,7 +2,7 @@ $gl-search-box-by-type-search-icon-size: 16px;
2
2
  $gl-search-box-by-type-input-padding: 3.5 * $grid-size;
3
3
 
4
4
  .gl-search-box-by-type-search-icon {
5
- @include gl-text-gray-500;
5
+ @apply gl-text-gray-500;
6
6
  @apply gl-w-5;
7
7
  position: absolute;
8
8
  left: $gl-spacing-scale-3;
@@ -15,7 +15,7 @@ $gl-search-box-by-type-input-padding: 3.5 * $grid-size;
15
15
  }
16
16
 
17
17
  .gl-search-box-by-type-loading-icon {
18
- @include gl-text-gray-500;
18
+ @apply gl-text-gray-500;
19
19
  @apply gl-w-5;
20
20
  @apply gl-mr-2;
21
21
  }
@@ -53,7 +53,7 @@ $gl-search-box-by-type-input-padding: 3.5 * $grid-size;
53
53
  }
54
54
 
55
55
  &::placeholder {
56
- @include gl-text-gray-400;
56
+ @apply gl-text-gray-400;
57
57
  }
58
58
 
59
59
  &::-webkit-search-cancel-button {
@@ -35,9 +35,9 @@
35
35
  .btn-gl-segmented-button {
36
36
  @apply gl-text-base;
37
37
  @apply gl-leading-normal;
38
- @include gl-text-gray-900;
38
+ @apply gl-text-gray-900;
39
39
  @include gl-fill-current-color;
40
- @include gl-bg-gray-10;
40
+ @apply gl-bg-gray-10;
41
41
  @include gl-inset-border-y-1-gray-200;
42
42
 
43
43
  &:first-child {
@@ -50,29 +50,29 @@
50
50
 
51
51
  &:hover {
52
52
  @include gl-inset-border-2-gray-400;
53
- @include gl-bg-gray-50;
53
+ @apply gl-bg-gray-50;
54
54
  }
55
55
 
56
56
  &.focus {
57
57
  @apply gl-z-1;
58
58
  @include gl-btn-gl-segmented-button-focus($gray-400);
59
- @include gl-bg-gray-50;
59
+ @apply gl-bg-gray-50;
60
60
  }
61
61
 
62
62
  &.active {
63
63
  @apply gl-z-2;
64
64
  @include gl-inset-border-2-gray-300;
65
- @include gl-bg-white;
65
+ @apply gl-bg-white;
66
66
 
67
67
  &:hover {
68
68
  @include gl-inset-border-2-gray-400;
69
- @include gl-bg-gray-50;
69
+ @apply gl-bg-gray-50;
70
70
  }
71
71
 
72
72
  &.focus,
73
73
  &.focus:hover {
74
74
  @include gl-btn-gl-segmented-button-focus($gray-400);
75
- @include gl-bg-gray-50;
75
+ @apply gl-bg-gray-50;
76
76
  }
77
77
  }
78
78
 
@@ -84,7 +84,7 @@
84
84
  &[disabled],
85
85
  &.disabled:hover,
86
86
  &[disabled]:hover {
87
- @include gl-text-gray-400;
87
+ @apply gl-text-gray-400;
88
88
  @include gl-inset-border-y-1-gray-200;
89
89
  @include gl-z-index-0;
90
90
  @include gl-cursor-not-allowed;
@@ -14,6 +14,23 @@ like mentioned in the implementation example.
14
14
  _Full documentation for the
15
15
  `field` prop [here.](https://bootstrap-vue.org/docs/components/table#fields-column-definitions)_
16
16
 
17
+ ## Header text alignment
18
+
19
+ To align a given `TH` element's text to the right, set the `thAlignRight` property to `true` in
20
+ the fields definition. This will ensure that proper styling is applied, including when the column
21
+ is sortable.
22
+
23
+ ```js
24
+ const fields = [
25
+ {
26
+ key: "column_one",
27
+ label: __("First column"),
28
+ sortable: true,
29
+ thAlignRight: true,
30
+ },
31
+ ];
32
+ ```
33
+
17
34
  ## Use `GlTableLite` when possible
18
35
 
19
36
  If you don't need all the features of `GlTable`, like filtering, sorting, or
@@ -5,10 +5,8 @@ table.gl-table {
5
5
  tr {
6
6
  th,
7
7
  td {
8
- @apply gl-border-b-solid gl-border-b-1;
8
+ @apply gl-border-b-1 gl-bg-transparent gl-p-5 gl-border-b-solid;
9
9
  border-color: var(--gl-border-color-default);
10
- @apply gl-p-5;
11
- @include gl-bg-transparent;
12
10
  @apply gl-leading-normal;
13
11
  @apply gl-text-base;
14
12
  @apply gl-align-top;
@@ -18,12 +16,15 @@ table.gl-table {
18
16
  @apply gl-font-bold;
19
17
  color: var(--gl-text-color-heading);
20
18
 
21
- &.gl-text-right > div {
22
- flex-direction: row-reverse;
19
+ .gl-table-th-sort-icon-wrapper {
20
+ @apply gl-ml-2;
21
+ }
22
+
23
+ &.gl-table-th-align-right > div {
24
+ @apply gl-flex-row-reverse;
23
25
 
24
- div.gl-ml-2 {
25
- @apply gl-ml-0;
26
- @apply gl-mr-2;
26
+ .gl-table-th-sort-icon-wrapper {
27
+ @apply gl-ml-0 gl-mr-2;
27
28
  }
28
29
  }
29
30
 
@@ -79,11 +80,11 @@ table.gl-table {
79
80
  @apply gl-border-l-1 gl-border-r-1 gl-border-l-solid gl-border-r-solid;
80
81
 
81
82
  &::before {
82
- @include gl-text-left;
83
+ @apply gl-text-left;
83
84
  }
84
85
 
85
86
  &:first-child {
86
- @apply gl-border-t-solid gl-border-t-1;
87
+ @apply gl-border-t-1 gl-border-t-solid;
87
88
  }
88
89
 
89
90
  &:not(:first-child) {
@@ -92,7 +93,7 @@ table.gl-table {
92
93
  }
93
94
 
94
95
  div {
95
- @include gl-text-right;
96
+ @apply gl-text-right;
96
97
  @apply gl-break-words;
97
98
  }
98
99
  }
@@ -61,6 +61,22 @@ export default {
61
61
  ...Object.keys(this.$scopedSlots).filter((slotName) => slotName.startsWith('head(')),
62
62
  ];
63
63
  },
64
+ computedFields() {
65
+ return this.fields?.map((field) => {
66
+ if (typeof field === 'string') {
67
+ return field;
68
+ }
69
+ const { thAlignRight, thClass = '', ...rest } = field;
70
+ const computedThClass = Array.isArray(thClass) ? thClass : thClass.split(' ');
71
+ if (thAlignRight) {
72
+ computedThClass.push('gl-table-th-align-right');
73
+ }
74
+ return {
75
+ ...rest,
76
+ thClass: computedThClass,
77
+ };
78
+ });
79
+ },
64
80
  },
65
81
  mounted() {
66
82
  // logWarning will call isDev before logging any message
@@ -97,7 +113,7 @@ export default {
97
113
  <template>
98
114
  <b-table
99
115
  :table-class="localTableClass"
100
- :fields="fields"
116
+ :fields="computedFields"
101
117
  :sort-by.sync="localSortBy"
102
118
  :sort-desc.sync="localSortDesc"
103
119
  no-sort-reset
@@ -112,7 +128,7 @@ export default {
112
128
  <slot :name="headSlotName" v-bind="scope"
113
129
  ><span>{{ scope.label }}</span></slot
114
130
  ><template v-if="isSortable(scope)">
115
- <div class="gl-ml-2 gl-flex gl-w-5 gl-justify-center">
131
+ <div class="gl-table-th-sort-icon-wrapper gl-flex gl-w-5 gl-justify-center">
116
132
  <span
117
133
  name="sort-icon"
118
134
  data-testid="sort-icon"
@@ -43,7 +43,7 @@
43
43
  }
44
44
 
45
45
  .gl-toast-action {
46
- @include gl-text-blue-300;
46
+ @apply gl-text-blue-300;
47
47
  @apply gl-p-3;
48
48
  @apply gl-m-0;
49
49
  @apply gl-ml-5;
@@ -32,7 +32,7 @@ $toggle-height: 2.5 * $grid-size;
32
32
 
33
33
  .gl-toggle {
34
34
  @include gl-cursor-not-allowed;
35
- @include gl-bg-gray-200;
35
+ @apply gl-bg-gray-200;
36
36
 
37
37
  .toggle-icon > svg {
38
38
  @include gl-fill-gray-200;
@@ -40,7 +40,7 @@ $toggle-height: 2.5 * $grid-size;
40
40
  }
41
41
 
42
42
  .gl-toggle.is-checked {
43
- @include gl-bg-blue-200;
43
+ @apply gl-bg-blue-200;
44
44
 
45
45
  .toggle-icon > svg {
46
46
  @include gl-fill-blue-200;
@@ -49,14 +49,14 @@ $toggle-height: 2.5 * $grid-size;
49
49
 
50
50
  .gl-toggle-label,
51
51
  .gl-description-label {
52
- @include gl-text-gray-500;
52
+ @apply gl-text-gray-500;
53
53
  }
54
54
  }
55
55
  }
56
56
 
57
57
  .gl-help-label {
58
58
  @apply gl-mt-3;
59
- @include gl-text-gray-500;
59
+ @apply gl-text-gray-500;
60
60
  @apply gl-font-normal;
61
61
  }
62
62
 
@@ -86,7 +86,7 @@ $toggle-height: 2.5 * $grid-size;
86
86
  @apply gl-justify-center;
87
87
  @apply gl-border-0;
88
88
  @include gl-cursor-pointer;
89
- @include gl-bg-gray-600;
89
+ @apply gl-bg-gray-600;
90
90
  position: relative;
91
91
  width: $toggle-width;
92
92
  height: $toggle-height;
@@ -106,7 +106,7 @@ $toggle-height: 2.5 * $grid-size;
106
106
  &:active,
107
107
  &:focus,
108
108
  &:focus:active {
109
- @include gl-bg-gray-700;
109
+ @apply gl-bg-gray-700;
110
110
  }
111
111
 
112
112
  &:active,
@@ -121,7 +121,7 @@ $toggle-height: 2.5 * $grid-size;
121
121
 
122
122
  .toggle-icon {
123
123
  @include gl-rounded-full;
124
- @include gl-bg-white;
124
+ @apply gl-bg-white;
125
125
  position: absolute;
126
126
  @apply gl-inline-flex;
127
127
  @apply gl-items-center;
@@ -140,13 +140,13 @@ $toggle-height: 2.5 * $grid-size;
140
140
  }
141
141
 
142
142
  &.is-checked {
143
- @include gl-bg-blue-500;
143
+ @apply gl-bg-blue-500;
144
144
 
145
145
  &:hover,
146
146
  &:active,
147
147
  &:focus,
148
148
  &:focus:active {
149
- @include gl-bg-blue-600;
149
+ @apply gl-bg-blue-600;
150
150
  }
151
151
 
152
152
  .toggle-icon {
@@ -1,6 +1,6 @@
1
1
  .gl-token {
2
- @include gl-text-gray-900;
3
- @include gl-bg-gray-100;
2
+ @apply gl-text-gray-900;
3
+ @apply gl-bg-gray-100;
4
4
  @include gl-rounded-small;
5
5
  @apply gl-pl-3;
6
6
  @apply gl-inline-flex;
@@ -14,7 +14,7 @@
14
14
  }
15
15
 
16
16
  .gl-token-search-type-variant {
17
- @include gl-bg-gray-100;
17
+ @apply gl-bg-gray-100;
18
18
  @apply gl-rounded-tr-none;
19
19
  @apply gl-rounded-br-none;
20
20
  }
@@ -10,7 +10,7 @@
10
10
  }
11
11
 
12
12
  .gl-token-selector-token-container:focus .gl-token {
13
- @include gl-bg-gray-300;
13
+ @apply gl-bg-gray-300;
14
14
  }
15
15
 
16
16
  .gl-token-selector-input {
@@ -61,7 +61,7 @@ $legend-body-h: $gl-spacing-scale-13 - $gl-spacing-scale-4;
61
61
  @apply gl-whitespace-nowrap;
62
62
  @include gl-overflow-hidden;
63
63
  @apply gl-text-ellipsis;
64
- @include gl-text-right;
64
+ @apply gl-text-right;
65
65
  @apply gl-w-1/8;
66
66
  }
67
67
 
@@ -2,7 +2,7 @@
2
2
  @apply gl-leading-1;
3
3
 
4
4
  &:hover[tabindex='0'] {
5
- @include gl-bg-gray-50;
5
+ @apply gl-bg-gray-50;
6
6
  @apply gl-rounded-base;
7
7
  }
8
8
 
@@ -1,6 +1,6 @@
1
1
  .duo-chat-loader {
2
2
  @apply gl-flex;
3
- @include gl-text-gray-500;
3
+ @apply gl-text-gray-500;
4
4
 
5
5
  .transition {
6
6
  transition: width 0.5s ease;
@@ -3,7 +3,7 @@
3
3
  position: relative;
4
4
 
5
5
  code {
6
- @include gl-bg-gray-100;
6
+ @apply gl-bg-gray-100;
7
7
  }
8
8
 
9
9
  pre {
@@ -14,7 +14,7 @@
14
14
  pre code {
15
15
  @apply gl-text-sm;
16
16
  @apply gl-leading-1;
17
- @include gl-bg-transparent;
17
+ @apply gl-bg-transparent;
18
18
  white-space: inherit;
19
19
  }
20
20
 
@@ -73,7 +73,7 @@ $duo-chat-scrim-gradient: linear-gradient(to bottom, rgba($gray-10, 0), $gray-10
73
73
  }
74
74
 
75
75
  .duo-chat-drawer-footer-sticky {
76
- @include gl-bg-white;
76
+ @apply gl-bg-white;
77
77
  bottom: 0;
78
78
  position: sticky;
79
79
  }
@@ -152,7 +152,7 @@ $duo-chat-scrim-gradient: linear-gradient(to bottom, rgba($gray-10, 0), $gray-10
152
152
  @apply -gl-mt-2;
153
153
 
154
154
  .active-command {
155
- @include gl-bg-gray-50;
155
+ @apply gl-bg-gray-50;
156
156
  @apply gl-rounded-base;
157
157
  }
158
158
 
@@ -1,8 +1,8 @@
1
1
  .gl-clear-icon-button {
2
- @include gl-bg-transparent;
2
+ @apply gl-bg-transparent;
3
3
  @apply gl-border-none;
4
4
  @include gl-cursor-pointer;
5
- @include gl-text-gray-500;
5
+ @apply gl-text-gray-500;
6
6
 
7
7
  &:focus {
8
8
  @include gl-focus;
package/src/index.js CHANGED
@@ -22,6 +22,15 @@ export { default as GlNavbar } from './components/base/navbar/navbar.vue';
22
22
  export { default as GlIntersectionObserver } from './components/utilities/intersection_observer/intersection_observer.vue';
23
23
  export { default as GlLink, default as GlDeprecatedLink } from './components/base/link/link.vue';
24
24
  export { default as GlIcon } from './components/base/icon/icon.vue';
25
+ export { default as GlAnimatedChevronRightDownIcon } from './components/base/animated_icon/animated_chevron_right_down_icon.vue';
26
+ export { default as GlAnimatedDuoChatIcon } from './components/base/animated_icon/animated_duo_chat_icon.vue';
27
+ export { default as GlAnimatedNotificationIcon } from './components/base/animated_icon/animated_notifications_icon.vue';
28
+ export { default as GlAnimatedSidebarIcon } from './components/base/animated_icon/animated_sidebar_icon.vue';
29
+ export { default as GlAnimatedSmileIcon } from './components/base/animated_icon/animated_smile_icon.vue';
30
+ export { default as GlAnimatedSortIcon } from './components/base/animated_icon/animated_sort_icon.vue';
31
+ export { default as GlAnimatedStarIcon } from './components/base/animated_icon/animated_star_icon.vue';
32
+ export { default as GlAnimatedTodoIcon } from './components/base/animated_icon/animated_todo_icon.vue';
33
+ export { default as GlAnimatedUploadIcon } from './components/base/animated_icon/animated_upload_icon.vue';
25
34
  export { default as GlLoadingIcon } from './components/base/loading_icon/loading_icon.vue';
26
35
  export { default as GlModal } from './components/base/modal/modal.vue';
27
36
  export { default as GlPagination } from './components/base/pagination/pagination.vue';
@@ -1,7 +1,7 @@
1
1
  @mixin gl-typescale-ui($selector: 'body') {
2
2
  #{$selector} {
3
3
  @apply gl-text-base;
4
- @include gl-text-gray-900;
4
+ @apply gl-text-gray-900;
5
5
  @include gl-font-regular;
6
6
  @apply gl-font-normal;
7
7
  @apply gl-leading-normal;
@@ -60,7 +60,7 @@
60
60
  .gl-h6 {
61
61
  @apply gl-text-base;
62
62
  @apply gl-leading-20;
63
- @include gl-text-gray-700;
63
+ @apply gl-text-gray-700;
64
64
  }
65
65
 
66
66
  p,
@@ -93,7 +93,7 @@
93
93
  }
94
94
 
95
95
  blockquote {
96
- @include gl-text-gray-700;
96
+ @apply gl-text-gray-700;
97
97
  @apply gl-py-3;
98
98
  @apply gl-pl-6;
99
99
  @apply gl-my-3;