@gitlab/ui 78.1.1 → 78.2.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.
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Do not edit directly
3
- * Generated on Tue, 05 Mar 2024 16:29:47 GMT
3
+ * Generated on Thu, 14 Mar 2024 18:11:11 GMT
4
4
  */
5
5
 
6
6
  :root {
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Do not edit directly
3
- * Generated on Tue, 05 Mar 2024 16:29:47 GMT
3
+ * Generated on Thu, 14 Mar 2024 18:11:11 GMT
4
4
  */
5
5
 
6
6
  :root.gl-dark {
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Do not edit directly
3
- * Generated on Tue, 05 Mar 2024 16:29:47 GMT
3
+ * Generated on Thu, 14 Mar 2024 18:11:11 GMT
4
4
  */
5
5
 
6
6
  export const DATA_VIZ_GREEN_50 = "#133a03";
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Do not edit directly
3
- * Generated on Tue, 05 Mar 2024 16:29:47 GMT
3
+ * Generated on Thu, 14 Mar 2024 18:11:11 GMT
4
4
  */
5
5
 
6
6
  export const DATA_VIZ_GREEN_50 = "#ddfab7";
@@ -1,6 +1,6 @@
1
1
 
2
2
  // Do not edit directly
3
- // Generated on Tue, 05 Mar 2024 16:29:47 GMT
3
+ // Generated on Thu, 14 Mar 2024 18:11:11 GMT
4
4
 
5
5
  $gl-text-tertiary: #737278 !default;
6
6
  $gl-text-secondary: #89888d !default;
@@ -1,6 +1,6 @@
1
1
 
2
2
  // Do not edit directly
3
- // Generated on Tue, 05 Mar 2024 16:29:47 GMT
3
+ // Generated on Thu, 14 Mar 2024 18:11:11 GMT
4
4
 
5
5
  $gl-text-tertiary: #89888d !default;
6
6
  $gl-text-secondary: #737278 !default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gitlab/ui",
3
- "version": "78.1.1",
3
+ "version": "78.2.0",
4
4
  "description": "GitLab UI Components",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",
@@ -102,7 +102,7 @@
102
102
  "@gitlab/eslint-plugin": "19.4.0",
103
103
  "@gitlab/fonts": "^1.3.0",
104
104
  "@gitlab/stylelint-config": "6.1.0",
105
- "@gitlab/svgs": "3.88.0",
105
+ "@gitlab/svgs": "3.89.0",
106
106
  "@rollup/plugin-commonjs": "^11.1.0",
107
107
  "@rollup/plugin-node-resolve": "^7.1.3",
108
108
  "@rollup/plugin-replace": "^2.3.2",
@@ -7,9 +7,7 @@ const defaultValue = (prop) => GlPopover.props[prop].default;
7
7
  const components = { GlPopover, GlButton };
8
8
 
9
9
  const contentString = `
10
- Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent volutpat a nisi non
11
- pellentesque. Pellentesque efficitur vulputate rutrum. Fusce nisl magna, porttitor in
12
- massa ac, porta condimentum libero. Ut id lacus tristique, egestas arcu non, molestie nisi.
10
+ A popover is used to provide supplemental, useful, unique information about an element.
13
11
  `;
14
12
 
15
13
  const getTemplate = (id, slots = '') => `
@@ -58,6 +56,23 @@ WithCloseButton.args = generateProps({
58
56
  showCloseButton: true,
59
57
  });
60
58
 
59
+ export const TextLinks = (_args, { viewMode, argTypes }) => ({
60
+ viewMode,
61
+ components,
62
+ props: Object.keys(argTypes),
63
+ template: getTemplate(
64
+ 'popover-with-text-links',
65
+ `
66
+ <template>
67
+ A popover is used to provide supplemental, useful, unique information about an element. This one has a link to <a class="gl-link" href="https://design.gitlab.com/components/popover">learn more about popovers.</a>
68
+ </template>
69
+ `
70
+ ),
71
+ });
72
+ TextLinks.args = generateProps({
73
+ showCloseButton: true,
74
+ });
75
+
61
76
  export const OnClick = (_args, { viewMode, argTypes }) => ({
62
77
  viewMode,
63
78
  components,
@@ -17,6 +17,20 @@ table.gl-table {
17
17
  th {
18
18
  @include gl-font-weight-bold;
19
19
  @include gl-text-gray-900;
20
+
21
+ &.gl-text-right > span {
22
+ @include gl-display-flex;
23
+ flex-direction: row-reverse;
24
+
25
+ span:nth-of-type(2) {
26
+ @include gl-ml-0;
27
+ @include gl-mr-3;
28
+ }
29
+ }
30
+
31
+ [name='sort-icon'] {
32
+ user-select: none;
33
+ }
20
34
  }
21
35
 
22
36
  td {
@@ -121,3 +135,8 @@ table.gl-table {
121
135
  .table.b-table > tfoot > tr > th {
122
136
  background-image: none !important;
123
137
  }
138
+
139
+ .table.b-table > thead > tr > [aria-sort]:not(.b-table-sort-icon-left),
140
+ .table.b-table > tfoot > tr > [aria-sort]:not(.b-table-sort-icon-left) {
141
+ padding-right: 1rem;
142
+ }
@@ -3,7 +3,6 @@ import { shallowMount, mount } from '@vue/test-utils';
3
3
  import { BTable } from 'bootstrap-vue';
4
4
  import { logWarning } from '../../../utils/utils';
5
5
  import { waitForAnimationFrame } from '../../../utils/test_utils';
6
- import Icon from '../icon/icon.vue';
7
6
  import { glTableLiteWarning } from './constants';
8
7
  import Table from './table.vue';
9
8
 
@@ -100,20 +99,18 @@ describe('GlTable', () => {
100
99
  findFirstColHeader().trigger('click');
101
100
  await nextTick();
102
101
 
103
- const icon = findFirstColHeader().findComponent(Icon);
102
+ const headerText = findFirstColHeader().text();
104
103
 
105
- expect(icon.exists()).toBe(true);
106
- expect(icon.props('name')).toBe('arrow-up');
104
+ expect(headerText).toContain('↑');
107
105
  });
108
106
 
109
107
  it('renders the descending sort icon', async () => {
110
108
  findFirstColHeader().trigger('click');
111
109
  findFirstColHeader().trigger('click');
112
110
  await nextTick();
113
- const icon = findFirstColHeader().findComponent(Icon);
111
+ const headerText = findFirstColHeader().text();
114
112
 
115
- expect(icon.exists()).toBe(true);
116
- expect(icon.props('name')).toBe('arrow-down');
113
+ expect(headerText).toContain('↓');
117
114
  });
118
115
  });
119
116
 
@@ -136,11 +133,10 @@ describe('GlTable', () => {
136
133
  findFirstColHeader().trigger('click');
137
134
  await nextTick();
138
135
 
139
- const icon = findFirstColHeader().findComponent(Icon);
136
+ const headerText = findFirstColHeader().text();
140
137
 
141
- expect(icon.exists()).toBe(true);
142
- expect(icon.props('name')).toBe('arrow-up');
143
- expect(findFirstColHeader().text()).toContain(customSlotContent);
138
+ expect(headerText).toContain('↑');
139
+ expect(headerText).toContain(customSlotContent);
144
140
  });
145
141
  });
146
142
  });
@@ -7,15 +7,18 @@ const components = { GlTable };
7
7
  const tableItems = [
8
8
  {
9
9
  column_one: 'test',
10
- col_2: 1234,
10
+ col_2: 'ABC',
11
+ col_three: 1234,
11
12
  },
12
13
  {
13
14
  column_one: 'test2',
14
- col_2: 5678,
15
+ col_2: 'DEF',
16
+ col_three: 5678,
15
17
  },
16
18
  {
17
19
  column_one: 'test3',
18
- col_2: 9101,
20
+ col_2: 'GHI',
21
+ col_three: 9101,
19
22
  },
20
23
  ];
21
24
 
@@ -44,8 +47,9 @@ export const Default = (args, { argTypes }) => ({
44
47
  :fixed="fixed"
45
48
  :stacked="stacked"
46
49
  :foot-clone="footClone"
47
- sort-by="col_2"
50
+ sort-by="col_three"
48
51
  sort-desc
52
+ no-sort-reset
49
53
  hover
50
54
  selectable
51
55
  selected-variant="primary"
@@ -65,9 +69,16 @@ export const Default = (args, { argTypes }) => ({
65
69
  },
66
70
  {
67
71
  key: 'col_2',
72
+ label: 'Column 2',
73
+ formatter: (value) => value,
74
+ },
75
+ {
76
+ key: 'col_three',
68
77
  sortable: true,
69
78
  label: 'Column 2',
70
79
  formatter: (value) => value,
80
+ thClass: 'gl-text-right',
81
+ tdClass: 'gl-text-right',
71
82
  },
72
83
  ],
73
84
  items: tableItems,
@@ -1,7 +1,6 @@
1
1
  <!-- eslint-disable vue/multi-word-component-names -->
2
2
  <script>
3
3
  import { BTable } from 'bootstrap-vue';
4
- import GlIcon from '../icon/icon.vue';
5
4
  import { logWarning, isDev } from '../../../utils/utils';
6
5
  import { tableFullSlots, tableFullProps, glTableLiteWarning } from './constants';
7
6
 
@@ -18,7 +17,6 @@ export default {
18
17
  name: 'GlTable',
19
18
  components: {
20
19
  BTable,
21
- GlIcon,
22
20
  },
23
21
  inheritAttrs: false,
24
22
  props: {
@@ -98,17 +96,27 @@ export default {
98
96
  <slot :name="slotName" v-bind="scope"></slot>
99
97
  </template>
100
98
  <template v-for="headSlotName in headSlots" #[headSlotName]="scope">
101
- <div :key="headSlotName" class="gl-display-flex gl-align-items-center">
102
- <slot :name="headSlotName" v-bind="scope">{{ scope.label }}</slot
99
+ <span :key="headSlotName">
100
+ <slot :name="headSlotName" v-bind="scope"
101
+ ><span>{{ scope.label }}</span></slot
103
102
  ><template v-if="isSortable(scope)">
104
- <gl-icon
105
- v-if="getSortingIcon(scope)"
106
- :name="getSortingIcon(scope)"
107
- class="gl-ml-3 gl-min-w-5 gl-text-gray-900"
108
- />
109
- <div v-else class="gl-display-inline-block gl-w-5 gl-h-5 gl-ml-3"></div>
103
+ <span
104
+ v-if="getSortingIcon(scope) && getSortingIcon(scope) === 'arrow-up'"
105
+ class="gl-ml-3 gl-min-w-5 gl-text-gray-900 gl-text-center"
106
+ name="sort-icon"
107
+ >
108
+
109
+ </span>
110
+ <span
111
+ v-else-if="getSortingIcon(scope) && getSortingIcon(scope) === 'arrow-down'"
112
+ class="gl-ml-3 gl-min-w-5 gl-text-gray-900 gl-text-center"
113
+ name="sort-icon"
114
+ >
115
+
116
+ </span>
117
+ <span v-else class="gl-display-inline-block gl-w-5 gl-h-3 gl-ml-3"></span>
110
118
  </template>
111
- </div>
119
+ </span>
112
120
  </template>
113
121
  </b-table>
114
122
  </template>
@@ -213,6 +213,11 @@ $gl-transition-duration-slow: 0.4s;
213
213
  $gl-transition-duration-medium: 0.2s;
214
214
  $gl-transition-duration-fast: 0.1s;
215
215
 
216
+ // Animation easings
217
+ $gl-easing-linear: linear;
218
+ $gl-easing-default: ease;
219
+ $gl-easing-out-cubic: cubic-bezier(0.22, 0.61, 0.36, 1);
220
+
216
221
  // Focus ring
217
222
  $outline-offset: 1px;
218
223
  $outline-width: 2px;