@gitlab/ui 76.0.1 → 77.0.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 (52) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/dist/components/experimental/duo/chat/duo_chat.js +1 -1
  3. package/dist/index.css.map +1 -1
  4. package/dist/tokens/common_story_options.js +28 -8
  5. package/dist/tokens/css/tokens.css +4 -1
  6. package/dist/tokens/css/tokens.dark.css +1 -1
  7. package/dist/tokens/js/tokens.dark.js +1 -1
  8. package/dist/tokens/js/tokens.js +4 -1
  9. package/dist/tokens/json/tokens.dark.grouped.json +4 -1
  10. package/dist/tokens/json/tokens.dark.json +56 -0
  11. package/dist/tokens/json/tokens.grouped.json +4 -1
  12. package/dist/tokens/json/tokens.json +56 -0
  13. package/dist/tokens/scss/_tokens.dark.scss +1 -1
  14. package/dist/tokens/scss/_tokens.scss +4 -1
  15. package/dist/utility_classes.css +1 -1
  16. package/dist/utility_classes.css.map +1 -1
  17. package/package.json +1 -1
  18. package/src/components/base/alert/alert.scss +7 -7
  19. package/src/components/base/badge/badge.scss +1 -1
  20. package/src/components/base/banner/banner.scss +3 -3
  21. package/src/components/base/button/button.scss +2 -2
  22. package/src/components/base/card/card.scss +1 -1
  23. package/src/components/base/datepicker/datepicker.scss +5 -5
  24. package/src/components/base/drawer/drawer.scss +10 -10
  25. package/src/components/base/dropdown/dropdown_item.scss +1 -1
  26. package/src/components/base/filtered_search/filtered_search_suggestion_list.scss +1 -1
  27. package/src/components/base/form/form_checkbox/form_checkbox.scss +3 -3
  28. package/src/components/base/label/label.scss +1 -1
  29. package/src/components/base/loading_icon/loading_icon.scss +1 -1
  30. package/src/components/base/modal/modal.scss +1 -1
  31. package/src/components/base/new_dropdowns/dropdown.scss +1 -1
  32. package/src/components/base/new_dropdowns/dropdown_item.scss +1 -1
  33. package/src/components/base/new_dropdowns/listbox/listbox.scss +3 -3
  34. package/src/components/base/path/path.scss +8 -8
  35. package/src/components/base/search_box_by_click/search_box_by_click.scss +7 -7
  36. package/src/components/base/search_box_by_type/search_box_by_type.scss +5 -5
  37. package/src/components/base/tabs/tabs/tabs.scss +5 -5
  38. package/src/components/base/toast/toast.scss +5 -5
  39. package/src/components/base/toggle/toggle.scss +4 -4
  40. package/src/components/charts/heatmap/heatmap.scss +1 -1
  41. package/src/components/charts/legend/legend.scss +3 -3
  42. package/src/components/charts/tooltip/tooltip.scss +1 -1
  43. package/src/components/experimental/duo/chat/components/duo_chat_message/duo_chat_message.scss +3 -3
  44. package/src/components/experimental/duo/chat/duo_chat.vue +2 -2
  45. package/src/scss/tailwind.css +1 -0
  46. package/src/scss/utilities.scss +24 -430
  47. package/src/scss/utility-mixins/{appearance.scss → deprecated.scss} +9 -0
  48. package/src/scss/utility-mixins/index.scss +3 -2
  49. package/src/tokens/common_story_options.js +25 -5
  50. package/src/tokens/text.tokens.json +19 -0
  51. package/src/tokens/text.tokens.stories.js +15 -0
  52. package/src/scss/utility-mixins/position.scss +0 -223
@@ -9,21 +9,36 @@ const methods = {
9
9
  isAlpha(value) {
10
10
  return value.startsWith('rgba(');
11
11
  },
12
+ isBackgroundColor(property) {
13
+ return property === 'backgroundColor';
14
+ },
12
15
  getTokenName(token) {
13
16
  return token.path.filter(Boolean).join('.');
14
17
  },
15
- getTextColorClass(value) {
18
+ getClasses(property, value) {
16
19
  if (this.isAlpha(value)) return '';
20
+ if (!this.isBackgroundColor(property)) return '';
17
21
  const textColorVariant = colorFromBackground(value, 4.5);
18
22
  return {
19
23
  'gl-text-gray-950': textColorVariant === 'dark',
20
24
  'gl-text-white': textColorVariant === 'light'
21
25
  };
26
+ },
27
+ getStyle(property, value) {
28
+ if (this.isBackgroundColor(property)) {
29
+ return {
30
+ backgroundColor: value
31
+ };
32
+ }
33
+ return {
34
+ color: value
35
+ };
22
36
  }
23
37
  };
24
- const template = function () {
25
- let lightBackground = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : WHITE;
26
- let darkBackground = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : GRAY_950;
38
+ const colorTemplate = function () {
39
+ let property = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'backgroundColor';
40
+ let lightBackground = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : WHITE;
41
+ let darkBackground = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : GRAY_950;
27
42
  return `
28
43
  <ul
29
44
  class="gl-list-style-none gl-m-0 gl-p-0"
@@ -32,8 +47,8 @@ const template = function () {
32
47
  v-for="token in tokens"
33
48
  :key="token.name"
34
49
  class="gl-display-flex gl-flex-wrap gl-align-items-center gl-justify-content-space-between gl-gap-3 gl-p-3"
35
- :class="getTextColorClass(token.value)"
36
- :style="{ backgroundColor: token.value }"
50
+ :class="getClasses('${property}', token.value)"
51
+ :style="getStyle('${property}', token.value)"
37
52
  >
38
53
  <code class="gl-reset-color">{{ getTokenName(token) }}</code>
39
54
  <div class="gl-display-flex gl-align-items-center gl-gap-3">
@@ -48,7 +63,12 @@ const template = function () {
48
63
  const colorTokenStoryOptions = {
49
64
  components,
50
65
  methods,
51
- template: template()
66
+ template: colorTemplate('backgroundColor')
67
+ };
68
+ const colorTextTokenStoryOptions = {
69
+ components,
70
+ methods,
71
+ template: colorTemplate('color')
52
72
  };
53
73
 
54
- export { colorTokenStoryOptions, components, methods, template };
74
+ export { colorTextTokenStoryOptions, colorTokenStoryOptions, components, methods };
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Do not edit directly
3
- * Generated on Tue, 27 Feb 2024 00:47:04 GMT
3
+ * Generated on Tue, 27 Feb 2024 15:36:15 GMT
4
4
  */
5
5
 
6
6
  :root {
@@ -234,4 +234,7 @@
234
234
  --data-viz-green-200: #b0d97b;
235
235
  --data-viz-green-100: #c6ed94;
236
236
  --data-viz-green-50: #ddfab7;
237
+ --gl-text-tertiary: var(--gray-400);
238
+ --gl-text-secondary: var(--gray-500);
239
+ --gl-text-primary: var(--gray-900);
237
240
  }
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Do not edit directly
3
- * Generated on Tue, 27 Feb 2024 00:47:04 GMT
3
+ * Generated on Tue, 27 Feb 2024 15:36:15 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, 27 Feb 2024 00:47:04 GMT
3
+ * Generated on Tue, 27 Feb 2024 15:36:15 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, 27 Feb 2024 00:47:04 GMT
3
+ * Generated on Tue, 27 Feb 2024 15:36:15 GMT
4
4
  */
5
5
 
6
6
  export const DATA_VIZ_GREEN_50 = "#ddfab7";
@@ -233,3 +233,6 @@ export const GL_LINE_HEIGHT_36 = "2.25rem";
233
233
  export const GL_LINE_HEIGHT_42 = "2.625rem";
234
234
  export const GL_LINE_HEIGHT_44 = "2.75rem";
235
235
  export const GL_LINE_HEIGHT_52 = "3.25rem";
236
+ export const GL_TEXT_PRIMARY = "#333238";
237
+ export const GL_TEXT_SECONDARY = "#737278";
238
+ export const GL_TEXT_TERTIARY = "#89888d";
@@ -219,7 +219,10 @@
219
219
  "t-white-a-02": "rgba(255, 255, 255, 0.02)",
220
220
  "t-white-a-04": "rgba(255, 255, 255, 0.04)",
221
221
  "t-white-a-06": "rgba(255, 255, 255, 0.06)",
222
- "t-white-a-08": "rgba(255, 255, 255, 0.08)"
222
+ "t-white-a-08": "rgba(255, 255, 255, 0.08)",
223
+ "text-primary": "#ececef",
224
+ "text-secondary": "#89888d",
225
+ "text-tertiary": "#737278"
223
226
  },
224
227
  "dimension": {
225
228
  "line-height-12": "0.75rem",
@@ -4795,5 +4795,61 @@
4795
4795
  "52"
4796
4796
  ]
4797
4797
  }
4798
+ },
4799
+ "text": {
4800
+ "primary": {
4801
+ "value": "#ececef",
4802
+ "$type": "color",
4803
+ "themeable": true,
4804
+ "filePath": "/builds/gitlab-org/gitlab-ui/src/tokens/text.tokens.json",
4805
+ "isSource": false,
4806
+ "original": {
4807
+ "value": "{gray.900}",
4808
+ "$type": "color",
4809
+ "themeable": true
4810
+ },
4811
+ "name": "TEXT_PRIMARY",
4812
+ "attributes": {},
4813
+ "path": [
4814
+ "text",
4815
+ "primary"
4816
+ ]
4817
+ },
4818
+ "secondary": {
4819
+ "value": "#89888d",
4820
+ "$type": "color",
4821
+ "themeable": true,
4822
+ "filePath": "/builds/gitlab-org/gitlab-ui/src/tokens/text.tokens.json",
4823
+ "isSource": false,
4824
+ "original": {
4825
+ "value": "{gray.500}",
4826
+ "$type": "color",
4827
+ "themeable": true
4828
+ },
4829
+ "name": "TEXT_SECONDARY",
4830
+ "attributes": {},
4831
+ "path": [
4832
+ "text",
4833
+ "secondary"
4834
+ ]
4835
+ },
4836
+ "tertiary": {
4837
+ "value": "#737278",
4838
+ "$type": "color",
4839
+ "themeable": true,
4840
+ "filePath": "/builds/gitlab-org/gitlab-ui/src/tokens/text.tokens.json",
4841
+ "isSource": false,
4842
+ "original": {
4843
+ "value": "{gray.400}",
4844
+ "$type": "color",
4845
+ "themeable": true
4846
+ },
4847
+ "name": "TEXT_TERTIARY",
4848
+ "attributes": {},
4849
+ "path": [
4850
+ "text",
4851
+ "tertiary"
4852
+ ]
4853
+ }
4798
4854
  }
4799
4855
  }
@@ -219,7 +219,10 @@
219
219
  "t-white-a-02": "rgba(255, 255, 255, 0.02)",
220
220
  "t-white-a-04": "rgba(255, 255, 255, 0.04)",
221
221
  "t-white-a-06": "rgba(255, 255, 255, 0.06)",
222
- "t-white-a-08": "rgba(255, 255, 255, 0.08)"
222
+ "t-white-a-08": "rgba(255, 255, 255, 0.08)",
223
+ "text-primary": "#333238",
224
+ "text-secondary": "#737278",
225
+ "text-tertiary": "#89888d"
223
226
  },
224
227
  "dimension": {
225
228
  "line-height-12": "0.75rem",
@@ -4795,5 +4795,61 @@
4795
4795
  "52"
4796
4796
  ]
4797
4797
  }
4798
+ },
4799
+ "text": {
4800
+ "primary": {
4801
+ "value": "#333238",
4802
+ "$type": "color",
4803
+ "themeable": true,
4804
+ "filePath": "/builds/gitlab-org/gitlab-ui/src/tokens/text.tokens.json",
4805
+ "isSource": false,
4806
+ "original": {
4807
+ "value": "{gray.900}",
4808
+ "$type": "color",
4809
+ "themeable": true
4810
+ },
4811
+ "name": "TEXT_PRIMARY",
4812
+ "attributes": {},
4813
+ "path": [
4814
+ "text",
4815
+ "primary"
4816
+ ]
4817
+ },
4818
+ "secondary": {
4819
+ "value": "#737278",
4820
+ "$type": "color",
4821
+ "themeable": true,
4822
+ "filePath": "/builds/gitlab-org/gitlab-ui/src/tokens/text.tokens.json",
4823
+ "isSource": false,
4824
+ "original": {
4825
+ "value": "{gray.500}",
4826
+ "$type": "color",
4827
+ "themeable": true
4828
+ },
4829
+ "name": "TEXT_SECONDARY",
4830
+ "attributes": {},
4831
+ "path": [
4832
+ "text",
4833
+ "secondary"
4834
+ ]
4835
+ },
4836
+ "tertiary": {
4837
+ "value": "#89888d",
4838
+ "$type": "color",
4839
+ "themeable": true,
4840
+ "filePath": "/builds/gitlab-org/gitlab-ui/src/tokens/text.tokens.json",
4841
+ "isSource": false,
4842
+ "original": {
4843
+ "value": "{gray.400}",
4844
+ "$type": "color",
4845
+ "themeable": true
4846
+ },
4847
+ "name": "TEXT_TERTIARY",
4848
+ "attributes": {},
4849
+ "path": [
4850
+ "text",
4851
+ "tertiary"
4852
+ ]
4853
+ }
4798
4854
  }
4799
4855
  }
@@ -1,6 +1,6 @@
1
1
 
2
2
  // Do not edit directly
3
- // Generated on Tue, 27 Feb 2024 00:47:04 GMT
3
+ // Generated on Tue, 27 Feb 2024 15:36:15 GMT
4
4
 
5
5
  $red-950: #fff4f3;
6
6
  $red-900: #fcf1ef;
@@ -1,6 +1,6 @@
1
1
 
2
2
  // Do not edit directly
3
- // Generated on Tue, 27 Feb 2024 00:47:04 GMT
3
+ // Generated on Tue, 27 Feb 2024 15:36:15 GMT
4
4
 
5
5
  $gl-line-height-52: 3.25rem;
6
6
  $gl-line-height-44: 2.75rem;
@@ -232,3 +232,6 @@ $data-viz-green-300: #94c25e !default;
232
232
  $data-viz-green-200: #b0d97b !default;
233
233
  $data-viz-green-100: #c6ed94 !default;
234
234
  $data-viz-green-50: #ddfab7 !default;
235
+ $gl-text-tertiary: $gray-400 !default;
236
+ $gl-text-secondary: $gray-500 !default;
237
+ $gl-text-primary: $gray-900 !default;