@gitlab/ui 77.1.0 → 77.3.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 (35) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/dist/components/base/new_dropdowns/base_dropdown/base_dropdown.js +10 -3
  3. package/dist/components/base/sorting/sorting.js +1 -4
  4. package/dist/index.css +2 -2
  5. package/dist/index.css.map +1 -1
  6. package/dist/tokens/common_story_options.js +28 -68
  7. package/dist/tokens/css/tokens.css +1 -1
  8. package/dist/tokens/css/tokens.dark.css +1 -1
  9. package/dist/tokens/js/tokens.dark.js +1 -1
  10. package/dist/tokens/js/tokens.js +1 -1
  11. package/dist/tokens/scss/_tokens.dark.scss +1 -1
  12. package/dist/tokens/scss/_tokens.scss +1 -1
  13. package/dist/tokens/tokens_story.js +83 -0
  14. package/package.json +1 -1
  15. package/src/components/base/button/button.stories.js +0 -30
  16. package/src/components/base/button_group/button_group.md +22 -0
  17. package/src/components/base/button_group/button_group.stories.js +92 -12
  18. package/src/components/base/new_dropdowns/base_dropdown/base_dropdown.spec.js +1 -1
  19. package/src/components/base/new_dropdowns/base_dropdown/base_dropdown.vue +8 -1
  20. package/src/components/base/new_dropdowns/disclosure/disclosure_dropdown.md +13 -9
  21. package/src/components/base/new_dropdowns/disclosure/disclosure_dropdown.scss +0 -32
  22. package/src/components/base/new_dropdowns/dropdown.scss +58 -2
  23. package/src/components/base/new_dropdowns/listbox/listbox.md +19 -15
  24. package/src/components/base/sorting/sorting.vue +1 -9
  25. package/src/tokens/color.dark.tokens.stories.js +8 -38
  26. package/src/tokens/color.data_viz.dark.tokens.stories.js +7 -27
  27. package/src/tokens/color.data_viz.tokens.stories.js +7 -27
  28. package/src/tokens/color.theme.dark.tokens.stories.js +8 -32
  29. package/src/tokens/color.theme.tokens.stories.js +8 -32
  30. package/src/tokens/color.tokens.stories.js +8 -38
  31. package/src/tokens/color.transparency.tokens.stories.js +5 -14
  32. package/src/tokens/common_story_options.js +21 -67
  33. package/src/tokens/text.tokens.stories.js +4 -7
  34. package/src/tokens/tokens_story.vue +73 -0
  35. package/tailwind.defaults.js +6 -0
@@ -0,0 +1,73 @@
1
+ <script>
2
+ import { colorFromBackground } from '../utils/utils';
3
+ import GlColorContrast from '../internal/color_contrast/color_contrast.vue';
4
+
5
+ export default {
6
+ name: 'TokensStory',
7
+ components: {
8
+ GlColorContrast,
9
+ },
10
+ inject: ['isBackgroundColorStory', 'lightBackground', 'darkBackground', 'containerClass'],
11
+ props: {
12
+ tokens: {
13
+ type: Object,
14
+ required: false,
15
+ default: () => ({}),
16
+ },
17
+ },
18
+ methods: {
19
+ isAlpha(value) {
20
+ return value.startsWith('rgba(');
21
+ },
22
+ getTokenName(token) {
23
+ return token.path.filter(Boolean).join('.');
24
+ },
25
+ getClasses(value) {
26
+ if (this.isAlpha(value)) return '';
27
+ if (!this.isBackgroundColorStory) return '';
28
+
29
+ const textColorVariant = colorFromBackground(value, 4.5);
30
+ return {
31
+ 'gl-text-gray-950': textColorVariant === 'dark',
32
+ 'gl-text-white': textColorVariant === 'light',
33
+ };
34
+ },
35
+ getStyle(value) {
36
+ if (this.isBackgroundColorStory) {
37
+ return { backgroundColor: value };
38
+ }
39
+
40
+ return { color: value };
41
+ },
42
+ },
43
+ };
44
+ </script>
45
+
46
+ <template>
47
+ <div :class="containerClass">
48
+ <ul class="gl-list-style-none gl-m-0 gl-p-0">
49
+ <li
50
+ v-for="token in tokens"
51
+ :key="token.name"
52
+ class="gl-display-flex gl-flex-wrap gl-align-items-center gl-justify-content-space-between gl-gap-3 gl-p-3"
53
+ :class="getClasses(token.value)"
54
+ :style="getStyle(token.value)"
55
+ >
56
+ <code class="gl-reset-color">{{ getTokenName(token) }}</code>
57
+ <div class="gl-display-flex gl-align-items-center gl-gap-3">
58
+ <code class="gl-reset-color">{{ token.value }}</code>
59
+ <gl-color-contrast
60
+ v-if="!isAlpha(token.value)"
61
+ :foreground="token.value"
62
+ :background="darkBackground"
63
+ />
64
+ <gl-color-contrast
65
+ v-if="!isAlpha(token.value)"
66
+ :foreground="token.value"
67
+ :background="lightBackground"
68
+ />
69
+ </div>
70
+ </li>
71
+ </ul>
72
+ </div>
73
+ </template>
@@ -59,6 +59,12 @@ const spacing = {
59
59
  module.exports = {
60
60
  prefix: 'gl-',
61
61
  theme: {
62
+ screens: {
63
+ sm: '576px',
64
+ md: '768px',
65
+ lg: '992px',
66
+ xl: '1200px',
67
+ },
62
68
  colors: {
63
69
  white: `var(--white, ${baseColorTokens.white.$value})`,
64
70
  black: `var(--black, ${baseColorTokens.black.$value})`,