@financial-times/n-myft-ui 24.0.0 → 25.0.0-beta.2
Sign up to get free protection for your applications and to get access to all the features.
- package/.circleci/config.yml +18 -18
- package/README.md +51 -0
- package/build-state/npm-shrinkwrap.json +41988 -10988
- package/components/collections/collections.jsx +68 -0
- package/components/collections/collections.test.js +83 -0
- package/components/concept-list/concept-list.jsx +55 -0
- package/components/concept-list/concept-list.test.js +116 -0
- package/components/follow-button/__tests__/follow-button.test.js +3 -3
- package/components/follow-button/follow-button.jsx +3 -3
- package/components/index.js +15 -0
- package/components/pin-button/pin-button.jsx +40 -0
- package/components/pin-button/pin-button.test.js +57 -0
- package/components/save-for-later/save-for-later.jsx +103 -0
- package/components/save-for-later/save-for-later.test.js +59 -0
- package/demos/app.js +18 -27
- package/demos/templates/demo-layout.html +1 -1
- package/demos/templates/demo.html +436 -413
- package/demos/templates/demo.jsx +93 -1
- package/dist/bundles/bundle.js +3133 -0
- package/package.json +19 -9
- package/webpack.config.js +34 -0
- package/components/collections/collections.html +0 -77
- package/components/concept-list/concept-list.html +0 -28
- package/components/pin-button/pin-button.html +0 -20
- package/components/save-for-later/save-for-later.html +0 -67
- package/demos/fixtures/follow-button-plus-digest.json +0 -6
- package/demos/templates/digest-on-follow.html +0 -12
package/demos/templates/demo.jsx
CHANGED
@@ -1,5 +1,9 @@
|
|
1
1
|
import React from 'react';
|
2
2
|
import FollowButton from '../../components/follow-button/follow-button';
|
3
|
+
import ConceptList from '../../components/concept-list/concept-list';
|
4
|
+
import Collections from '../../components/collections/collections';
|
5
|
+
import { SaveForLater } from '../../components';
|
6
|
+
import { PinButton } from '../../components';
|
3
7
|
|
4
8
|
export default function Demo (props) {
|
5
9
|
|
@@ -7,9 +11,13 @@ export default function Demo (props) {
|
|
7
11
|
title,
|
8
12
|
flags,
|
9
13
|
followButton,
|
14
|
+
conceptList,
|
15
|
+
collections,
|
16
|
+
saveButton,
|
17
|
+
pinButton
|
10
18
|
} = props;
|
11
19
|
|
12
|
-
const followButtonProps = {...followButton, flags};
|
20
|
+
const followButtonProps = { ...followButton, flags };
|
13
21
|
|
14
22
|
return (
|
15
23
|
<div className="o-grid-container o-grid-container--snappy demo-container">
|
@@ -25,9 +33,93 @@ export default function Demo (props) {
|
|
25
33
|
Follow button
|
26
34
|
</h2>
|
27
35
|
<FollowButton {...followButtonProps} />
|
36
|
+
|
37
|
+
|
38
|
+
<h2
|
39
|
+
className="demo-section__title">
|
40
|
+
x-dash follow button
|
41
|
+
</h2>
|
42
|
+
|
43
|
+
<FollowButton {...followButtonProps} buttonText={followButton.name} />
|
44
|
+
|
45
|
+
|
46
|
+
<h2 className="demo-section__title">
|
47
|
+
Save button
|
48
|
+
</h2>
|
49
|
+
<SaveForLater flags={flags} {...saveButton} />
|
50
|
+
|
51
|
+
<h2 className="demo-section__title">
|
52
|
+
Unsave button
|
53
|
+
</h2>
|
54
|
+
<SaveForLater flags={flags} {...saveButton} isSaved={true} />
|
55
|
+
|
56
|
+
<h2 className="demo-section__title">
|
57
|
+
Unsave button with icon
|
58
|
+
</h2>
|
59
|
+
<SaveForLater flags={flags} {...saveButton} saveButtonWithIcon={true} />
|
60
|
+
|
61
|
+
<h2 className="demo-section__title">
|
62
|
+
Save button with icon
|
63
|
+
</h2>
|
64
|
+
<SaveForLater flags={flags} {...saveButton} isSaved={true} saveButtonWithIcon={true} />
|
65
|
+
|
66
|
+
<h2 className="demo-section__title">
|
67
|
+
Pin button
|
68
|
+
</h2>
|
69
|
+
|
70
|
+
{pinButton.map((item, index) => <PinButton key={index} {...item}/>)}
|
71
|
+
|
72
|
+
</div>
|
73
|
+
</div>
|
74
|
+
</section>
|
75
|
+
|
76
|
+
<section
|
77
|
+
id="topic-list"
|
78
|
+
className="demo-section">
|
79
|
+
<div className="o-grid-row">
|
80
|
+
<div data-o-grid-colspan="12">
|
81
|
+
<h2 className="demo-section__title">
|
82
|
+
Topic list
|
83
|
+
</h2>
|
84
|
+
|
85
|
+
<p className="demo-section__description">
|
86
|
+
A list of topics to follow
|
87
|
+
</p>
|
88
|
+
</div>
|
89
|
+
|
90
|
+
{
|
91
|
+
conceptList && conceptList.map((list, index) =>
|
92
|
+
<div key={index} data-o-grid-colspan="3">
|
93
|
+
<ConceptList {...list} flags={flags} />
|
94
|
+
</div>)
|
95
|
+
}
|
96
|
+
|
97
|
+
</div>
|
98
|
+
</section>
|
99
|
+
|
100
|
+
<section
|
101
|
+
id="collections"
|
102
|
+
className="demo-section">
|
103
|
+
<div className="o-grid-row">
|
104
|
+
<div data-o-grid-colspan="12">
|
105
|
+
<h2 className="demo-section__title">
|
106
|
+
Collections
|
107
|
+
</h2>
|
108
|
+
|
109
|
+
<p className="demo-section__description">
|
110
|
+
Curated collections of topics to follow.
|
111
|
+
</p>
|
28
112
|
</div>
|
113
|
+
|
114
|
+
{collections.map((collection, index) => (
|
115
|
+
<div key={index} data-o-grid-colspan="3">
|
116
|
+
<Collections {...collection} flags={flags} />
|
117
|
+
</div>
|
118
|
+
))}
|
119
|
+
|
29
120
|
</div>
|
30
121
|
</section>
|
122
|
+
|
31
123
|
</div>
|
32
124
|
)
|
33
125
|
}
|