@gitlab/ui 77.3.0 → 77.5.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gitlab/ui",
3
- "version": "77.3.0",
3
+ "version": "77.5.0",
4
4
  "description": "GitLab UI Components",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",
@@ -17,6 +17,7 @@
17
17
  transition: none;
18
18
  }
19
19
 
20
+ /* TODO: Avoid mixing duo-chat styles with other GitLab UI components not intended as utilities. Refactor and remove all `gl-drawer` instances out of this file. */
20
21
  .gl-drawer-body-scrim-on-footer {
21
22
  &::before {
22
23
  background: linear-gradient(to bottom, rgba($gray-10, 0), $gray-10);
@@ -26,6 +27,11 @@
26
27
  .gl-drawer-body {
27
28
  overflow-y: auto;
28
29
  }
30
+
31
+ .gl-drawer-header,
32
+ .gl-drawer-body > * {
33
+ @include gl-p-5;
34
+ }
29
35
  }
30
36
 
31
37
  .duo-chat-history {
@@ -355,7 +355,7 @@ export default {
355
355
  <aside
356
356
  v-if="!isHidden"
357
357
  id="chat-component"
358
- class="markdown-code-block gl-drawer gl-drawer-default gl-max-h-full gl-bottom-0 gl-shadow-none gl-border-l gl-border-t duo-chat"
358
+ class="markdown-code-block gl-drawer gl-max-h-full gl-bottom-0 gl-shadow-none gl-border-l gl-border-t duo-chat"
359
359
  role="complementary"
360
360
  data-testid="chat-component"
361
361
  >
@@ -3915,6 +3915,18 @@ $gl-animate-skeleton-loader-max-width: 64 * $grid-size;
3915
3915
  }
3916
3916
  }
3917
3917
 
3918
+ .gl-md-justify-content-center {
3919
+ @include gl-media-breakpoint-up(md) {
3920
+ justify-content: center;
3921
+ }
3922
+ }
3923
+
3924
+ .gl-md-justify-content-center\! {
3925
+ @include gl-media-breakpoint-up(md) {
3926
+ justify-content: center !important;
3927
+ }
3928
+ }
3929
+
3918
3930
  .gl-md-justify-content-end {
3919
3931
  @include gl-media-breakpoint-up(md) {
3920
3932
  justify-content: flex-end;
@@ -271,6 +271,12 @@
271
271
  }
272
272
  }
273
273
 
274
+ @mixin gl-md-justify-content-center {
275
+ @include gl-media-breakpoint-up(md) {
276
+ @include gl-justify-content-center;
277
+ }
278
+ }
279
+
274
280
  @mixin gl-md-justify-content-end {
275
281
  @include gl-media-breakpoint-up(md) {
276
282
  @include gl-justify-content-end;
@@ -0,0 +1,19 @@
1
+ {
2
+ "text": {
3
+ "primary": {
4
+ "$value": "#ececef",
5
+ "$type": "color",
6
+ "themeable": true
7
+ },
8
+ "secondary": {
9
+ "$value": "#89888d",
10
+ "$type": "color",
11
+ "themeable": true
12
+ },
13
+ "tertiary": {
14
+ "$value": "#737278",
15
+ "$type": "color",
16
+ "themeable": true
17
+ }
18
+ }
19
+ }
@@ -0,0 +1,13 @@
1
+ import COMPILED_TOKENS from '../../dist/tokens/json/tokens.dark.json';
2
+ import { createDesignTokenStory } from './common_story_options';
3
+
4
+ export const Default = createDesignTokenStory({
5
+ containerClass: 'gl-bg-gray-950',
6
+ tokens: COMPILED_TOKENS.text,
7
+ isBackgroundColorStory: false,
8
+ });
9
+
10
+ // eslint-disable-next-line storybook/csf-component
11
+ export default {
12
+ title: 'tokens/text/dark',
13
+ };
@@ -1,17 +1,17 @@
1
1
  {
2
2
  "text": {
3
3
  "primary": {
4
- "$value": "{gray.900}",
4
+ "$value": "#333238",
5
5
  "$type": "color",
6
6
  "themeable": true
7
7
  },
8
8
  "secondary": {
9
- "$value": "{gray.500}",
9
+ "$value": "#737278",
10
10
  "$type": "color",
11
11
  "themeable": true
12
12
  },
13
13
  "tertiary": {
14
- "$value": "{gray.400}",
14
+ "$value": "#89888d",
15
15
  "$type": "color",
16
16
  "themeable": true
17
17
  }
@@ -8,5 +8,5 @@ export const Default = createDesignTokenStory({
8
8
 
9
9
  // eslint-disable-next-line storybook/csf-component
10
10
  export default {
11
- title: 'tokens/text',
11
+ title: 'tokens/text/light',
12
12
  };
@@ -1,23 +1,36 @@
1
- const baseColorTokens = require('./src/tokens/color.tokens.json');
2
- const themeColorTokens = require('./src/tokens/color.theme.tokens.json');
1
+ const COMPILED_TOKENS = require('./dist/tokens/json/tokens.json');
2
+
3
+ const cssCustomPropertyWithValue = (token) => {
4
+ const path = [token.prefix !== false ? 'gl' : false, ...token.path].filter(Boolean);
5
+ return `var(--${path.join('-')}, ${token.value})`;
6
+ };
3
7
 
4
8
  const baseColors = ['blue', 'gray', 'green', 'orange', 'purple', 'red'].reduce((acc, color) => {
5
- acc[color] = {};
6
- Object.entries(baseColorTokens[color]).forEach(([shade, { $value }]) => {
7
- acc[color][shade] = `var(--${color}-${shade}, ${$value})`;
9
+ Object.entries(COMPILED_TOKENS[color]).forEach(([, token]) => {
10
+ acc[token.path.join('-')] = cssCustomPropertyWithValue(token);
8
11
  });
9
12
  return acc;
10
13
  }, {});
11
14
 
12
- const themeColors = Object.entries(themeColorTokens.theme).reduce((acc, [color, shades]) => {
13
- const colorKey = `theme-${color}`;
14
- acc[colorKey] = {};
15
- Object.entries(shades).forEach(([shade, { $value }]) => {
16
- acc[colorKey][shade] = `var(--${colorKey}-${shade}, ${$value})`;
15
+ const themeColors = Object.entries(COMPILED_TOKENS.theme).reduce((acc, [, scales]) => {
16
+ Object.entries(scales).forEach(([, token]) => {
17
+ acc[token.path.join('-')] = cssCustomPropertyWithValue(token);
17
18
  });
18
19
  return acc;
19
20
  }, {});
20
21
 
22
+ const textColors = Object.entries(COMPILED_TOKENS.text).reduce((acc, [scale, token]) => {
23
+ acc[scale] = cssCustomPropertyWithValue(token);
24
+ return acc;
25
+ }, {});
26
+
27
+ const colors = {
28
+ white: cssCustomPropertyWithValue(COMPILED_TOKENS.white),
29
+ black: cssCustomPropertyWithValue(COMPILED_TOKENS.black),
30
+ ...baseColors,
31
+ ...themeColors,
32
+ };
33
+
21
34
  const gridSize = 0.5; // rem
22
35
  const spacing = {
23
36
  0: '0',
@@ -65,12 +78,7 @@ module.exports = {
65
78
  lg: '992px',
66
79
  xl: '1200px',
67
80
  },
68
- colors: {
69
- white: `var(--white, ${baseColorTokens.white.$value})`,
70
- black: `var(--black, ${baseColorTokens.black.$value})`,
71
- ...baseColors,
72
- ...themeColors,
73
- },
81
+ colors,
74
82
  spacing,
75
83
  fontSize: {
76
84
  xs: '0.625rem',
@@ -85,5 +93,9 @@ module.exports = {
85
93
  semibold: 500,
86
94
  bold: 600,
87
95
  },
96
+ textColor: {
97
+ ...colors,
98
+ ...textColors,
99
+ },
88
100
  },
89
101
  };