@ons/design-system 66.0.1 → 66.0.2

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.
@@ -264,11 +264,7 @@ describe('macro: autosuggest', () => {
264
264
  it('renders div with the provided title text', () => {
265
265
  const $ = cheerio.load(renderComponent('autosuggest', EXAMPLE_AUTOSUGGEST));
266
266
 
267
- expect(
268
- $('.ons-autosuggest__results-title')
269
- .text()
270
- .trim(),
271
- ).toBe('Suggestions');
267
+ expect($('.ons-autosuggest__results-title').text().trim()).toBe('Suggestions');
272
268
  });
273
269
 
274
270
  it('renders list with a generated identifier', () => {
@@ -298,11 +294,7 @@ describe('macro: autosuggest', () => {
298
294
  it('renders instructions text', () => {
299
295
  const $ = cheerio.load(renderComponent('autosuggest', EXAMPLE_AUTOSUGGEST));
300
296
 
301
- expect(
302
- $('.ons-autosuggest__instructions')
303
- .text()
304
- .trim(),
305
- ).toBe('Use up and down keys to navigate.');
297
+ expect($('.ons-autosuggest__instructions').text().trim()).toBe('Use up and down keys to navigate.');
306
298
  });
307
299
  });
308
300
  });
@@ -78,13 +78,15 @@ $button-shadow-size: 3px;
78
78
  }
79
79
  }
80
80
 
81
- &:focus:hover:not(:active) &__inner {
81
+ &:focus:hover:not(:active, .active) &__inner {
82
82
  background: var(--ons-color-focus-dark);
83
83
  }
84
84
 
85
85
  // When down
86
86
  &:active &,
87
- &:active:focus & {
87
+ &:active:focus &,
88
+ &.active &,
89
+ &.active:focus & {
88
90
  &__inner {
89
91
  background: var(--ons-color-button);
90
92
  box-shadow: none;
@@ -96,7 +98,8 @@ $button-shadow-size: 3px;
96
98
  }
97
99
  }
98
100
 
99
- &:active {
101
+ &:active,
102
+ &.active {
100
103
  top: ems($button-shadow-size);
101
104
  }
102
105
 
@@ -132,7 +135,9 @@ $button-shadow-size: 3px;
132
135
 
133
136
  &--secondary &,
134
137
  &--secondary:active &,
135
- &--secondary:active:focus & {
138
+ &--secondary.active &,
139
+ &--secondary:active:focus &,
140
+ &--secondary.active:focus & {
136
141
  &__inner {
137
142
  background: var(--ons-color-button-secondary);
138
143
  color: var(--ons-color-text);
@@ -169,8 +174,8 @@ $button-shadow-size: 3px;
169
174
  text-decoration: none;
170
175
  }
171
176
 
172
- &--link:focus:not(:active, &--secondary) &,
173
- &--link:focus:hover:not(:active, &--secondary) & {
177
+ &--link:focus:not(:active, .active, &--secondary) &,
178
+ &--link:focus:hover:not(:active, .active, &--secondary) & {
174
179
  outline: inherit;
175
180
 
176
181
  &__inner {
@@ -238,8 +243,8 @@ $button-shadow-size: 3px;
238
243
  }
239
244
 
240
245
  &--text-link:focus &,
241
- &--text-link.active:focus &,
242
- &--text-link:active:focus & {
246
+ &--text-link:active:focus &,
247
+ &--text-link.active:focus & {
243
248
  &__inner {
244
249
  background-color: var(--ons-color-focus);
245
250
  box-shadow: 0 -2px var(--ons-color-focus),
@@ -288,7 +293,9 @@ $button-shadow-size: 3px;
288
293
  }
289
294
 
290
295
  &--ghost:active:focus,
291
- &--ghost-dark:active:focus {
296
+ &--ghost.active:focus
297
+ &--ghost-dark:active:focus
298
+ &--ghost-dark.active:focus {
292
299
  box-shadow: none;
293
300
  outline: 3px solid transparent;
294
301
  }
@@ -403,7 +410,8 @@ $button-shadow-size: 3px;
403
410
  }
404
411
  }
405
412
 
406
- &--loader.ons-is-loading:active & {
413
+ &--loader.ons-is-loading:active &,
414
+ &--loader.ons-is-loading.active & {
407
415
  &__inner {
408
416
  box-shadow: 0 ems($button-shadow-size) 0 var(--ons-color-button-shadow);
409
417
  }
@@ -448,7 +456,8 @@ $button-shadow-size: 3px;
448
456
  cursor: not-allowed;
449
457
  }
450
458
 
451
- &--disabled:active & {
459
+ &--disabled:active &,
460
+ &--disabled.active & {
452
461
  &__inner {
453
462
  box-shadow: 0 ems($button-shadow-size) 0 var(--ons-color-button-shadow);
454
463
  }
@@ -496,7 +505,9 @@ $button-shadow-size: 3px;
496
505
  }
497
506
 
498
507
  &--dropdown:active &,
499
- &--dropdown:active:focus & {
508
+ &--dropdown.active &,
509
+ &--dropdown:active:focus &,
510
+ &--dropdown.active:focus & {
500
511
  &__inner {
501
512
  background: var(--ons-color-branded-secondary);
502
513
  color: var(--ons-color-white);
@@ -18,7 +18,8 @@ export default class SubmitButton {
18
18
  this.button.addEventListener('click', this.timerButton.bind(this));
19
19
  }
20
20
  } else if (this.submitType == 'link') {
21
- this.button.addEventListener('keydown', this.linkButton.bind(this));
21
+ this.button.addEventListener('keydown', this.linkButtonDown.bind(this));
22
+ this.button.addEventListener('keyup', this.linkButtonUp.bind(this));
22
23
  }
23
24
  }
24
25
 
@@ -48,10 +49,18 @@ export default class SubmitButton {
48
49
  );
49
50
  }
50
51
 
51
- linkButton(e) {
52
- if (e.keyCode == 32) {
52
+ linkButtonDown(e){
53
+ if (e.keyCode == 32 || e.keyCode == 13){
54
+ this.button.classList.add("active");
55
+ }
56
+ }
57
+
58
+ linkButtonUp(e){
59
+ if (e.keyCode == 32 || e.keyCode == 13) {
60
+ this.button.classList.remove("active");
53
61
  e.preventDefault();
54
62
  this.button.click();
55
63
  }
56
64
  }
65
+
57
66
  }
@@ -88,7 +88,7 @@
88
88
  <div class="ons-grid__col ons-col-auto{% if controlVisibility == true %} ons-u-d-no@xxs@{{ breakpoint }}{% endif %}">
89
89
  <nav class="ons-header-service-nav ons-header-service-nav--main {{ params.serviceLinks.classes }}" aria-label="{{ params.serviceLinks.ariaLabel | default("Service links navigation") }}">
90
90
  <ul class="ons-header-service-nav__list">
91
- {% for item in params.serviceLinks.itemsList %}
91
+ {% for item in params.serviceLinks.itemsList %}
92
92
  <li class="ons-header-service-nav__item">
93
93
  {% if item.iconType %}
94
94
  {{
@@ -139,7 +139,7 @@
139
139
  {% if params.serviceLinks %}
140
140
  <nav class="ons-header-service-nav ons-header-service-nav--mobile ons-u-d-no ons-js-services-mobile-nav" id="{{ params.serviceLinks.id }}" aria-label="{{ params.serviceLinks.ariaLabel | default("Service links navigation") }}">
141
141
  <ul class="ons-header-service-nav__list">
142
- {% for item in params.serviceLinks.itemsList %}
142
+ {% for item in params.serviceLinks.itemsList %}
143
143
  <li class="ons-header-service-nav__item ons-header-service-nav__item--mobile">
144
144
  {% if item.iconType %}
145
145
  {{
@@ -72,9 +72,10 @@
72
72
  <path d="M32,16.0986285 C32.0009185,7.5342974 25.337417,0.468462963 16.8372092,0.0203294753 C8.33700136,-0.427804013 0.97607758,5.89865855 0.0874346352,14.4161886 C-0.801208309,22.9337186 5.09355054,30.6602611 13.5009524,31.9979281 L13.5009524,20.7518951 L9.44,20.7518951 L9.44,16.0986285 L13.5009524,16.0986285 L13.5009524,12.549267 C13.5009524,8.5169471 15.8857143,6.28613892 19.5428571,6.28613892 C20.742535,6.30277426 21.9393895,6.40782423 23.1238095,6.60044523 L23.1238095,10.5637711 L21.1047619,10.5637711 C19.1161905,10.5637711 18.4990476,11.8056643 18.4990476,13.0782216 L18.4990476,16.0986285 L22.9409524,16.0986285 L22.2247619,20.7518951 L18.4990476,20.7518951 L18.4990476,31.9979281 C26.2735701,30.760956 31.9991507,24.0182672 32,16.0986285 L32,16.0986285 Z"/>
73
73
  </svg>
74
74
  {% elif params.iconType == "twitter" %}
75
- <svg class="{% if params.iconSize %}ons-icon ons-icon--{{ params.iconSize }}{% else %}ons-icon{% endif %}{{ iconClasses }}" id="icon-twitter" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg" focusable="false" aria-hidden="true">
76
- <path d="M24.04,12.95c0,0.17,0,0.33,0,0.5c0.01,4.01-2.17,7.71-5.69,9.64c-3.52,1.93-7.81,1.78-11.19-0.38c0.31,0.04,0.61,0.05,0.92,0.05c1.73,0,3.42-0.58,4.78-1.65c-1.65-0.04-3.09-1.11-3.6-2.68c0.25,0.05,0.51,0.07,0.76,0.07c0.34,0,0.68-0.05,1.01-0.14C9.23,18,7.93,16.4,7.95,14.55v-0.05c0.54,0.29,1.13,0.46,1.74,0.48c-1.66-1.12-2.2-3.33-1.23-5.08c1.96,2.41,4.85,3.87,7.95,4.03c-0.07-0.29-0.1-0.58-0.1-0.88c0-1.58,0.97-3,2.44-3.59c1.47-0.58,3.15-0.21,4.23,0.94c0.86-0.17,1.69-0.49,2.45-0.94c-0.28,0.9-0.88,1.65-1.69,2.13c0.76-0.09,1.51-0.29,2.21-0.6C25.43,11.76,24.79,12.42,24.04,12.95zM16,0C7.16,0,0,7.16,0,16s7.16,16,16,16s16-7.16,16-16c0-4.24-1.69-8.31-4.69-11.31S20.24,0,16,0z"/>
77
- </svg>
75
+ <svg class="{% if params.iconSize %}ons-icon ons-icon--{{ params.iconSize }}{% else %}ons-icon{% endif %}{{ iconClasses }}" id="icon-twitter" viewBox="0 0 90.01 90.01" xmlns="http://www.w3.org/2000/svg" focusable="false" aria-hidden="true">
76
+ <polygon points="24.89,23.01 57.79,66.99 65.24,66.99 32.34,23.01"/>
77
+ <path d="M 45 0 L 45 0 C 20.147 0 0 20.147 0 45 v 0 c 0 24.853 20.147 45 45 45 h 0 c 24.853 0 45 -20.147 45 -45 v 0 C 90 20.147 69.853 0 45 0 z M 56.032 70.504 L 41.054 50.477 L 22.516 70.504 h -4.765 L 38.925 47.63 L 17.884 19.496 h 16.217 L 47.895 37.94 l 17.072 -18.444 h 4.765 L 50.024 40.788 l 22.225 29.716 H 56.032 z"/>
78
+ </svg>
78
79
  {% elif params.iconType == "instagram" %}
79
80
  <svg class="{% if params.iconSize %}ons-icon ons-icon--{{ params.iconSize }}{% else %}ons-icon{% endif %}{{ iconClasses }}" id="icon-instagram" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg" focusable="false" aria-hidden="true">
80
81
  <path d="M21.34,9.46c0.66,0,1.2,0.54,1.2,1.2c0,0.66-0.54,1.2-1.2,1.2c-0.66,0-1.2-0.54-1.2-1.2C20.14,10,20.68,9.46,21.34,9.46z M16,12.67c-1.84,0-3.33,1.49-3.33,3.33c0,1.84,1.49,3.33,3.33,3.33c1.84,0,3.33-1.49,3.33-3.33C19.33,14.16,17.84,12.67,16,12.67z M16,10.86c2.84,0,5.14,2.3,5.14,5.14c0,2.84-2.3,5.14-5.14,5.14c-2.84,0-5.14-2.3-5.14-5.14C10.86,13.16,13.16,10.86,16,10.86z M16.56,7.8h-1.11c-2.17,0-2.51,0.01-3.49,0.06c-0.97,0.04-1.5,0.21-1.86,0.34C9.64,8.39,9.3,8.6,8.95,8.95C8.6,9.3,8.39,9.64,8.2,10.1c-0.14,0.35-0.3,0.88-0.34,1.86c-0.04,0.98-0.06,1.32-0.06,3.49v1.11c0,2.17,0.01,2.51,0.06,3.49c0.04,0.97,0.21,1.5,0.34,1.86c0.18,0.47,0.4,0.8,0.75,1.15c0.35,0.35,0.68,0.57,1.15,0.75c0.35,0.14,0.88,0.3,1.86,0.34c0.94,0.04,1.29,0.06,3.23,0.06h1.61c1.94,0,2.3-0.02,3.23-0.06c0.97-0.04,1.5-0.21,1.86-0.34c0.47-0.18,0.8-0.4,1.15-0.75c0.35-0.35,0.57-0.68,0.75-1.15c0.14-0.35,0.3-0.88,0.34-1.86c0.04-0.94,0.06-1.29,0.06-3.23v-1.61c0-1.94-0.02-2.3-0.06-3.23c-0.04-0.97-0.21-1.5-0.34-1.86c-0.18-0.47-0.4-0.8-0.75-1.15C22.7,8.6,22.36,8.39,21.9,8.2c-0.35-0.14-0.88-0.3-1.86-0.34C19.06,7.82,18.72,7.8,16.56,7.8z M17.03,6c1.8,0,2.18,0.02,3.1,0.06c1.06,0.05,1.79,0.22,2.43,0.46c0.66,0.26,1.22,0.6,1.77,1.15c0.56,0.56,0.9,1.11,1.15,1.77c0.25,0.64,0.42,1.36,0.46,2.43c0.05,0.99,0.06,1.35,0.06,3.58v1.09c0,2.22-0.01,2.59-0.06,3.58c-0.05,1.06-0.22,1.79-0.46,2.43c-0.26,0.66-0.6,1.22-1.15,1.77c-0.56,0.56-1.11,0.9-1.77,1.15c-0.64,0.25-1.36,0.42-2.43,0.46C19.13,25.99,18.77,26,16.55,26h-1.09c-2.22,0-2.59-0.01-3.58-0.06c-1.06-0.05-1.79-0.22-2.43-0.46c-0.66-0.26-1.22-0.6-1.77-1.15c-0.56-0.56-0.9-1.11-1.15-1.77c-0.25-0.64-0.42-1.36-0.46-2.43C6.02,19.21,6,18.83,6,17.03v-2.06c0-1.8,0.02-2.18,0.06-3.1c0.05-1.06,0.22-1.79,0.46-2.43c0.26-0.66,0.6-1.22,1.15-1.77c0.56-0.56,1.11-0.9,1.77-1.15c0.64-0.25,1.36-0.42,2.43-0.46C12.79,6.02,13.17,6,14.97,6H17.03z M16,0C7.16,0,0,7.16,0,16s7.16,16,16,16s16-7.16,16-16c0-4.24-1.69-8.31-4.69-11.31S20.24,0,16,0z"/>
@@ -77,6 +77,7 @@
77
77
  &--icons {
78
78
  margin-bottom: 0;
79
79
  .ons-list__item {
80
+ margin-top: 0;
80
81
  margin-bottom: 0.5rem;
81
82
  }
82
83
  }
@@ -99,7 +100,6 @@
99
100
  .ons-list__item {
100
101
  display: inline-block;
101
102
  margin: 0 1rem 0 0;
102
- vertical-align: top;
103
103
  }
104
104
  }
105
105