vanilla-framework 3.2.0 → 3.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.
package/package.json CHANGED
@@ -44,7 +44,7 @@
44
44
  "percy": "percy exec -- node snapshots.js",
45
45
  "icon-svgs-to-mixins": "node scripts/convert-svgs-to-icon-mixins.js icons"
46
46
  },
47
- "version": "3.2.0",
47
+ "version": "3.3.0",
48
48
  "files": [
49
49
  "_index.scss",
50
50
  "/scss",
@@ -16,48 +16,45 @@
16
16
  }
17
17
 
18
18
  .p-accordion__tab {
19
- // calculate icon top position based on top padding (from %single-border-text-vpadding--scaling)
20
- // and offset to align it with baseline of accordion tab text element
21
- $icon-top-position: calc(#{$table-cell-vertical-padding + (map-get($line-heights, default-text) - $icon-size) * 0.5});
22
-
23
19
  @extend %single-border-text-vpadding--scaling;
24
20
  @include vf-focus;
25
21
 
26
- background: {
27
- color: inherit;
28
- position: top $icon-top-position left $sph--large;
29
- repeat: no-repeat;
30
- }
31
-
22
+ background-color: inherit;
32
23
  border: 0;
33
24
  border-radius: 0;
34
25
  font-size: inherit;
35
26
  justify-content: flex-start;
36
27
  margin-bottom: 0;
37
- padding-left: $sph--large + $icon-size + $sph--large;
38
28
  padding-right: $sph--large;
29
+ position: relative;
39
30
  text-align: left;
40
31
  transition-duration: 0s;
41
32
  width: 100%;
42
33
  z-index: 2;
43
34
 
35
+ &::before {
36
+ @include vf-icon-chevron($color-mid-dark);
37
+ @include vf-animation($property: transform, $duration: fast);
38
+ @extend %icon;
39
+
40
+ content: '';
41
+ margin-right: $sph--large;
42
+ }
43
+
44
44
  // aria-selected controls the open and closed state for the accordion tab
45
45
  &[aria-expanded='true'] {
46
- @include vf-icon-minus($color-mid-dark);
47
-
48
46
  // override base expanded button styles
49
47
  background-color: inherit;
48
+
50
49
  &:hover {
51
50
  background-color: $colors--light-theme--background-hover;
52
51
  }
53
-
54
- background-size: $icon-size;
55
52
  }
56
53
 
57
54
  &[aria-expanded='false'] {
58
- @include vf-icon-plus($color-mid-dark);
59
-
60
- background-size: $icon-size;
55
+ &::before {
56
+ transform: rotate(-90deg);
57
+ }
61
58
  }
62
59
  }
63
60
 
@@ -74,25 +71,17 @@
74
71
  }
75
72
 
76
73
  // stylelint-disable selector-max-type
77
- h2.p-accordion__heading > .p-accordion__tab,
78
- .p-heading--2 > .p-accordion__tab {
79
- $icon-top-position: calc(#{$table-cell-vertical-padding + (map-get($line-heights, h2) - $icon-size) * 0.5});
80
-
81
- background-position-y: $icon-top-position;
74
+ .p-heading--2 > .p-accordion__tab::before,
75
+ h2.p-accordion__heading > .p-accordion__tab::before {
76
+ @include vf-icon-size($x-height);
77
+ vertical-align: 0;
82
78
  }
83
79
 
84
- h3.p-accordion__heading > .p-accordion__tab,
85
- .p-heading--3 > .p-accordion__tab {
86
- $icon-top-position: calc(#{$table-cell-vertical-padding + (map-get($line-heights, h3) - $icon-size) * 0.5});
87
-
88
- background-position-y: $icon-top-position;
89
- }
90
-
91
- h4.p-accordion__heading > .p-accordion__tab,
92
- .p-heading--4 > .p-accordion__tab {
93
- $icon-top-position: calc(#{$table-cell-vertical-padding + (map-get($line-heights, h4) - $icon-size) * 0.5});
94
-
95
- background-position-y: $icon-top-position;
80
+ .p-heading--3 > .p-accordion__tab::before,
81
+ .p-heading--4 > .p-accordion__tab::before,
82
+ h3.p-accordion__heading > .p-accordion__tab::before,
83
+ h4.p-accordion__heading > .p-accordion__tab::before {
84
+ vertical-align: 0;
96
85
  }
97
86
  // stylelint-enable selector-max-type
98
87
 
@@ -1,9 +1,14 @@
1
- @mixin vf-p-tab-buttons {
1
+ @mixin vf-p-segmented-control {
2
+ .p-segmented-control,
3
+ // p-tab-buttons is deprecated,
4
+ // please use p-segmented-control instead
2
5
  .p-tab-buttons {
6
+ .p-segmented-control__list,
3
7
  .p-tab-buttons__list {
4
8
  display: flex;
5
9
  }
6
10
 
11
+ .p-segmented-control__button,
7
12
  .p-tab-buttons__button {
8
13
  @extend %vf-button-has-icon;
9
14
 
@@ -41,8 +46,14 @@
41
46
  }
42
47
  }
43
48
 
49
+ &.is-dense .p-segmented-control__button,
44
50
  &.is-dense .p-tab-buttons__button {
45
51
  @extend %vf-button-dense-vertical-padding;
46
52
  }
47
53
  }
48
54
  }
55
+
56
+ // Deprecated mixin kept for compatibility
57
+ @mixin vf-p-tab-buttons {
58
+ @include vf-p-segmented-control;
59
+ }
@@ -35,8 +35,11 @@
35
35
 
36
36
  .p-side-navigation:target &,
37
37
  [class*='p-side-navigation--']:target &,
38
+ // is-expanded and is-collapsed are deprecated and replaced by is-drawer-expanded and is-drawer-collapsed
38
39
  .p-side-navigation.is-expanded &,
39
- [class*='p-side-navigation--'].is-expanded & {
40
+ .p-side-navigation.is-drawer-expanded &,
41
+ [class*='p-side-navigation--'].is-expanded &,
42
+ [class*='p-side-navigation--'].is-drawer-expanded & {
40
43
  @extend %vf-has-box-shadow;
41
44
 
42
45
  animation: vf-p-side-navigation-expand map-get($animation-duration, brisk);
@@ -44,10 +47,20 @@
44
47
  }
45
48
 
46
49
  .p-side-navigation.is-collapsed &,
47
- [class*='p-side-navigation--'].is-collapsed & {
50
+ .p-side-navigation.is-drawer-collapsed &,
51
+ [class*='p-side-navigation--'].is-collapsed &,
52
+ [class*='p-side-navigation--'].is-drawer-collapsed & {
48
53
  animation: vf-p-side-navigation-collapse map-get($animation-duration, brisk);
49
54
  }
50
55
 
56
+ .p-side-navigation.is-drawer-hidden &,
57
+ [class*='p-side-navigation--'].is-drawer-hidden & {
58
+ display: none;
59
+ @media (min-width: $threshold-6-12-col) {
60
+ display: block;
61
+ }
62
+ }
63
+
51
64
  @media (min-width: $breakpoint-x-small) {
52
65
  max-width: 20rem;
53
66
  }
@@ -68,7 +81,9 @@
68
81
  .p-side-navigation:target &,
69
82
  [class*='p-side-navigation--']:target &,
70
83
  .p-side-navigation.is-expanded &,
71
- [class*='p-side-navigation--'].is-expanded & {
84
+ .p-side-navigation.is-drawer-expanded &,
85
+ [class*='p-side-navigation--'].is-expanded &,
86
+ [class*='p-side-navigation--'].is-drawer-expanded & {
72
87
  opacity: 1;
73
88
  pointer-events: all;
74
89
  }
@@ -134,7 +149,9 @@
134
149
  .p-side-navigation:target .p-side-navigation__drawer,
135
150
  [class*='p-side-navigation--']:target .p-side-navigation__drawer,
136
151
  .p-side-navigation.is-expanded .p-side-navigation__drawer,
137
- [class*='p-side-navigation--'].is-expanded .p-side-navigation__drawer {
152
+ .p-side-navigation.is-drawer-expanded .p-side-navigation__drawer,
153
+ [class*='p-side-navigation--'].is-expanded .p-side-navigation__drawer,
154
+ [class*='p-side-navigation--'].is-drawer-expanded .p-side-navigation__drawer {
138
155
  box-shadow: none;
139
156
  display: block;
140
157
  max-width: none;
@@ -416,6 +433,15 @@
416
433
  &::before {
417
434
  @include vf-icon-chevron($color-sidenav-toggle-icon);
418
435
  }
436
+
437
+ &[aria-expanded='true'] {
438
+ background-color: $color-transparent;
439
+
440
+ &:hover {
441
+ background: $color-sidenav-item-background-hover;
442
+ color: $color-sidenav-text-active;
443
+ }
444
+ }
419
445
  }
420
446
 
421
447
  .p-side-navigation__drawer {
@@ -55,3 +55,8 @@
55
55
  color: $color-x-light;
56
56
  }
57
57
  }
58
+
59
+ // Deprecated mixin kept for compatibility
60
+ @mixin vf-p-label {
61
+ @include vf-p-status-label;
62
+ }
@@ -41,7 +41,7 @@
41
41
  @import 'patterns_status-label';
42
42
  @import 'patterns_strip';
43
43
  @import 'patterns_switch';
44
- @import 'patterns_tab-buttons';
44
+ @import 'patterns_segmented-control';
45
45
  @import 'patterns_table-icons';
46
46
  @import 'patterns_table-expanding';
47
47
  @import 'patterns_table-of-contents';
@@ -116,13 +116,13 @@
116
116
  @include vf-p-pull-quotes;
117
117
  @include vf-p-search-and-filter;
118
118
  @include vf-p-search-box;
119
+ @include vf-p-segmented-control;
119
120
  @include vf-p-separator;
120
121
  @include vf-p-side-navigation;
121
122
  @include vf-p-slider;
122
123
  @include vf-p-status-label;
123
124
  @include vf-p-strip;
124
125
  @include vf-p-switch;
125
- @include vf-p-tab-buttons;
126
126
  @include vf-p-table-icons;
127
127
  @include vf-p-table-expanding;
128
128
  @include vf-p-table-of-contents;