@gitlab/ui 79.2.0 → 79.4.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.
@@ -3,7 +3,12 @@ import { createDesignTokenStory } from './common_story_options';
3
3
 
4
4
  export const Default = createDesignTokenStory({
5
5
  containerClass: 'gl-bg-gray-950',
6
- tokens: COMPILED_TOKENS.text,
6
+ tokens: {
7
+ primary: COMPILED_TOKENS.text.primary,
8
+ secondary: COMPILED_TOKENS.text.secondary,
9
+ tertiary: COMPILED_TOKENS.text.tertiary,
10
+ ...COMPILED_TOKENS.text.color,
11
+ },
7
12
  isBackgroundColorStory: false,
8
13
  });
9
14
 
@@ -3,17 +3,73 @@
3
3
  "primary": {
4
4
  "$value": "#333238",
5
5
  "$type": "color",
6
+ "$description": "Use text.color.strong instead",
7
+ "deprecated": true,
6
8
  "themeable": true
7
9
  },
8
10
  "secondary": {
9
11
  "$value": "#737278",
10
12
  "$type": "color",
13
+ "$description": "Use text.color.subtle instead",
14
+ "deprecated": true,
11
15
  "themeable": true
12
16
  },
13
17
  "tertiary": {
14
18
  "$value": "#89888d",
15
19
  "$type": "color",
20
+ "$description": "Use text.color.disabled instead",
21
+ "deprecated": true,
16
22
  "themeable": true
23
+ },
24
+ "color": {
25
+ "default": {
26
+ "$value": "#434248",
27
+ "$type": "color",
28
+ "$description": "Used for the default text color.",
29
+ "themeable": true
30
+ },
31
+ "subtle": {
32
+ "$value": "#626168",
33
+ "$type": "color",
34
+ "$description": "Used for supplemental text that doesn't need to be as prominent as other text.",
35
+ "themeable": true
36
+ },
37
+ "strong": {
38
+ "$value": "#1f1e24",
39
+ "$type": "color",
40
+ "$description": "Used for text with the highest contrast.",
41
+ "themeable": true
42
+ },
43
+ "heading": {
44
+ "$value": "#1f1e24",
45
+ "$type": "color",
46
+ "$description": "Used for headings level 1-6.",
47
+ "themeable": true
48
+ },
49
+ "link": {
50
+ "$value": "#0b5cad",
51
+ "$type": "color",
52
+ "$description": "Used for default text links.",
53
+ "themeable": true
54
+ },
55
+ "danger": {
56
+ "$value": "#c91c00",
57
+ "$type": "color",
58
+ "$description": "Used for text indicating a problem, critical state, destructive action, error, failure, removal, stop, or declination.",
59
+ "themeable": true
60
+ },
61
+ "success": {
62
+ "$value": "#217645",
63
+ "$type": "color",
64
+ "$description": "Used for text indicating success or validity.",
65
+ "themeable": true
66
+ },
67
+ "disabled": {
68
+ "$value": "#89888d",
69
+ "$type": "color",
70
+ "$description": "Used for disabled text.",
71
+ "themeable": true
72
+ }
17
73
  }
18
74
  }
19
75
  }
@@ -2,7 +2,12 @@ import COMPILED_TOKENS from '../../dist/tokens/json/tokens.json';
2
2
  import { createDesignTokenStory } from './common_story_options';
3
3
 
4
4
  export const Default = createDesignTokenStory({
5
- tokens: COMPILED_TOKENS.text,
5
+ tokens: {
6
+ primary: COMPILED_TOKENS.text.primary,
7
+ secondary: COMPILED_TOKENS.text.secondary,
8
+ tertiary: COMPILED_TOKENS.text.tertiary,
9
+ ...COMPILED_TOKENS.text.color,
10
+ },
6
11
  isBackgroundColorStory: false,
7
12
  });
8
13
 
@@ -1,12 +1,18 @@
1
1
  <script>
2
2
  import { colorFromBackground } from '../utils/utils';
3
+ import { GlTooltipDirective } from '../directives/tooltip';
4
+ import GlBadge from '../components/base/badge/badge.vue';
3
5
  import GlColorContrast from '../internal/color_contrast/color_contrast.vue';
4
6
 
5
7
  export default {
6
8
  name: 'TokensStory',
7
9
  components: {
10
+ GlBadge,
8
11
  GlColorContrast,
9
12
  },
13
+ directives: {
14
+ GlTooltip: GlTooltipDirective,
15
+ },
10
16
  inject: ['isBackgroundColorStory', 'lightBackground', 'darkBackground', 'containerClass'],
11
17
  props: {
12
18
  tokens: {
@@ -53,8 +59,13 @@ export default {
53
59
  :class="getClasses(token.value)"
54
60
  :style="getStyle(token.value)"
55
61
  >
56
- <code class="gl-reset-color">{{ getTokenName(token) }}</code>
62
+ <code v-gl-tooltip :title="token.comment" class="gl-reset-color">
63
+ {{ getTokenName(token) }}
64
+ </code>
57
65
  <div class="gl-display-flex gl-align-items-center gl-gap-3">
66
+ <gl-badge v-if="token.deprecated" v-gl-tooltip :title="token.comment" variant="danger">
67
+ Deprecated
68
+ </gl-badge>
58
69
  <code class="gl-reset-color">{{ token.value }}</code>
59
70
  <gl-color-contrast
60
71
  v-if="!isAlpha(token.value)"
@@ -26,7 +26,7 @@ const dataVizColors = Object.entries(COMPILED_TOKENS['data-viz']).reduce((acc, [
26
26
  return acc;
27
27
  }, {});
28
28
 
29
- const textColors = Object.entries(COMPILED_TOKENS.text).reduce((acc, [scale, token]) => {
29
+ const textColors = Object.entries(COMPILED_TOKENS.text.color).reduce((acc, [scale, token]) => {
30
30
  acc[scale] = cssCustomPropertyWithValue(token);
31
31
  return acc;
32
32
  }, {});
@@ -40,6 +40,14 @@ const colors = {
40
40
  ...dataVizColors,
41
41
  };
42
42
 
43
+ const textColor = {
44
+ ...colors,
45
+ ...textColors,
46
+ primary: cssCustomPropertyWithValue(COMPILED_TOKENS.text.primary),
47
+ secondary: cssCustomPropertyWithValue(COMPILED_TOKENS.text.secondary),
48
+ tertiary: cssCustomPropertyWithValue(COMPILED_TOKENS.text.tertiary),
49
+ };
50
+
43
51
  const gridSize = 0.5; // rem
44
52
  const spacing = {
45
53
  0: '0',
@@ -102,9 +110,6 @@ module.exports = {
102
110
  semibold: 500,
103
111
  bold: 600,
104
112
  },
105
- textColor: {
106
- ...colors,
107
- ...textColors,
108
- },
113
+ textColor,
109
114
  },
110
115
  };