@financial-times/n-myft-ui 30.0.0 → 30.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -17,6 +17,7 @@
17
17
  "js-cookie": "^2.2.1",
18
18
  "next-myft-client": "^10.3.0",
19
19
  "next-session-client": "^4.0.0",
20
+ "ready-state": "^2.0.5",
20
21
  "superstore-sync": "^2.1.1"
21
22
  },
22
23
  "devDependencies": {
@@ -18554,6 +18555,11 @@
18554
18555
  "node": ">=0.10"
18555
18556
  }
18556
18557
  },
18558
+ "node_modules/ready-state": {
18559
+ "version": "2.0.5",
18560
+ "resolved": "https://registry.npmjs.org/ready-state/-/ready-state-2.0.5.tgz",
18561
+ "integrity": "sha512-rwuszAC+hAAhQWK0alQOSq0Fa5/SO9XvbzVY/Ki82d1ocwLY7kdjEooVbYg7GELrCXySckTmsuTgLd8hqKz9Og=="
18562
+ },
18557
18563
  "node_modules/rechoir": {
18558
18564
  "version": "0.7.1",
18559
18565
  "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.7.1.tgz",
@@ -38860,6 +38866,11 @@
38860
38866
  "readable-stream": "^2.0.2"
38861
38867
  }
38862
38868
  },
38869
+ "ready-state": {
38870
+ "version": "2.0.5",
38871
+ "resolved": "https://registry.npmjs.org/ready-state/-/ready-state-2.0.5.tgz",
38872
+ "integrity": "sha512-rwuszAC+hAAhQWK0alQOSq0Fa5/SO9XvbzVY/Ki82d1ocwLY7kdjEooVbYg7GELrCXySckTmsuTgLd8hqKz9Og=="
38873
+ },
38863
38874
  "rechoir": {
38864
38875
  "version": "0.7.1",
38865
38876
  "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.7.1.tgz",
@@ -42,6 +42,12 @@ $system-code: "n-myft-ui-demo";
42
42
  background-color: oColorsByName('claret-60');
43
43
  color: oColorsByName('white');
44
44
  }
45
+
46
+ .concept-collection--inverse-monochrome {
47
+ background-color: oColorsByName('white');
48
+ color: oColorsByName('black');
49
+ }
50
+
45
51
  .concept-collection--alphaville {
46
52
  background-color: oColorsByName('matisse');
47
53
  color: oColorsByName('white');
@@ -212,6 +212,41 @@
212
212
  </div>
213
213
  </div>
214
214
 
215
+ <div class="o-grid-row">
216
+ <div data-o-grid-colspan="12">
217
+ <div class="concept-collection concept-collection--inverse-monochrome">
218
+ <h3 class="concept-collection__title">
219
+ Inverse Monochrome
220
+ </h3>
221
+ <ul class="concept-collection__list">
222
+ <li>
223
+ <button
224
+ class="n-myft-follow-button n-myft-follow-button--inverse-monochrome"
225
+ aria-pressed="false">
226
+ Theo Leanse
227
+ </button>
228
+ </li>
229
+ <li>
230
+ <button
231
+ class="n-myft-follow-button n-myft-follow-button--inverse-monochrome"
232
+ aria-pressed="true">
233
+ Mr. and Mrs. Dursley, of number four, Privet Drive, were proud to
234
+ say that they were perfectly normal, thank you very much.
235
+ </button>
236
+ </li>
237
+ <li>
238
+ <button
239
+ disabled
240
+ class="n-myft-follow-button n-myft-follow-button--inverse-monochrome"
241
+ aria-pressed="true">
242
+ chee
243
+ </button>
244
+ </li>
245
+ </ul>
246
+ </div>
247
+ </div>
248
+ </div>
249
+
215
250
  <div class="o-grid-row">
216
251
  <div data-o-grid-colspan="12">
217
252
  <div class="concept-collection concept-collection--opinion">
@@ -428,6 +463,42 @@
428
463
  </div>
429
464
  </div>
430
465
 
466
+ <div class="o-grid-row">
467
+ <div data-o-grid-colspan="12">
468
+ <div class="concept-collection concept-collection--inverse-monochrome">
469
+ <h3 class="concept-collection__title">
470
+ Inverse Monochrome
471
+ </h3>
472
+
473
+ <ul class="concept-collection__list">
474
+ <li>
475
+ <a
476
+ class="n-myft-concept-pill n-myft-concept-pill--inverse-monochrome"
477
+ aria-pressed="false">
478
+ Theo Leanse
479
+ </a>
480
+ </li>
481
+ <li>
482
+ <a
483
+ class="n-myft-concept-pill n-myft-concept-pill--inverse-monochrome"
484
+ aria-pressed="false">
485
+ Mr. and Mrs. Dursley, of number four, Privet Drive, were proud to
486
+ say that they were perfectly normal, thank you very much.
487
+ </a>
488
+ </li>
489
+ <li>
490
+ <a
491
+ disabled
492
+ class="n-myft-concept-pill n-myft-concept-pill--inverse-monochrome"
493
+ aria-pressed="true">
494
+ chee
495
+ </a>
496
+ </li>
497
+ </ul>
498
+ </div>
499
+ </div>
500
+ </div>
501
+
431
502
  <div class="o-grid-row">
432
503
  <div data-o-grid-colspan="12">
433
504
  <div class="concept-collection concept-collection--opinion">
@@ -32,6 +32,14 @@ $myft-lozenge-themes: (
32
32
  pressed-highlight: rgba(oColorsByName('white'), 0.2),
33
33
  disabled: rgba(oColorsByName('white'), 0.5),
34
34
  ),
35
+ inverse-monochrome: (
36
+ toggle-button-theme: ('color': 'black'),
37
+ background: oColorsByName('black'),
38
+ text: oColorsByName('white'),
39
+ highlight: oColorsByName('black-80'),
40
+ pressed-highlight: rgba(oColorsByName('black'), 0.2),
41
+ disabled: rgba(oColorsByName('black'), 0.5),
42
+ ),
35
43
  alphaville: (
36
44
  toggle-button-theme: 'inverse',
37
45
  background: oColorsByName('white'),
@@ -8,10 +8,17 @@ import Delegate from 'ftdomdelegate';
8
8
  import personaliseLinks from '../personalise-links';
9
9
  import doFormSubmit from './do-form-submit';
10
10
  import enhanceActionUrls from './enhance-action-urls';
11
+ import readyState from 'ready-state';
11
12
 
12
- const delegate = new Delegate(document.body);
13
13
  let initialised;
14
14
 
15
+ function createDelegate (action, selector, cb) {
16
+ readyState.domready.then(() => {
17
+ const delegate = new Delegate(document.body);
18
+ delegate.on(action, selector, cb);
19
+ });
20
+ }
21
+
15
22
  function getInteractionHandler (relationshipName) {
16
23
  return (ev, formEl) => {
17
24
  ev.preventDefault();
@@ -29,7 +36,7 @@ function anonEventListeners () {
29
36
  };
30
37
 
31
38
  ['followed', 'saved'].forEach(action => {
32
- delegate.on('submit', relationshipConfig[action].uiSelector, event => {
39
+ createDelegate('submit', relationshipConfig[action].uiSelector, event => {
33
40
  event.preventDefault();
34
41
  nNotification.show({
35
42
  content: messages[action],
@@ -77,7 +84,7 @@ function signedInEventListeners () {
77
84
  });
78
85
  });
79
86
 
80
- delegate.on('submit', uiSelector, getInteractionHandler(relationshipName));
87
+ createDelegate('submit', uiSelector, getInteractionHandler(relationshipName));
81
88
  }
82
89
  });
83
90
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@financial-times/n-myft-ui",
3
- "version": "30.0.0",
3
+ "version": "30.0.2",
4
4
  "description": "Client side component for interaction with myft",
5
5
  "main": "server.js",
6
6
  "scripts": {
@@ -107,6 +107,7 @@
107
107
  "js-cookie": "^2.2.1",
108
108
  "next-myft-client": "^10.3.0",
109
109
  "next-session-client": "^4.0.0",
110
+ "ready-state": "^2.0.5",
110
111
  "superstore-sync": "^2.1.1"
111
112
  },
112
113
  "volta": {