@financial-times/n-myft-ui 40.0.0 → 40.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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "branch": "",
3
3
  "repo": "n-myft-ui",
4
- "version": "debd61e7393b99f4256d24f68a0819dec3eb176d",
5
- "tag": "v40.0.0"
4
+ "version": "da6a59658803a3898eb4a2d02f16561dded775aa",
5
+ "tag": "v40.0.2"
6
6
  }
@@ -28,9 +28,9 @@ function toggleButton (buttonEl, state) {
28
28
  nextButtons.toggleState(buttonEl);
29
29
  const name = buttonEl.getAttribute('data-name');
30
30
  if (isPressed) {
31
- buttonEl.setAttribute('aria-label', 'Alerts ' + name + ' currently disabled, change to enable');
31
+ buttonEl.setAttribute('aria-label', 'Instant alerts for ' + name + ' currently disabled, change to enable');
32
32
  } else {
33
- buttonEl.setAttribute('aria-label', 'Alerts ' + name + ' currently enabled, change to disable');
33
+ buttonEl.setAttribute('aria-label', 'Instant alerts for ' + name + ' currently enabled, change to disable');
34
34
  }
35
35
  }
36
36
 
@@ -14,10 +14,10 @@
14
14
  {{/if}}
15
15
  <button
16
16
  {{#ifAll hasInstantAlert @root.cacheablePersonalisedUrl}}
17
- aria-label="Alerts {{name}} currently enabled, change to disable"
17
+ aria-label="Instant alerts for {{name}} currently enabled, change to disable"
18
18
  aria-pressed="true"
19
19
  {{else}}
20
- aria-label="Alerts {{name}} currently disabled, change to enable"
20
+ aria-label="Instant alerts for {{name}} currently disabled, change to enable"
21
21
  aria-pressed="false"
22
22
  {{/ifAll}}
23
23
  class="o3-button n-myft-ui__button--instant"
package/myft/ui/lists.js CHANGED
@@ -12,7 +12,7 @@ let haveLoadedLists = false;
12
12
  let createListOverlay;
13
13
 
14
14
  async function openSaveArticleToList (contentId, options = {}) {
15
- const { name, nonModal = false } = options;
15
+ const { name, nonModal = false, triggerElement } = options;
16
16
  const modal = !nonModal;
17
17
  function createList (newList, cb) {
18
18
  if(!newList || !newList.name) {
@@ -85,6 +85,7 @@ async function openSaveArticleToList (contentId, options = {}) {
85
85
  heading: { title: headingElement.outerHTML },
86
86
  parentnode: isMobile() ? '.o-share--horizontal' : '.o-share--vertical',
87
87
  class: 'myft-ui-create-list',
88
+ trigger: triggerElement,
88
89
  });
89
90
 
90
91
  function addCloseButtonDataTrackable () {
@@ -318,8 +319,8 @@ function ListsElement (lists, addToList, removeFromList) {
318
319
  const listCheckboxElement = ListCheckboxElement(addToList, removeFromList);
319
320
 
320
321
  const listsTemplate = `
321
- <div class="myft-ui-create-list-lists o-forms-field o-forms-field--optional" role="group">
322
- <span class="myft-ui-create-list-lists-text">Add to list</span>
322
+ <div class="myft-ui-create-list-lists o-forms-field o-forms-field--optional" role="group" aria-labelledby="add-to-list-label">
323
+ <span id="add-to-list-label" class="myft-ui-create-list-lists-text">Add to list</span>
323
324
  <span class="myft-ui-create-list-lists-container o-forms-input o-forms-input--checkbox">
324
325
  </span>
325
326
  </div>
@@ -513,7 +514,8 @@ function initialEventListeners () {
513
514
  return openCreateListAndAddArticleOverlay(contentId);
514
515
  }
515
516
  const configKeys = configSet.dataset.myftUiSaveConfig.split(',');
516
- const config = configKeys.reduce((configObj, key) => (key ? { ...configObj, [key]: true} : configObj), {});
517
+ const triggerElement = configSet.querySelector('button[type="submit"]');
518
+ const config = configKeys.reduce((configObj, key) => (key ? { ...configObj, [key]: true} : configObj), { triggerElement });
517
519
  return openCreateListAndAddArticleOverlay(contentId, config);
518
520
  });
519
521
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@financial-times/n-myft-ui",
3
- "version": "40.0.0",
3
+ "version": "40.0.2",
4
4
  "description": "Client side component for interaction with myft",
5
5
  "main": "server.js",
6
6
  "scripts": {
@@ -108,7 +108,7 @@
108
108
  "@financial-times/n-notification": "^9.0.0",
109
109
  "@financial-times/o-forms": "^10.0.1",
110
110
  "@financial-times/o-grid": "^6.1.8",
111
- "@financial-times/o-overlay": "^5.0.1",
111
+ "@financial-times/o-overlay": "^5.0.2",
112
112
  "@financial-times/o-tooltip": "^6.0.0",
113
113
  "@financial-times/o3-button": "^3.0.0",
114
114
  "@financial-times/o3-editorial-typography": "^3.0.2",