@ons/design-system 58.0.0 → 58.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.
@@ -128,7 +128,7 @@
128
128
  &--header {
129
129
  .ons-autosuggest-input__results {
130
130
  border: none;
131
- box-shadow: 0 0 5px 0 rgba(var(--ons-color-black), 0.6);
131
+ box-shadow: 0 0 5px 0 rgba(34, 34, 34, 0.6);
132
132
  left: 0;
133
133
  position: absolute;
134
134
  z-index: 10;
@@ -64,7 +64,7 @@
64
64
  &__actions {
65
65
  background-color: var(--ons-color-white);
66
66
  bottom: 0;
67
- box-shadow: 0 0 5px 0 rgba(var(--ons-color-black), 0.5), 0 -1px 0 0 rgba(var(--ons-color-grey-100), 0.5);
67
+ box-shadow: 0 0 5px 0 rgba(34, 34, 34, 0.5), 0 -1px 0 0 rgba(65, 64, 66, 0.5);
68
68
  display: flex;
69
69
  left: 0;
70
70
  padding: 1rem;
@@ -33,6 +33,9 @@ export default class Modal {
33
33
  if (this.modalType !== 'Timeout') {
34
34
  window.addEventListener('keydown', this.escToClose.bind(this));
35
35
  }
36
+ this.component.setAttribute('data-ga-action', `Modal initialised`);
37
+ this.component.setAttribute('data-ga-label', `${this.modalType} modal initialised`);
38
+ this.component.setAttribute('data-ga-category', `${this.modalType} modal`);
36
39
  }
37
40
 
38
41
  dialogSupported() {
@@ -75,7 +78,6 @@ export default class Modal {
75
78
  this.component.setAttribute('data-ga-action', 'Modal opened by timed event');
76
79
  }
77
80
  this.component.setAttribute('data-ga-label', `${this.modalType} modal opened`);
78
- this.component.setAttribute('data-ga-category', `${this.modalType} modal`);
79
81
  }
80
82
  }
81
83
  }
@@ -121,7 +123,6 @@ export default class Modal {
121
123
  this.component.setAttribute('data-ga-action', 'Modal closed by timed event');
122
124
  }
123
125
  this.component.setAttribute('data-ga-label', `${this.modalType} modal closed`);
124
- this.component.setAttribute('data-ga-category', `${this.modalType} modal`);
125
126
  }
126
127
  }
127
128
  }
@@ -82,6 +82,17 @@ describe('script: modal', () => {
82
82
  await setTestPage('/test', template);
83
83
  });
84
84
 
85
+ describe('when the page has been loaded but the modal has not been opened yet', () => {
86
+ it('has the correct attributes set on the modal', async () => {
87
+ const gaLabel = await page.$eval('.ons-modal', node => node.getAttribute('data-ga-label'));
88
+ const gaAction = await page.$eval('.ons-modal', node => node.getAttribute('data-ga-action'));
89
+ const gaCategory = await page.$eval('.ons-modal', node => node.getAttribute('data-ga-category'));
90
+ expect(gaLabel).toBe('Generic modal initialised');
91
+ expect(gaAction).toBe('Modal initialised');
92
+ expect(gaCategory).toBe('Generic modal');
93
+ });
94
+ });
95
+
85
96
  describe('when the modal is launched by a click event', () => {
86
97
  beforeEach(async () => {
87
98
  await page.focus('#launcher');
@@ -116,7 +116,7 @@
116
116
  }
117
117
 
118
118
  .ons-tabs--details {
119
- border-top: 1px solid --ons-color-borders;
119
+ border-top: 1px solid var(--ons-color-borders);
120
120
  margin: 0;
121
121
 
122
122
  .ons-tab {
@@ -241,6 +241,17 @@ describe('script: timeout modal', () => {
241
241
  await setTestPage('/test', template);
242
242
  });
243
243
 
244
+ describe('when the page has been loaded but the modal has not been opened yet', () => {
245
+ it('has the correct attributes set on the modal', async () => {
246
+ const gaLabel = await page.$eval('.ons-modal', node => node.getAttribute('data-ga-label'));
247
+ const gaAction = await page.$eval('.ons-modal', node => node.getAttribute('data-ga-action'));
248
+ const gaCategory = await page.$eval('.ons-modal', node => node.getAttribute('data-ga-category'));
249
+ expect(gaLabel).toBe('Timeout modal initialised');
250
+ expect(gaAction).toBe('Modal initialised');
251
+ expect(gaCategory).toBe('Timeout modal');
252
+ });
253
+ });
254
+
244
255
  describe('when the modal is open', () => {
245
256
  beforeEach(async () => {
246
257
  await page.waitForSelector('.ons-modal');