@gitlab/ui 39.1.0 → 39.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 (40) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/dist/components/base/alert/alert.js +11 -1
  3. package/dist/index.css +2 -2
  4. package/dist/index.css.map +1 -1
  5. package/dist/utility_classes.css +1 -1
  6. package/dist/utility_classes.css.map +1 -1
  7. package/package.json +2 -2
  8. package/scss_to_js/scss_variables.js +6 -2
  9. package/scss_to_js/scss_variables.json +24 -4
  10. package/src/components/base/alert/alert.scss +4 -0
  11. package/src/components/base/alert/alert.spec.js +11 -0
  12. package/src/components/base/alert/alert.stories.js +14 -0
  13. package/src/components/base/alert/alert.vue +10 -0
  14. package/src/components/base/avatar_link/avatar_link.scss +1 -0
  15. package/src/components/base/badge/badge.scss +1 -1
  16. package/src/components/base/breadcrumb/breadcrumb.scss +1 -1
  17. package/src/components/base/button/button.scss +34 -34
  18. package/src/components/base/carousel/carousel.scss +7 -0
  19. package/src/components/base/datepicker/datepicker.scss +4 -0
  20. package/src/components/base/dropdown/dropdown.scss +8 -0
  21. package/src/components/base/dropdown/dropdown_item.scss +0 -1
  22. package/src/components/base/form/form_checkbox/form_checkbox.scss +1 -1
  23. package/src/components/base/form/form_input/form_input.scss +2 -2
  24. package/src/components/base/form/form_select/form_select.scss +2 -2
  25. package/src/components/base/label/label.scss +2 -1
  26. package/src/components/base/link/link.scss +1 -1
  27. package/src/components/base/link/link.stories.js +15 -0
  28. package/src/components/base/nav/nav.scss +7 -0
  29. package/src/components/base/pagination/pagination.scss +14 -7
  30. package/src/components/base/path/path.scss +29 -5
  31. package/src/components/base/search_box_by_click/search_box_by_click.scss +1 -1
  32. package/src/components/base/table/table.scss +6 -0
  33. package/src/components/base/token/token.scss +6 -0
  34. package/src/components/base/token_selector/token_selector.scss +2 -2
  35. package/src/components/shared_components/close_button/close_button.scss +11 -11
  36. package/src/scss/components.scss +3 -1
  37. package/src/scss/mixins.scss +26 -4
  38. package/src/scss/utilities.scss +0 -8
  39. package/src/scss/utility-mixins/outline.scss +1 -1
  40. package/src/scss/variables.scss +8 -4
@@ -6,7 +6,8 @@ $path-chevron-dimension: px-to-rem(24px);
6
6
  $path-chevron-border-radius: px-to-rem(10px);
7
7
  $path-chevron-tip-border-radius: px-to-rem(2px);
8
8
  $path-button-right-padding: 1.25 * $grid-size;
9
- $path-chevron-drop-shadow: drop-shadow(0 0 px-to-rem(1px) $blue-500);
9
+ $path-chevron-drop-shadow: drop-shadow(0 0 px-to-rem(1px) $white)
10
+ drop-shadow(0 0 px-to-rem(2px) $blue-500);
10
11
  $path-chevron-transformation: rotate(45deg) skew(14deg, 14deg);
11
12
  $path-chevron-right-margin: px-to-rem(14px);
12
13
 
@@ -46,14 +47,17 @@ $path-chevron-right-margin: px-to-rem(14px);
46
47
  @include gl-list-style-none;
47
48
  @include gl-display-inline-flex;
48
49
  @include gl-overflow-hidden;
50
+ margin-left: -1px;
49
51
  }
50
52
 
51
53
  .gl-path-nav-list-item {
52
- @include gl-overflow-hidden;
53
54
  @include gl-min-w-fit-content;
55
+ padding-top: 1px;
56
+ padding-bottom: 1px;
54
57
 
55
- &:focus-within {
56
- filter: $path-chevron-drop-shadow;
58
+ // Fix for custom focus
59
+ &:first-of-type {
60
+ padding-left: 1px;
57
61
  }
58
62
  }
59
63
 
@@ -74,10 +78,21 @@ $path-chevron-right-margin: px-to-rem(14px);
74
78
  padding-right: $path-button-right-padding;
75
79
  margin-right: $path-chevron-right-margin;
76
80
 
81
+ &::before,
77
82
  &::after {
78
83
  @include gl-path-chevron;
79
84
  }
80
85
 
86
+ // Pseudo focus element
87
+ &::before {
88
+ display: none;
89
+ z-index: 2;
90
+ right: calc(-0.75rem + 1px);
91
+ box-shadow: 0 0 0 1px $white, 0.5px -0.5px 0 2.5px $blue-400;
92
+ clip-path: polygon(0% 0%, 0% -30%, 160% 0%, 75% 130%, 100% 100%);
93
+ transform: rotate(45deg) skew(14deg, 14deg) scale(0.99);
94
+ }
95
+
81
96
  &[disabled] {
82
97
  @include gl-text-gray-400;
83
98
  @include gl-cursor-not-allowed;
@@ -91,7 +106,16 @@ $path-chevron-right-margin: px-to-rem(14px);
91
106
  &:active,
92
107
  &:focus,
93
108
  &:focus:active {
94
- @include gl-focus;
109
+ // Custom focus
110
+ border-top-right-radius: 1px;
111
+ border-bottom-right-radius: 1px;
112
+ box-shadow: 5px -3px 0 -2px $white, 5px 3px 0 -2px $white, 0 0 0 1px $white,
113
+ 0 0 0 3px $blue-400;
114
+ outline: none;
115
+
116
+ &::before {
117
+ display: block;
118
+ }
95
119
  }
96
120
  }
97
121
 
@@ -21,7 +21,7 @@
21
21
  .gl-search-box-by-click-close-history-button {
22
22
  @include gl-absolute;
23
23
  @include gl-top-0;
24
- @include gl-right-0;
24
+ @include gl-right-2;
25
25
  @include gl-line-height-0;
26
26
  @include gl-shadow-none;
27
27
  @include gl-w-auto;
@@ -22,6 +22,12 @@ table.gl-table {
22
22
  td {
23
23
  @include gl-text-gray-700;
24
24
  }
25
+
26
+ &:focus-visible {
27
+ @include gl-focus;
28
+ position: relative;
29
+ z-index: 1;
30
+ }
25
31
  }
26
32
 
27
33
  .table-primary,
@@ -41,4 +41,10 @@
41
41
  @include gl-mx-2;
42
42
  @include gl-reset-color;
43
43
  @include gl-cursor-pointer;
44
+ background-color: transparent !important;
45
+
46
+ &:focus,
47
+ &:hover:focus {
48
+ @include gl-focus($color: rgba($black, 0.5), $inset: true, $important: true);
49
+ }
44
50
  }
@@ -1,10 +1,10 @@
1
1
  // This is overridden in the `gitlab-org/gitlab` codebase so we need to increase specificity using `gl-token-selector`
2
2
  .gl-token-selector {
3
3
  &.gl-token-selector-focus-glow {
4
- @include gl-focus($gl-border-size-1, $gray-900, true);
4
+ @include gl-focus($color: $gray-900, $important: true);
5
5
 
6
6
  &.is-invalid {
7
- @include gl-focus($gl-border-size-1, $red-500, true);
7
+ @include gl-focus($color: $red-500, $important: true);
8
8
  }
9
9
  }
10
10
  }
@@ -1,21 +1,21 @@
1
1
  .gl-close-btn-color-inherit {
2
- color: inherit !important;
3
2
  mix-blend-mode: luminosity !important;
4
3
 
5
- &:hover {
6
- background-color: $gray-300 !important;
7
- }
8
-
9
- &:focus {
10
- background-color: $gray-400 !important;
4
+ &,
5
+ &:focus .gl-icon,
6
+ &:not(:hover) .gl-icon {
7
+ color: inherit !important;
11
8
  }
12
9
 
10
+ &:focus,
13
11
  &:active,
14
12
  &.active {
15
- background-color: $gray-400 !important;
16
- }
13
+ mix-blend-mode: initial !important;
14
+ @include gl-focus($important: true, $focus-ring: $focus-ring-dark);
17
15
 
18
- .gl-icon {
19
- color: inherit !important;
16
+ .gl-icon {
17
+ background-color: transparent;
18
+ mix-blend-mode: difference;
19
+ }
20
20
  }
21
21
  }
@@ -17,9 +17,10 @@
17
17
  @import '../components/base/avatars_inline/avatars_inline';
18
18
  @import '../components/base/badge/badge';
19
19
  @import '../components/base/breadcrumb/breadcrumb';
20
- @import '../components/base/datepicker/datepicker';
21
20
  @import '../components/base/banner/banner';
22
21
  @import '../components/base/broadcast_message/broadcast_message';
22
+ @import '../components/base/carousel/carousel';
23
+ @import '../components/base/datepicker/datepicker';
23
24
  @import '../components/base/daterange_picker/daterange_picker';
24
25
  @import '../components/base/drawer/drawer';
25
26
  @import '../components/base/dropdown/dropdown';
@@ -48,6 +49,7 @@
48
49
  @import '../components/base/loading_icon/loading_icon';
49
50
  @import '../components/base/markdown/markdown';
50
51
  @import '../components/base/modal/modal';
52
+ @import '../components/base/nav/nav';
51
53
  @import '../components/base/navbar/navbar';
52
54
  @import '../components/base/button/button';
53
55
  @import '../components/base/pagination/pagination';
@@ -47,18 +47,40 @@
47
47
  }
48
48
  }
49
49
 
50
- @mixin gl-focus($size: null, $color: false, $important: false, $inset: false) {
50
+ /**
51
+ * Helper function for :focus
52
+ *
53
+ * @param $size is deprecated and should not be used anymore
54
+ */
55
+ @mixin gl-focus(
56
+ $size: null,
57
+ $color: false,
58
+ $important: false,
59
+ $inset: false,
60
+ $focus-ring: $focus-ring,
61
+ $outline: false,
62
+ $outline-offset: $outline-offset
63
+ ) {
51
64
  @if $inset == true {
52
65
  @if $color {
53
- box-shadow: inset 0 0 0 $size $color, $focus-ring-inset if-important($important);
66
+ box-shadow: inset 0 0 0 $outline-width $blue-400,
67
+ inset 0 0 0 #{$outline-width + $outline-offset} $white,
68
+ inset 0 0 0 #{$outline-width + $outline-offset + 1px} $color,
69
+ $focus-ring-inset if-important($important);
54
70
  outline: none if-important($important);
71
+ } @else if $outline == true {
72
+ outline: $focus-ring-outline if-important($important);
73
+ outline-offset: $outline-offset;
55
74
  } @else {
56
- box-shadow: $focus-ring-inset if-important($important);
75
+ box-shadow: inset 0 0 0 $outline-width $blue-400, $focus-ring-inset if-important($important);
57
76
  outline: none if-important($important);
58
77
  }
59
78
  } @else if $color {
60
- box-shadow: inset 0 0 0 $size $color, $focus-ring if-important($important);
79
+ box-shadow: inset 0 0 0 $gl-border-size-1 $color, $focus-ring if-important($important);
61
80
  outline: none if-important($important);
81
+ } @else if $outline == true {
82
+ outline: $focus-ring-outline if-important($important);
83
+ outline-offset: $outline-offset;
62
84
  } @else {
63
85
  box-shadow: $focus-ring if-important($important);
64
86
  outline: none if-important($important);
@@ -3607,17 +3607,9 @@
3607
3607
  outline: none
3608
3608
  }
3609
3609
 
3610
- .gl-focus-outline-none:focus {
3611
- outline: none
3612
- }
3613
-
3614
3610
  .gl-outline-none\! {
3615
3611
  outline: none !important
3616
3612
  }
3617
-
3618
- .gl-focus-outline-none\!:focus {
3619
- outline: none !important
3620
- }
3621
3613
  .gl-overflow-hidden {
3622
3614
  overflow: hidden
3623
3615
  }
@@ -7,6 +7,6 @@
7
7
  outline: 0;
8
8
  }
9
9
 
10
- @mixin gl-outline-none($focus: true) {
10
+ @mixin gl-outline-none {
11
11
  outline: none;
12
12
  }
@@ -417,10 +417,14 @@ $gl-transition-duration-slow: 0.4s;
417
417
  $gl-transition-duration-medium: 0.2s;
418
418
 
419
419
  // Focus ring
420
- $focus-ring: 0 0 0 $gl-border-size-1 rgba($white, 0.4),
421
- 0 0 0 $gl-border-size-4 rgba($blue-500, 0.48);
422
- $focus-ring-inset: inset 0 0 0 $gl-border-size-3 rgba($blue-500, 0.48),
423
- inset 0 0 0 $gl-border-size-4 rgba($white, 0.4);
420
+ $outline-offset: 1px;
421
+ $outline-width: 2px;
422
+ $focus-ring: 0 0 0 $outline-offset $white, 0 0 0 #{$outline-offset + $outline-width} $blue-400;
423
+ $focus-ring-inset: inset 0 0 0 #{$outline-width + $outline-offset} $white,
424
+ inset 0 0 0 $outline-offset $white;
425
+ $focus-ring-dark: 0 0 0 $outline-offset rgba($black, 0.6),
426
+ 0 0 0 #{$outline-offset + $outline-width} $blue-300;
427
+ $focus-ring-outline: $outline-width solid $blue-400;
424
428
 
425
429
  // Toasts
426
430
  $toast-max-width: px-to-rem(586px);