@financial-times/n-myft-ui 37.0.0 → 38.0.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/.pa11yci.js +2 -1
- package/.toolkitstate/ci.json +2 -2
- package/components/button/main.scss +49 -62
- package/components/collections/collections.html +1 -1
- package/components/collections/main.scss +54 -25
- package/components/concept-list/concept-list.html +1 -1
- package/components/concept-list/main.scss +33 -28
- package/components/digest-promo/generic-promo-message.html +1 -1
- package/components/digest-promo/main.scss +96 -98
- package/components/digest-promo/promo-message.html +1 -1
- package/components/follow-button/follow-button.html +1 -1
- package/components/instant-alert/index.js +4 -5
- package/components/instant-alert/instant-alert.html +1 -5
- package/components/instant-alert/main.scss +69 -46
- package/components/jsx/follow-plus-instant-alerts/follow-plus-instant-alerts.jsx +1 -1
- package/components/jsx/follow-plus-instant-alerts/main.scss +36 -46
- package/components/jsx/preferences-modal/main.scss +38 -19
- package/components/pin-button/main.scss +63 -54
- package/components/pin-button/pin-button.html +1 -1
- package/components/save-for-later/save-for-later.html +2 -2
- package/demos/app.js +1 -23
- package/demos/src/demo.scss +19 -15
- package/demos/templates/demo.html +6 -4
- package/dist/follow-plus-instant-alerts/follow-plus-instant-alerts.js +1 -1
- package/mixins/lozenge/_themes.scss +70 -64
- package/mixins/lozenge/_toggle-icon.scss +39 -38
- package/mixins/lozenge/main.scss +80 -65
- package/myft/main.scss +376 -336
- package/myft/ui/lists.js +4 -4
- package/myft/ui/lists.scss +2 -20
- package/myft/ui/myft-buttons/main.scss +1 -1
- package/myft/ui/personalise-links.js +1 -2
- package/package.json +14 -12
- package/scripts/build-demo.sh +1 -1
- package/components/onboarding-cta/main.scss +0 -10
- package/mixins/buttons.scss +0 -23
- package/styles.css +0 -1
package/.pa11yci.js
CHANGED
@@ -24,7 +24,8 @@ const config = {
|
|
24
24
|
'Cookie': 'next-flags=ads:off,cookieMessage:off; secure=true'
|
25
25
|
},
|
26
26
|
timeout: 25000,
|
27
|
-
rules: ['Principle1.Guideline1_3.1_3_1_AAA']
|
27
|
+
rules: ['Principle1.Guideline1_3.1_3_1_AAA'],
|
28
|
+
hideElements: '#onboarding-cta'
|
28
29
|
},
|
29
30
|
urls: []
|
30
31
|
};
|
package/.toolkitstate/ci.json
CHANGED
@@ -1,68 +1,55 @@
|
|
1
|
-
@import '@financial-times/o-buttons/main';
|
2
|
-
|
3
|
-
.n-myft-ui__button {
|
4
|
-
@include oButtonsContent($opts: (
|
5
|
-
'type': 'secondary'
|
6
|
-
));
|
7
|
-
}
|
8
|
-
|
9
|
-
.n-myft-ui__button--inverse {
|
10
|
-
@include oButtonsContent($opts: (
|
11
|
-
'type': 'secondary',
|
12
|
-
'theme': 'inverse'
|
13
|
-
), $include-base-styles: false);
|
14
|
-
}
|
15
|
-
|
16
1
|
.n-myft-ui__button--viewport-large {
|
17
|
-
|
2
|
+
display: none;
|
18
3
|
|
19
|
-
|
20
|
-
|
21
|
-
|
4
|
+
@include oGridRespondTo('L') {
|
5
|
+
display: inline-block;
|
6
|
+
}
|
22
7
|
}
|
23
8
|
|
24
9
|
.n-myft-ui__save-button-with-icon {
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
10
|
+
--icon-size: 24px;
|
11
|
+
|
12
|
+
display: inline-block;
|
13
|
+
padding: 30px 0px 4px;
|
14
|
+
width: 40px;
|
15
|
+
color: var(--o3-color-palette-black);
|
16
|
+
background: none;
|
17
|
+
border: 0;
|
18
|
+
position: relative;
|
19
|
+
|
20
|
+
&::after {
|
21
|
+
content: '';
|
22
|
+
width: var(--icon-size);
|
23
|
+
height: var(--icon-size);
|
24
|
+
top: var(--o3-spacing-5xs);
|
25
|
+
left: var(--o3-spacing-4xs);
|
26
|
+
position: absolute;
|
27
|
+
background-color: var(--o3-color-palette-black);
|
28
|
+
mask-image: var(--o3-icon-bookmark);
|
29
|
+
mask-repeat: no-repeat;
|
30
|
+
mask-size: contain;
|
31
|
+
pointer-events: none;
|
32
|
+
}
|
33
|
+
|
34
|
+
.save-button-with-icon-copy {
|
35
|
+
position: static;
|
36
|
+
line-height: var(--o3-font-lineheight-metric2-negative-2);
|
37
|
+
font-size: var(--o3-font-size-metric2-negative-2);
|
38
|
+
font-family: var(--o3-font-family-metric);
|
39
|
+
}
|
40
|
+
|
41
|
+
&:not([disabled]):hover {
|
42
|
+
&::after {
|
43
|
+
mask-image: var(--o3-icon-bookmark-filled);
|
44
|
+
background-color: var(--o3-color-palette-black-50);
|
45
|
+
}
|
46
|
+
}
|
47
|
+
|
48
|
+
&[aria-selected='true'],
|
49
|
+
&[aria-pressed='true'] {
|
50
|
+
&::after {
|
51
|
+
mask-image: var(--o3-icon-bookmark-filled);
|
52
|
+
background-color: var(--o3-color-palette-claret);
|
53
|
+
}
|
54
|
+
}
|
68
55
|
}
|
@@ -65,7 +65,7 @@
|
|
65
65
|
<button
|
66
66
|
type="submit"
|
67
67
|
aria-pressed="false"
|
68
|
-
class="collection-follow-all__button {{#if liteStyle}}
|
68
|
+
class="collection-follow-all__button {{#if liteStyle}}o3-button o3-button--primary o3-button--small{{/if}}"
|
69
69
|
data-trackable="follow all"
|
70
70
|
data-concept-id="
|
71
71
|
{{~#concepts~}}
|
@@ -11,7 +11,7 @@
|
|
11
11
|
}
|
12
12
|
|
13
13
|
.collection--regular {
|
14
|
-
background:
|
14
|
+
background: var(--o3-color-palette-claret-70);
|
15
15
|
|
16
16
|
@include oGridRespondTo(M) {
|
17
17
|
height: 100%;
|
@@ -19,8 +19,8 @@
|
|
19
19
|
}
|
20
20
|
|
21
21
|
.collection--lite {
|
22
|
-
background:
|
23
|
-
border: 1px solid
|
22
|
+
background: var(--o3-color-palette-white-40);
|
23
|
+
border: 1px solid var(--o3-color-palette-black-5);
|
24
24
|
padding-top: 18px;
|
25
25
|
}
|
26
26
|
|
@@ -30,24 +30,31 @@
|
|
30
30
|
}
|
31
31
|
|
32
32
|
.collection__header--regular {
|
33
|
-
color:
|
33
|
+
color: var(--o3-color-palette-white);
|
34
34
|
}
|
35
35
|
|
36
36
|
.collection__header--lite {
|
37
|
-
color:
|
37
|
+
color: var(--o3-color-palette-black);
|
38
38
|
}
|
39
39
|
|
40
40
|
.collection__title {
|
41
|
-
|
41
|
+
|
42
|
+
font-weight: var(--o3-font-weight-semibold);
|
43
|
+
line-height: var(--o3-font-lineheight-metric2-0);
|
44
|
+
font-size: var(--o3-font-size-metric2-0);
|
45
|
+
font-family: var(--o3-font-family-metric);
|
42
46
|
margin: 0;
|
43
47
|
}
|
44
48
|
|
45
49
|
.collection__concepts {
|
46
|
-
|
50
|
+
|
51
|
+
line-height: var(--o3-font-lineheight-metric2-0);
|
52
|
+
font-size: var(--o3-font-size-metric2-0);
|
53
|
+
font-family: var(--o3-font-family-metric);
|
47
54
|
|
48
55
|
margin: 0;
|
49
56
|
margin-left: -3px;
|
50
|
-
padding:
|
57
|
+
padding: var(--o3-spacing-2xs) 0 0;
|
51
58
|
|
52
59
|
flex-grow: 1;
|
53
60
|
list-style: none;
|
@@ -58,7 +65,7 @@
|
|
58
65
|
}
|
59
66
|
|
60
67
|
.collection__meta {
|
61
|
-
padding-top:
|
68
|
+
padding-top: var(--o3-spacing-2xs);
|
62
69
|
|
63
70
|
.n-myft-follow-button {
|
64
71
|
margin: 0;
|
@@ -66,23 +73,45 @@
|
|
66
73
|
}
|
67
74
|
|
68
75
|
.collection-follow-all__button {
|
69
|
-
|
70
|
-
|
71
|
-
|
76
|
+
width: 100%;
|
77
|
+
min-height: 28px;
|
78
|
+
min-width: 60px;
|
79
|
+
border-radius: var(--o3-border-radius-1);
|
80
|
+
padding: 0 var(--o3-spacing-4xs);
|
81
|
+
display: inline-flex;
|
82
|
+
align-items: center;
|
83
|
+
justify-content: center;
|
84
|
+
box-sizing: border-box;
|
85
|
+
vertical-align: middle;
|
86
|
+
font-family: var(--o3-font-family-metric);
|
87
|
+
font-size: var(--o3-font-size-negative-2);
|
88
|
+
line-height: var(--o3-font-lineheight-negative-2);
|
89
|
+
font-weight: var(--o3-font-weight-semibold);
|
90
|
+
border: 1px solid transparent;
|
91
|
+
text-align: center;
|
92
|
+
text-decoration: none;
|
93
|
+
transition: 0.3s background-color, 0.15s color ease-out,
|
94
|
+
0.15s border-color ease-out;
|
95
|
+
appearance: none;
|
96
|
+
background-color: #ffffff;
|
97
|
+
color: var(--o3-color-palette-claret-70);
|
72
98
|
}
|
73
99
|
|
74
|
-
.collection-follow-all__button--regular {
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
'color': 'white',
|
79
|
-
'context': 'claret-70'
|
80
|
-
)
|
81
|
-
), $include-base-styles: false);
|
100
|
+
.collection-follow-all__button--regular[disabled] {
|
101
|
+
pointer-events: none;
|
102
|
+
opacity: 0.4;
|
103
|
+
cursor: default;
|
82
104
|
}
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
105
|
+
.collection-follow-all__button--regular:hover {
|
106
|
+
background-color: #cccccc;
|
107
|
+
color: #aa1143;
|
108
|
+
border-color: transparent;
|
109
|
+
text-decoration: none;
|
88
110
|
}
|
111
|
+
.collection-follow-all__button--regular:focus {
|
112
|
+
box-shadow: 0 0 0 4px #4d4845, 0 0 0 8px #ffffff;
|
113
|
+
background-color: #cccccc;
|
114
|
+
color: #aa1143;
|
115
|
+
border-color: transparent;
|
116
|
+
z-index: 1;
|
117
|
+
}
|
@@ -17,7 +17,7 @@
|
|
17
17
|
<a
|
18
18
|
href="{{relativeUrl}}"
|
19
19
|
data-trackable="{{#if conceptTrackable}}{{conceptTrackable}}{{else}}concept{{/if}}"
|
20
|
-
class="concept-list__concept">
|
20
|
+
class="o3-type-body-base concept-list__concept">
|
21
21
|
{{prefLabel}}
|
22
22
|
</a>
|
23
23
|
{{> n-myft-ui/components/follow-button/follow-button
|
@@ -1,40 +1,45 @@
|
|
1
1
|
.concept-list__title {
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
2
|
+
|
3
|
+
line-height: var(--o3-font-lineheight-metric2-0);
|
4
|
+
font-size: var(--o3-font-size-metric2-0);
|
5
|
+
font-family: var(--o3-font-family-metric);
|
6
|
+
word-break: break-all;
|
7
|
+
&:after {
|
8
|
+
content: '';
|
9
|
+
display: block;
|
10
|
+
width: 60px;
|
11
|
+
margin-top: 5px;
|
12
|
+
border-bottom: 4px solid var(--o3-color-palette-black);
|
13
|
+
position: absolute;
|
14
|
+
z-index: 1;
|
15
|
+
}
|
13
16
|
}
|
14
17
|
|
15
18
|
.concept-list__list {
|
16
|
-
|
17
|
-
|
19
|
+
margin: var(--o3-spacing-s) 0 var(--o3-spacing-xl);
|
20
|
+
padding: 0;
|
18
21
|
}
|
19
22
|
|
20
23
|
.concept-list__list-item {
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
24
|
+
line-height: var(--o3-font-lineheight-metric2-0);
|
25
|
+
font-size: var(--o3-font-size-metric2-0);
|
26
|
+
font-family: var(--o3-font-family-metric);
|
27
|
+
color: var(--o3-color-palette-black);
|
28
|
+
list-style: none;
|
29
|
+
display: flex;
|
30
|
+
align-items: center;
|
26
31
|
}
|
27
32
|
|
28
33
|
.concept-list__concept {
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
flex: 2;
|
34
|
+
word-break: keep-all;
|
35
|
+
margin: var(--o3-spacing-5xs) var(--o3-spacing-3xs) var(--o3-spacing-5xs) 0;
|
36
|
+
text-decoration: none;
|
37
|
+
border: 0;
|
38
|
+
color: var(--o3-color-palette-black);
|
39
|
+
flex: 2;
|
36
40
|
|
37
|
-
|
38
|
-
|
39
|
-
|
41
|
+
&:hover {
|
42
|
+
color: color-mix(in srgb, var(--o3-color-palette-black) 73%, var(--o3-color-palette-paper));
|
43
|
+
text-decoration: underline;
|
44
|
+
}
|
40
45
|
}
|
@@ -6,7 +6,7 @@
|
|
6
6
|
<div class="o-grid-row">
|
7
7
|
|
8
8
|
<div data-o-grid-colspan="12 L8" class="n-myft-digest-promo__content">
|
9
|
-
<h2 class="n-myft-digest-promo__heading">
|
9
|
+
<h2 class="o3-type-body-highlight n-myft-digest-promo__heading">
|
10
10
|
Sign up to <span class="n-myft-digest-promo__branding">myFT Daily Digest</span>
|
11
11
|
</h2>
|
12
12
|
<p class ="n-myft-digest-promo__para">Receive the latest news from topics you follow on myFT straight to your inbox</p>
|
@@ -7,129 +7,127 @@ $icon-width-m: 90px;
|
|
7
7
|
$spacing-unit: 20px;
|
8
8
|
|
9
9
|
.n-myft-digest-promo {
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
margin-bottom: 20px;
|
10
|
+
display: none;
|
11
|
+
float: none;
|
12
|
+
position: relative;
|
13
|
+
background-color: var(--o3-color-palette-white-60);
|
14
|
+
border-bottom: 1px solid var(--o3-color-palette-black-20);
|
15
|
+
border-top: 1px solid var(--o3-color-palette-black-20);
|
16
|
+
margin-bottom: 20px;
|
18
17
|
}
|
19
18
|
|
20
19
|
.n-myft-digest-promo--enabled {
|
21
|
-
|
20
|
+
display: block;
|
22
21
|
}
|
23
22
|
|
24
23
|
.n-myft-digest-promo__container {
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
24
|
+
position: relative;
|
25
|
+
@include oGridRespondTo('M') {
|
26
|
+
@include oGridCenter;
|
27
|
+
@include oGridOffset(2);
|
28
|
+
}
|
30
29
|
}
|
31
30
|
|
32
31
|
.n-myft-digest-promo__dismiss-btn {
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
32
|
+
position: absolute;
|
33
|
+
top: 0;
|
34
|
+
right: 0;
|
35
|
+
background-color: transparent;
|
36
|
+
border-color: transparent;
|
37
|
+
height: 24px;
|
38
|
+
width: 24px;
|
39
|
+
|
40
|
+
&::before {
|
41
|
+
background-color: var(--o3-color-palette-black-80);
|
42
|
+
mask-image: var(--o3-icon-cross);
|
43
|
+
mask-repeat: no-repeat;
|
44
|
+
mask-size: contain;
|
45
|
+
height: 24px;
|
46
|
+
width: 24px;
|
47
|
+
position: absolute;
|
48
|
+
top: 0;
|
49
|
+
right: 0;
|
50
|
+
content: '';
|
51
|
+
}
|
53
52
|
}
|
54
53
|
|
55
54
|
.n-myft-digest-promo__content {
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
55
|
+
position: relative;
|
56
|
+
padding-left: $icon-width-s;
|
57
|
+
padding-top: $spacing-unit;
|
58
|
+
|
59
|
+
@include oGridRespondTo('M') {
|
60
|
+
padding-left: $icon-width-m;
|
61
|
+
|
62
|
+
&::before {
|
63
|
+
width: $icon-width-m;
|
64
|
+
}
|
65
|
+
}
|
66
|
+
|
67
|
+
&::before {
|
68
|
+
position: absolute;
|
69
|
+
content: '';
|
70
|
+
display: block;
|
71
|
+
width: $icon-width-s;
|
72
|
+
height: 80px;
|
73
|
+
left: 0;
|
74
|
+
background-image: url('https://www.ft.com/__origami/service/image/v2/images/raw/https%3A%2F%2Fwww.ft.com%2F__assets%2Fcreatives%2Fmyft-alerts-prefs%2Fenvelope.svg?source=next&fit=scale-down&compression=best&width=50');
|
75
|
+
background-repeat: no-repeat;
|
76
|
+
background-size: 60px auto;
|
77
|
+
background-position: 10px 0;
|
78
|
+
}
|
81
79
|
}
|
82
80
|
|
83
81
|
.n-myft-digest-promo__heading {
|
84
|
-
|
85
|
-
|
86
|
-
margin-top: 0;
|
87
|
-
margin-bottom: 7px;
|
82
|
+
margin-top: 0;
|
83
|
+
margin-bottom: 7px;
|
88
84
|
}
|
89
85
|
|
90
86
|
.n-myft-digest-promo__para {
|
91
|
-
|
92
|
-
|
87
|
+
line-height: var(--o3-font-lineheight-metric2-negative-2);
|
88
|
+
font-size: var(--o3-font-size-metric2-negative-2);
|
89
|
+
font-family: var(--o3-font-family-metric);
|
90
|
+
margin-top: 0;
|
93
91
|
}
|
94
92
|
|
95
93
|
.n-myft-digest-promo__branding {
|
96
|
-
|
97
|
-
|
94
|
+
font-weight: normal;
|
95
|
+
white-space: nowrap;
|
98
96
|
}
|
99
97
|
|
100
98
|
.n-myft-digest-promo__cta-wrapper {
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
99
|
+
display: flex;
|
100
|
+
align-items: flex-end;
|
101
|
+
justify-content: unset;
|
102
|
+
padding-bottom: $spacing-unit;
|
103
|
+
clear: both;
|
104
|
+
|
105
|
+
@include oGridRespondTo('M') {
|
106
|
+
justify-content: flex-end;
|
107
|
+
}
|
110
108
|
}
|
111
109
|
|
112
110
|
.n-myft-digest-promo__cta-btn {
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
111
|
+
@include myftLozengeToggleButton();
|
112
|
+
display: inline-block;
|
113
|
+
text-transform: none;
|
114
|
+
min-width: 134px;
|
115
|
+
width: 134px;
|
116
|
+
margin-left: 80px;
|
117
|
+
|
118
|
+
&[disabled] {
|
119
|
+
min-width: 55px;
|
120
|
+
width: 55px;
|
121
|
+
}
|
122
|
+
|
123
|
+
.n-myft-digest-promo--generic &,
|
124
|
+
.n-myft-digest-promo--generic &[disabled] {
|
125
|
+
width: auto;
|
126
|
+
min-width: auto;
|
127
|
+
}
|
128
|
+
|
129
|
+
@include oGridRespondTo('M') {
|
130
|
+
margin-left: 0;
|
131
|
+
float: right;
|
132
|
+
}
|
135
133
|
}
|
@@ -6,7 +6,7 @@
|
|
6
6
|
<div class="o-grid-row">
|
7
7
|
|
8
8
|
<div data-o-grid-colspan="12 M8" class="n-myft-digest-promo__content">
|
9
|
-
<h2 class="n-myft-digest-promo__heading">
|
9
|
+
<h2 class="o3-type-body-highlight n-myft-digest-promo__heading">
|
10
10
|
Add to <span class="n-myft-digest-promo__branding">myFT Digest</span>
|
11
11
|
</h2>
|
12
12
|
<p class ="n-myft-digest-promo__para">Add this topic to your myFT Digest for news straight to your inbox</p>
|
@@ -19,7 +19,7 @@
|
|
19
19
|
{{/if}}>
|
20
20
|
{{> n-myft-ui/components/csrf-token/input}}
|
21
21
|
<div
|
22
|
-
class="n-myft-ui__announcement
|
22
|
+
class="n-myft-ui__announcement o3-visually-hidden"
|
23
23
|
aria-live="assertive"
|
24
24
|
data-pressed-text="Now following {{name}}."
|
25
25
|
data-unpressed-text="No longer following {{name}}."
|
@@ -1,7 +1,6 @@
|
|
1
1
|
import * as nNotification from '@financial-times/n-notification/main';
|
2
2
|
import Delegate from 'ftdomdelegate';
|
3
3
|
import myftClient from 'next-myft-client';
|
4
|
-
import { $, $$ } from 'n-ui-foundations/main';
|
5
4
|
import * as nextButtons from '../../myft-common';
|
6
5
|
|
7
6
|
const delegate = new Delegate(document.body);
|
@@ -40,7 +39,7 @@ function toggleButton (buttonEl, state) {
|
|
40
39
|
}
|
41
40
|
|
42
41
|
function updateButtons (subjectId, newState) {
|
43
|
-
const affectedButtons =
|
42
|
+
const affectedButtons = document.querySelectorAll(`${UI_HOOK}[data-concept-id="${subjectId}"] button`);
|
44
43
|
affectedButtons.forEach((button) => {
|
45
44
|
toggleButton(button, newState);
|
46
45
|
});
|
@@ -85,8 +84,8 @@ function formSubmitted (event, element) {
|
|
85
84
|
showAnonNotification();
|
86
85
|
} else {
|
87
86
|
const subjectId = element.getAttribute('data-concept-id');
|
88
|
-
const submitEl =
|
89
|
-
const inputs =
|
87
|
+
const submitEl = element.querySelector('button');
|
88
|
+
const inputs = element.querySelectorAll('input');
|
90
89
|
inputs.push(submitEl);
|
91
90
|
updateConceptData(subjectId, extractMetaData(inputs));
|
92
91
|
}
|
@@ -114,7 +113,7 @@ function eventListeners () {
|
|
114
113
|
// delegate is listening to the whole body therefore events look for forms across the whole page rather than setting up instances
|
115
114
|
// if we used instances we could reduce the amount of DOM queries that we do
|
116
115
|
export function init (opts) {
|
117
|
-
const instantAlertForms =
|
116
|
+
const instantAlertForms = document.querySelectorAll(UI_HOOK);
|
118
117
|
config = opts;
|
119
118
|
if (instantAlertForms.length > 0) {
|
120
119
|
applyModel();
|
@@ -20,11 +20,7 @@
|
|
20
20
|
aria-label="Alerts {{name}} currently disabled, change to enable"
|
21
21
|
aria-pressed="false"
|
22
22
|
{{/ifAll}}
|
23
|
-
class="n-myft-ui__button
|
24
|
-
{{#variant}} n-myft-ui__button--{{this}}{{/variant}}
|
25
|
-
{{#size}} n-myft-ui__button--{{this}}{{/size}}
|
26
|
-
n-myft-ui__button--instant
|
27
|
-
n-myft-ui__button--instant-light"
|
23
|
+
class="o3-button n-myft-ui__button--instant"
|
28
24
|
data-name="{{name}}"
|
29
25
|
{{#if alternateText}}
|
30
26
|
data-alternate-text="{{alternateText}}"
|