trepur_components 0.1.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/.storybook/main.js +32 -0
- package/.storybook/preview.js +9 -0
- package/README.md +70 -0
- package/babel.config.json +18 -0
- package/craco.config.js +10 -0
- package/dist/App.css +42 -0
- package/dist/App.js +24 -0
- package/dist/Components/Breadcrumbs/Breadcrumbs.js +32 -0
- package/dist/Components/Breadcrumbs/Breadcrumbs.stories.js +164 -0
- package/dist/Components/Breadcrumbs/README.md +1 -0
- package/dist/Components/BreadcrumbsBordered/Breadcrumbs.js +49 -0
- package/dist/Components/BreadcrumbsBordered/Breadcrumbs.stories.js +164 -0
- package/dist/Components/BreadcrumbsBordered/README.md +1 -0
- package/dist/Components/Button/Button.js +35 -0
- package/dist/Components/Button/Button.stories.js +185 -0
- package/dist/Components/Button/README.md +1 -0
- package/dist/Components/ButtonSlide/ButtonSlide.js +37 -0
- package/dist/Components/ButtonSlide/ButtonSlide.stories.js +185 -0
- package/dist/Components/ButtonSlide/README.md +1 -0
- package/dist/Components/ButtonSlide/Styles.css +25 -0
- package/dist/Components/Card/Card.js +83 -0
- package/dist/Components/Card/Card.stories.js +204 -0
- package/dist/Components/Card/README.md +1 -0
- package/dist/Components/CardImageLink/CardImageLink.js +36 -0
- package/dist/Components/CardImageLink/CardImageLink.stories.js +89 -0
- package/dist/Components/CardImageLink/README.md +0 -0
- package/dist/Components/CardImageLinkList/CardImageLinkList.js +35 -0
- package/dist/Components/CardImageLinkList/CardImageLinkList.stories.js +63 -0
- package/dist/Components/CardImageLinkList/README.md +0 -0
- package/dist/Components/CardList/CardList.js +36 -0
- package/dist/Components/CardList/CardList.stories.js +204 -0
- package/dist/Components/CardList/README.md +1 -0
- package/dist/Components/Icon/Icon.js +45 -0
- package/dist/Components/Icon/Icon.stories.js +73 -0
- package/dist/Components/Icon/README.md +1 -0
- package/dist/Components/Jumbotron/Jumbotron.js +43 -0
- package/dist/Components/Jumbotron/Jumbotron.stories.js +81 -0
- package/dist/Components/Jumbotron/README.md +0 -0
- package/dist/Components/Nav.js +170 -0
- package/dist/Components/Profile.js +41 -0
- package/dist/Components/Search.js +43 -0
- package/dist/Components/SignedInLinks.js +27 -0
- package/dist/Components/SignedOutLinks.js +22 -0
- package/dist/index.css +67 -0
- package/dist/index.js +19 -0
- package/package.json +71 -0
- package/public/Breadcrumbs/Breadcrumbs.stories.js +144 -0
- package/public/Logo.png +0 -0
- package/public/index.html +10 -0
- package/public/manifest.json +25 -0
- package/public/robots.txt +3 -0
- package/public/user.jpeg +0 -0
- package/src/App.css +42 -0
- package/src/App.js +23 -0
- package/src/Components/Breadcrumbs/Breadcrumbs.js +27 -0
- package/src/Components/Breadcrumbs/Breadcrumbs.stories.js +158 -0
- package/src/Components/Breadcrumbs/README.md +1 -0
- package/src/Components/BreadcrumbsBordered/Breadcrumbs.js +35 -0
- package/src/Components/BreadcrumbsBordered/Breadcrumbs.stories.js +159 -0
- package/src/Components/BreadcrumbsBordered/README.md +1 -0
- package/src/Components/Button/Button.js +26 -0
- package/src/Components/Button/Button.stories.js +144 -0
- package/src/Components/Button/README.md +1 -0
- package/src/Components/ButtonSlide/ButtonSlide.js +26 -0
- package/src/Components/ButtonSlide/ButtonSlide.stories.js +144 -0
- package/src/Components/ButtonSlide/README.md +1 -0
- package/src/Components/ButtonSlide/Styles.css +25 -0
- package/src/Components/Card/Card.js +67 -0
- package/src/Components/Card/Card.stories.js +190 -0
- package/src/Components/Card/README.md +1 -0
- package/src/Components/CardImageLink/CardImageLink.js +22 -0
- package/src/Components/CardImageLink/CardImageLink.stories.js +73 -0
- package/src/Components/CardImageLink/README.md +0 -0
- package/src/Components/CardImageLinkList/CardImageLinkList.js +24 -0
- package/src/Components/CardImageLinkList/CardImageLinkList.stories.js +50 -0
- package/src/Components/CardImageLinkList/README.md +0 -0
- package/src/Components/CardList/CardList.js +29 -0
- package/src/Components/CardList/CardList.stories.js +201 -0
- package/src/Components/CardList/README.md +1 -0
- package/src/Components/Icon/Icon.js +28 -0
- package/src/Components/Icon/Icon.stories.js +49 -0
- package/src/Components/Icon/README.md +1 -0
- package/src/Components/Jumbotron/Jumbotron.js +31 -0
- package/src/Components/Jumbotron/Jumbotron.stories.js +66 -0
- package/src/Components/Jumbotron/README.md +0 -0
- package/src/Components/Nav.js +109 -0
- package/src/Components/Profile.js +25 -0
- package/src/Components/Search.js +26 -0
- package/src/Components/SignedInLinks.js +14 -0
- package/src/Components/SignedOutLinks.js +11 -0
- package/src/index.css +67 -0
- package/src/index.js +4 -0
- package/tailwind.config.js +69 -0
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import Readme from './README.md'
|
|
3
|
+
import Card from './Card'
|
|
4
|
+
import '../../index.css';
|
|
5
|
+
|
|
6
|
+
export default {
|
|
7
|
+
title: 'Components/Card',
|
|
8
|
+
argTypes: {
|
|
9
|
+
},
|
|
10
|
+
decorators: [(story) => <div className={`p-4`}>{story()}</div>],
|
|
11
|
+
parameters: {
|
|
12
|
+
readme: {
|
|
13
|
+
sidebar: Readme,
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export const _Card = () => {
|
|
19
|
+
return (
|
|
20
|
+
<Card
|
|
21
|
+
id='card'
|
|
22
|
+
title='This is a title'
|
|
23
|
+
titleClass='text-center font-bold'
|
|
24
|
+
subTitle='This is a subtitle'
|
|
25
|
+
description='This is a description, it can be really long if you want it to be. The text will wrap onto a new line if it exceeds the width of the card'
|
|
26
|
+
></Card>
|
|
27
|
+
)
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export const CardTitleLeft = () => {
|
|
31
|
+
return (
|
|
32
|
+
<Card
|
|
33
|
+
id='card'
|
|
34
|
+
title='This is a title'
|
|
35
|
+
titleClass='font-bold'
|
|
36
|
+
subTitle='This is a subtitle'
|
|
37
|
+
description='This is a description, it can be really long if you want it to be. The text will wrap onto a new line if it exceeds the width of the card'
|
|
38
|
+
></Card>
|
|
39
|
+
)
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export const CardTitleRight = () => {
|
|
43
|
+
return (
|
|
44
|
+
<Card
|
|
45
|
+
id='card'
|
|
46
|
+
title='This is a title'
|
|
47
|
+
titleClass='font-bold text-right'
|
|
48
|
+
subTitle='This is a subtitle'
|
|
49
|
+
description='This is a description, it can be really long if you want it to be. The text will wrap onto a new line if it exceeds the width of the card'
|
|
50
|
+
></Card>
|
|
51
|
+
)
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export const CardWithImage = () => {
|
|
55
|
+
return (
|
|
56
|
+
<Card
|
|
57
|
+
id='card'
|
|
58
|
+
title='This is a title'
|
|
59
|
+
titleClass='text-center font-bold'
|
|
60
|
+
subTitle='This is a subtitle'
|
|
61
|
+
description='This is a description, it can be really long if you want it to be. The text will wrap onto a new line if it exceeds the width of the card'
|
|
62
|
+
image='https://picsum.photos/500/300'>
|
|
63
|
+
</Card>
|
|
64
|
+
)
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export const CardWithExtraText = () => {
|
|
68
|
+
return (
|
|
69
|
+
<Card
|
|
70
|
+
id='card'
|
|
71
|
+
title='This is a title'
|
|
72
|
+
titleClass='text-center font-bold'
|
|
73
|
+
subTitle='This is a subtitle'
|
|
74
|
+
extraText='This is some extra text'
|
|
75
|
+
description='This is a description, it can be really long if you want it to be. The text will wrap onto a new line if it exceeds the width of the card'
|
|
76
|
+
image='https://picsum.photos/500/300'>
|
|
77
|
+
</Card>
|
|
78
|
+
)
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export const CardWithButton = () => {
|
|
82
|
+
return (
|
|
83
|
+
<Card
|
|
84
|
+
id='card'
|
|
85
|
+
title='This is a title'
|
|
86
|
+
titleClass='text-center font-bold'
|
|
87
|
+
subTitle='This is a subtitle'
|
|
88
|
+
extraText='This is some extra text'
|
|
89
|
+
description='This is a description, it can be really long if you want it to be. The text will wrap onto a new line if it exceeds the width of the card'
|
|
90
|
+
image='https://picsum.photos/500/300'
|
|
91
|
+
hasCta
|
|
92
|
+
ctaText='This is a button'
|
|
93
|
+
>
|
|
94
|
+
</Card>
|
|
95
|
+
)
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
export const CardWithSlideButton = () => {
|
|
99
|
+
return (
|
|
100
|
+
<Card
|
|
101
|
+
id='card'
|
|
102
|
+
title='This is a title'
|
|
103
|
+
titleClass='text-center font-bold'
|
|
104
|
+
subTitle='This is a subtitle'
|
|
105
|
+
extraText='This is some extra text'
|
|
106
|
+
description='This is a description, it can be really long if you want it to be. The text will wrap onto a new line if it exceeds the width of the card'
|
|
107
|
+
image='https://picsum.photos/500/300'
|
|
108
|
+
hasCta
|
|
109
|
+
btnType='slide'
|
|
110
|
+
ctaText='This is a button'>
|
|
111
|
+
</Card>
|
|
112
|
+
)
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
export const CardWithImageBelowTitle = () => {
|
|
116
|
+
return (
|
|
117
|
+
<Card
|
|
118
|
+
id='card'
|
|
119
|
+
title='This is a title'
|
|
120
|
+
titleClass='text-center font-bold'
|
|
121
|
+
subTitle='This is a subtitle'
|
|
122
|
+
extraText='This is some extra text'
|
|
123
|
+
description='This is a description, it can be really long if you want it to be. The text will wrap onto a new line if it exceeds the width of the card'
|
|
124
|
+
image='https://picsum.photos/500/300'
|
|
125
|
+
hasCta
|
|
126
|
+
ctaText='This is a button'
|
|
127
|
+
imageBelowTitle>
|
|
128
|
+
</Card>
|
|
129
|
+
)
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
export const CardRounded = () => {
|
|
133
|
+
return (
|
|
134
|
+
<Card
|
|
135
|
+
id='card'
|
|
136
|
+
title='This is a title'
|
|
137
|
+
titleClass='text-center font-bold'
|
|
138
|
+
subTitle='This is a subtitle'
|
|
139
|
+
extraText='This is some extra text'
|
|
140
|
+
description='This is a description, it can be really long if you want it to be. The text will wrap onto a new line if it exceeds the width of the card'
|
|
141
|
+
image='https://picsum.photos/500/300'
|
|
142
|
+
hasCta
|
|
143
|
+
ctaText='This is a button'
|
|
144
|
+
rounded>
|
|
145
|
+
</Card>
|
|
146
|
+
)
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
export const CardRoundedWithImageBelowTitle = () => {
|
|
150
|
+
return (
|
|
151
|
+
<Card
|
|
152
|
+
id='card'
|
|
153
|
+
title='This is a title'
|
|
154
|
+
titleClass='text-center font-bold'
|
|
155
|
+
subTitle='This is a subtitle'
|
|
156
|
+
extraText='This is some extra text'
|
|
157
|
+
description='This is a description, it can be really long if you want it to be. The text will wrap onto a new line if it exceeds the width of the card'
|
|
158
|
+
image='https://picsum.photos/500/300'
|
|
159
|
+
hasCta
|
|
160
|
+
ctaText='This is a button'
|
|
161
|
+
imageBelowTitle
|
|
162
|
+
rounded>
|
|
163
|
+
</Card>
|
|
164
|
+
)
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
export const lotsOfCards = () => {
|
|
168
|
+
let cards = []
|
|
169
|
+
for (let i = 0; i < 8 ; i++) {
|
|
170
|
+
cards.push(<Card
|
|
171
|
+
id='card'
|
|
172
|
+
title='This is a title'
|
|
173
|
+
titleClass='text-center font-bold'
|
|
174
|
+
subTitle='This is a subtitle'
|
|
175
|
+
extraText='This is some extra text'
|
|
176
|
+
description='This is a description, it can be really long if you want it to be. The text will wrap onto a new line if it exceeds the width of the card'
|
|
177
|
+
image='https://picsum.photos/500/300'
|
|
178
|
+
hasCta
|
|
179
|
+
ctaText='This is a button'
|
|
180
|
+
imageBelowTitle
|
|
181
|
+
rounded>
|
|
182
|
+
</Card>)
|
|
183
|
+
}
|
|
184
|
+
return (
|
|
185
|
+
<div className="grid grid-cols-4 grid-flow-row">
|
|
186
|
+
{cards}
|
|
187
|
+
</div>
|
|
188
|
+
)
|
|
189
|
+
}
|
|
190
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
hello this is a card
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
|
|
3
|
+
const CardImageLink = ({
|
|
4
|
+
image,
|
|
5
|
+
altText,
|
|
6
|
+
text,
|
|
7
|
+
ctaText,
|
|
8
|
+
ctaLink,
|
|
9
|
+
classes,
|
|
10
|
+
}) => {
|
|
11
|
+
const classList = "cursor-pointer relative lg:mx-3 md:mx-1 mx-1 lg:mb-5 md:mb-2 mb-2 w-auto hover:opacity-50 overflow-hidden " + classes
|
|
12
|
+
return (
|
|
13
|
+
<div className={classList}>
|
|
14
|
+
<a href={ctaLink}>
|
|
15
|
+
<img src={image} alt={altText} className="object-cover w-full h-full" />
|
|
16
|
+
<div className="absolute w-full py-5 top-5 inset-x-0 bg-blue-400 text-black md:text-2xl text-xs text-center leading-4">{text}</div>
|
|
17
|
+
</a>
|
|
18
|
+
</div>
|
|
19
|
+
)
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export default CardImageLink
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import Readme from './README.md'
|
|
3
|
+
import CardImageLink from './CardImageLink'
|
|
4
|
+
import '../../index.css';
|
|
5
|
+
|
|
6
|
+
export default {
|
|
7
|
+
title: 'Components/CardImageLink',
|
|
8
|
+
argTypes: {
|
|
9
|
+
},
|
|
10
|
+
decorators: [(story) => <div className={`p-4`}>{story()}</div>],
|
|
11
|
+
parameters: {
|
|
12
|
+
readme: {
|
|
13
|
+
sidebar: Readme,
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export const _CardImageLink = (args) => {
|
|
19
|
+
return (
|
|
20
|
+
<CardImageLink
|
|
21
|
+
altText='image'
|
|
22
|
+
image='https://picsum.photos/400/400'
|
|
23
|
+
></CardImageLink>
|
|
24
|
+
)
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export const JumbotronWithOneBtn = (args) => {
|
|
28
|
+
return (
|
|
29
|
+
<CardImageLink
|
|
30
|
+
altText='image'
|
|
31
|
+
image='https://picsum.photos/400/400'
|
|
32
|
+
ctaText='This is a button'
|
|
33
|
+
></CardImageLink>
|
|
34
|
+
)
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export const JumbotronWithTwoBtns = (args) => {
|
|
38
|
+
return (
|
|
39
|
+
<CardImageLink
|
|
40
|
+
altText='image'
|
|
41
|
+
image='https://picsum.photos/400/400'
|
|
42
|
+
ctaText='This is a button'
|
|
43
|
+
ctaText2='This is another button'
|
|
44
|
+
></CardImageLink>
|
|
45
|
+
)
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export const JumbotronWithCenterText = (args) => {
|
|
49
|
+
return (
|
|
50
|
+
<CardImageLink
|
|
51
|
+
altText='image'
|
|
52
|
+
image='https://picsum.photos/400/400'
|
|
53
|
+
text='Some text here'
|
|
54
|
+
></CardImageLink>
|
|
55
|
+
)
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export const lotsOfCardImageLinks = (args) => {
|
|
59
|
+
let cards = []
|
|
60
|
+
for (let i = 0; i < 6 ; i++) {
|
|
61
|
+
cards.push(<CardImageLink
|
|
62
|
+
altText='image'
|
|
63
|
+
image='https://picsum.photos/400/400'
|
|
64
|
+
text='Some text here'
|
|
65
|
+
ctaText='This is a button'
|
|
66
|
+
></CardImageLink>)
|
|
67
|
+
}
|
|
68
|
+
return (
|
|
69
|
+
<div className="grid grid-cols-3 grid-flow-row">
|
|
70
|
+
{cards}
|
|
71
|
+
</div>
|
|
72
|
+
)
|
|
73
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import CardImageLink from "../CardImageLink/CardImageLink"
|
|
2
|
+
|
|
3
|
+
const CardImageLinkList = ({
|
|
4
|
+
list
|
|
5
|
+
}) => {
|
|
6
|
+
return (
|
|
7
|
+
<div className="grid md:grid-cols-4 sm:grid-cols-2">
|
|
8
|
+
{list && list.map((item, i) => {
|
|
9
|
+
const link = '/wainwright/' + item.Name.replace(/\s+/g, '')
|
|
10
|
+
return (
|
|
11
|
+
<CardImageLink altText='image'
|
|
12
|
+
image={'/' + item.Name.replace(/\s+/g, '') + '.jpeg' || 'https://picsum.photos/400/400'}
|
|
13
|
+
text={item.Name}
|
|
14
|
+
ctaLink={link}
|
|
15
|
+
key={item.HeightRank}>
|
|
16
|
+
</CardImageLink>
|
|
17
|
+
)
|
|
18
|
+
})}
|
|
19
|
+
</div>
|
|
20
|
+
)
|
|
21
|
+
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export default CardImageLinkList
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import Readme from './README.md'
|
|
3
|
+
import CardImageLinkList from './CardImageLinkList'
|
|
4
|
+
import '../../index.css';
|
|
5
|
+
|
|
6
|
+
const list = [
|
|
7
|
+
{
|
|
8
|
+
"HeightRank": 1,
|
|
9
|
+
"Name": "Scafell Pike",
|
|
10
|
+
"Section": "34B: LD C&W",
|
|
11
|
+
"Birkett": "Birkett",
|
|
12
|
+
"HeightInMeters": 978,
|
|
13
|
+
"PromInMeters": "912",
|
|
14
|
+
"HeightInFeet": "3,209",
|
|
15
|
+
"PromInFeet": "2,992",
|
|
16
|
+
"TopoMap": "89 90",
|
|
17
|
+
"OSGridReference": "NY215072",
|
|
18
|
+
"Classification\n(§ DoBIH codes)": "Ma,F,Sim,Hew,N,W,B,Sy,Fel,CoH,CoU,CoA"
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"HeightRank": 2,
|
|
22
|
+
"Name": "Scafell",
|
|
23
|
+
"Section": "34B: LD C&W",
|
|
24
|
+
"Birkett": "Birkett",
|
|
25
|
+
"HeightInMeters": 964,
|
|
26
|
+
"PromInMeters": "132",
|
|
27
|
+
"HeightInFeet": "3,162",
|
|
28
|
+
"PromInFeet": "434",
|
|
29
|
+
"TopoMap": "89 90",
|
|
30
|
+
"OSGridReference": "NY206064",
|
|
31
|
+
"Classification\n(§ DoBIH codes)": "Hu,F,Sim,Hew,N,W,B,Sy,Fel"
|
|
32
|
+
},
|
|
33
|
+
]
|
|
34
|
+
export default {
|
|
35
|
+
title: 'Components/CardImageLinkList',
|
|
36
|
+
argTypes: {
|
|
37
|
+
},
|
|
38
|
+
decorators: [(story) => <div className={`p-4`}>{story()}</div>],
|
|
39
|
+
parameters: {
|
|
40
|
+
readme: {
|
|
41
|
+
sidebar: Readme,
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export const _CardImageLinkList = (args) => {
|
|
47
|
+
return (
|
|
48
|
+
<CardImageLinkList list={list}></CardImageLinkList>
|
|
49
|
+
)
|
|
50
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import Card from "../Card/Card"
|
|
2
|
+
|
|
3
|
+
const CardList = ({
|
|
4
|
+
list
|
|
5
|
+
}) => {
|
|
6
|
+
return (
|
|
7
|
+
<div className="flex">
|
|
8
|
+
{list && list.map((item) => {
|
|
9
|
+
return (
|
|
10
|
+
<Card
|
|
11
|
+
id='card'
|
|
12
|
+
title={item.name}
|
|
13
|
+
titleClass='text-center font-bold'
|
|
14
|
+
subTitle='This is a subtitle'
|
|
15
|
+
extraText='This is some extra text'
|
|
16
|
+
description='This is a description, it can be really long if you want it to be. The text will wrap onto a new line if it exceeds the width of the card'
|
|
17
|
+
image='https://picsum.photos/500/300'
|
|
18
|
+
hasCta
|
|
19
|
+
ctaText='View'
|
|
20
|
+
imageBelowTitle
|
|
21
|
+
rounded>
|
|
22
|
+
</Card>
|
|
23
|
+
)
|
|
24
|
+
})}
|
|
25
|
+
</div>
|
|
26
|
+
)
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export default CardList
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import Readme from './README.md'
|
|
3
|
+
import CardList from './CardList'
|
|
4
|
+
import Card from '../Card/Card'
|
|
5
|
+
import '../../index.css';
|
|
6
|
+
|
|
7
|
+
const list = [
|
|
8
|
+
<Card
|
|
9
|
+
id='card'
|
|
10
|
+
title='This is a title'
|
|
11
|
+
titleClass='font-bold'
|
|
12
|
+
subTitle='This is a subtitle'
|
|
13
|
+
description='This is a description, it can be really long if you want it to be. The text will wrap onto a new line if it exceeds the width of the card'
|
|
14
|
+
></Card>,
|
|
15
|
+
<Card
|
|
16
|
+
id='card'
|
|
17
|
+
title='This is a title'
|
|
18
|
+
titleClass='font-bold'
|
|
19
|
+
subTitle='This is a subtitle'
|
|
20
|
+
description='This is a description, it can be really long if you want it to be. The text will wrap onto a new line if it exceeds the width of the card'
|
|
21
|
+
></Card>
|
|
22
|
+
]
|
|
23
|
+
export default {
|
|
24
|
+
title: 'Components/CardList',
|
|
25
|
+
argTypes: {
|
|
26
|
+
},
|
|
27
|
+
decorators: [(story) => <div className={`p-4`}>{story()}</div>],
|
|
28
|
+
parameters: {
|
|
29
|
+
readme: {
|
|
30
|
+
sidebar: Readme,
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export const _Cardlist = () => {
|
|
36
|
+
return (
|
|
37
|
+
<CardList list={list}></CardList>
|
|
38
|
+
)
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
// export const CardTitleLeft = () => {
|
|
42
|
+
// return (
|
|
43
|
+
// <Card
|
|
44
|
+
// id='card'
|
|
45
|
+
// title='This is a title'
|
|
46
|
+
// titleClass='font-bold'
|
|
47
|
+
// subTitle='This is a subtitle'
|
|
48
|
+
// description='This is a description, it can be really long if you want it to be. The text will wrap onto a new line if it exceeds the width of the card'
|
|
49
|
+
// ></Card>
|
|
50
|
+
// )
|
|
51
|
+
// }
|
|
52
|
+
|
|
53
|
+
// export const CardTitleRight = () => {
|
|
54
|
+
// return (
|
|
55
|
+
// <Card
|
|
56
|
+
// id='card'
|
|
57
|
+
// title='This is a title'
|
|
58
|
+
// titleClass='font-bold text-right'
|
|
59
|
+
// subTitle='This is a subtitle'
|
|
60
|
+
// description='This is a description, it can be really long if you want it to be. The text will wrap onto a new line if it exceeds the width of the card'
|
|
61
|
+
// ></Card>
|
|
62
|
+
// )
|
|
63
|
+
// }
|
|
64
|
+
|
|
65
|
+
// export const CardWithImage = () => {
|
|
66
|
+
// return (
|
|
67
|
+
// <Card
|
|
68
|
+
// id='card'
|
|
69
|
+
// title='This is a title'
|
|
70
|
+
// titleClass='text-center font-bold'
|
|
71
|
+
// subTitle='This is a subtitle'
|
|
72
|
+
// description='This is a description, it can be really long if you want it to be. The text will wrap onto a new line if it exceeds the width of the card'
|
|
73
|
+
// image='https://picsum.photos/500/300'>
|
|
74
|
+
// </Card>
|
|
75
|
+
// )
|
|
76
|
+
// }
|
|
77
|
+
|
|
78
|
+
// export const CardWithExtraText = () => {
|
|
79
|
+
// return (
|
|
80
|
+
// <Card
|
|
81
|
+
// id='card'
|
|
82
|
+
// title='This is a title'
|
|
83
|
+
// titleClass='text-center font-bold'
|
|
84
|
+
// subTitle='This is a subtitle'
|
|
85
|
+
// extraText='This is some extra text'
|
|
86
|
+
// description='This is a description, it can be really long if you want it to be. The text will wrap onto a new line if it exceeds the width of the card'
|
|
87
|
+
// image='https://picsum.photos/500/300'>
|
|
88
|
+
// </Card>
|
|
89
|
+
// )
|
|
90
|
+
// }
|
|
91
|
+
|
|
92
|
+
// export const CardWithButton = () => {
|
|
93
|
+
// return (
|
|
94
|
+
// <Card
|
|
95
|
+
// id='card'
|
|
96
|
+
// title='This is a title'
|
|
97
|
+
// titleClass='text-center font-bold'
|
|
98
|
+
// subTitle='This is a subtitle'
|
|
99
|
+
// extraText='This is some extra text'
|
|
100
|
+
// description='This is a description, it can be really long if you want it to be. The text will wrap onto a new line if it exceeds the width of the card'
|
|
101
|
+
// image='https://picsum.photos/500/300'
|
|
102
|
+
// hasCta
|
|
103
|
+
// ctaText='This is a button'
|
|
104
|
+
// >
|
|
105
|
+
// </Card>
|
|
106
|
+
// )
|
|
107
|
+
// }
|
|
108
|
+
|
|
109
|
+
// export const CardWithSlideButton = () => {
|
|
110
|
+
// return (
|
|
111
|
+
// <Card
|
|
112
|
+
// id='card'
|
|
113
|
+
// title='This is a title'
|
|
114
|
+
// titleClass='text-center font-bold'
|
|
115
|
+
// subTitle='This is a subtitle'
|
|
116
|
+
// extraText='This is some extra text'
|
|
117
|
+
// description='This is a description, it can be really long if you want it to be. The text will wrap onto a new line if it exceeds the width of the card'
|
|
118
|
+
// image='https://picsum.photos/500/300'
|
|
119
|
+
// hasCta
|
|
120
|
+
// btnType='slide'
|
|
121
|
+
// ctaText='This is a button'>
|
|
122
|
+
// </Card>
|
|
123
|
+
// )
|
|
124
|
+
// }
|
|
125
|
+
|
|
126
|
+
// export const CardWithImageBelowTitle = () => {
|
|
127
|
+
// return (
|
|
128
|
+
// <Card
|
|
129
|
+
// id='card'
|
|
130
|
+
// title='This is a title'
|
|
131
|
+
// titleClass='text-center font-bold'
|
|
132
|
+
// subTitle='This is a subtitle'
|
|
133
|
+
// extraText='This is some extra text'
|
|
134
|
+
// description='This is a description, it can be really long if you want it to be. The text will wrap onto a new line if it exceeds the width of the card'
|
|
135
|
+
// image='https://picsum.photos/500/300'
|
|
136
|
+
// hasCta
|
|
137
|
+
// ctaText='This is a button'
|
|
138
|
+
// imageBelowTitle>
|
|
139
|
+
// </Card>
|
|
140
|
+
// )
|
|
141
|
+
// }
|
|
142
|
+
|
|
143
|
+
// export const CardRounded = () => {
|
|
144
|
+
// return (
|
|
145
|
+
// <Card
|
|
146
|
+
// id='card'
|
|
147
|
+
// title='This is a title'
|
|
148
|
+
// titleClass='text-center font-bold'
|
|
149
|
+
// subTitle='This is a subtitle'
|
|
150
|
+
// extraText='This is some extra text'
|
|
151
|
+
// description='This is a description, it can be really long if you want it to be. The text will wrap onto a new line if it exceeds the width of the card'
|
|
152
|
+
// image='https://picsum.photos/500/300'
|
|
153
|
+
// hasCta
|
|
154
|
+
// ctaText='This is a button'
|
|
155
|
+
// rounded>
|
|
156
|
+
// </Card>
|
|
157
|
+
// )
|
|
158
|
+
// }
|
|
159
|
+
|
|
160
|
+
// export const CardRoundedWithImageBelowTitle = () => {
|
|
161
|
+
// return (
|
|
162
|
+
// <Card
|
|
163
|
+
// id='card'
|
|
164
|
+
// title='This is a title'
|
|
165
|
+
// titleClass='text-center font-bold'
|
|
166
|
+
// subTitle='This is a subtitle'
|
|
167
|
+
// extraText='This is some extra text'
|
|
168
|
+
// description='This is a description, it can be really long if you want it to be. The text will wrap onto a new line if it exceeds the width of the card'
|
|
169
|
+
// image='https://picsum.photos/500/300'
|
|
170
|
+
// hasCta
|
|
171
|
+
// ctaText='This is a button'
|
|
172
|
+
// imageBelowTitle
|
|
173
|
+
// rounded>
|
|
174
|
+
// </Card>
|
|
175
|
+
// )
|
|
176
|
+
// }
|
|
177
|
+
|
|
178
|
+
// export const lotsOfCards = () => {
|
|
179
|
+
// let cards = []
|
|
180
|
+
// for (let i = 0; i < 8 ; i++) {
|
|
181
|
+
// cards.push(<Card
|
|
182
|
+
// id='card'
|
|
183
|
+
// title='This is a title'
|
|
184
|
+
// titleClass='text-center font-bold'
|
|
185
|
+
// subTitle='This is a subtitle'
|
|
186
|
+
// extraText='This is some extra text'
|
|
187
|
+
// description='This is a description, it can be really long if you want it to be. The text will wrap onto a new line if it exceeds the width of the card'
|
|
188
|
+
// image='https://picsum.photos/500/300'
|
|
189
|
+
// hasCta
|
|
190
|
+
// ctaText='This is a button'
|
|
191
|
+
// imageBelowTitle
|
|
192
|
+
// rounded>
|
|
193
|
+
// </Card>)
|
|
194
|
+
// }
|
|
195
|
+
// return (
|
|
196
|
+
// <div className="grid grid-cols-4 grid-flow-row">
|
|
197
|
+
// {cards}
|
|
198
|
+
// </div>
|
|
199
|
+
// )
|
|
200
|
+
// }
|
|
201
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
hello this is a card
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import PropTypes from 'prop-types'
|
|
3
|
+
|
|
4
|
+
const Icon = ({ type, size, className, onClick }) => {
|
|
5
|
+
if (!type) return <></>
|
|
6
|
+
|
|
7
|
+
let classList = `fa fa-${type} fa-x `
|
|
8
|
+
classList += size? `fa-${size}x ` : ``
|
|
9
|
+
classList += className ? ` ${className}` : ``
|
|
10
|
+
|
|
11
|
+
return (
|
|
12
|
+
<span
|
|
13
|
+
className={classList}
|
|
14
|
+
role='img'
|
|
15
|
+
aria-hidden='true'
|
|
16
|
+
aria-label={type}
|
|
17
|
+
{...(onClick && { onClick: onClick })}
|
|
18
|
+
></span>
|
|
19
|
+
)
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
Icon.propTypes = {
|
|
23
|
+
type: PropTypes.string,
|
|
24
|
+
className: PropTypes.string,
|
|
25
|
+
onClick: PropTypes.func,
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export default Icon
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import Readme from './README.md'
|
|
3
|
+
import Icon from './Icon'
|
|
4
|
+
import '../../index.css';
|
|
5
|
+
|
|
6
|
+
export default {
|
|
7
|
+
title: 'Components/Icon',
|
|
8
|
+
decorators: [(story) => <div className={`p-4`}>{story()}</div>],
|
|
9
|
+
parameters: {
|
|
10
|
+
readme: {
|
|
11
|
+
sidebar: Readme,
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export const _Icon = (args) => {
|
|
17
|
+
return (
|
|
18
|
+
<Icon type='thumbs-up'>
|
|
19
|
+
</Icon>
|
|
20
|
+
)
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export const withSizeTwo = (args) => {
|
|
24
|
+
return (
|
|
25
|
+
<Icon type='thumbs-up' size='2'>
|
|
26
|
+
</Icon>
|
|
27
|
+
)
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export const withSizeThree = (args) => {
|
|
31
|
+
return (
|
|
32
|
+
<Icon type='thumbs-up' size='3'>
|
|
33
|
+
</Icon>
|
|
34
|
+
)
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export const withSizeFour = (args) => {
|
|
38
|
+
return (
|
|
39
|
+
<Icon type='thumbs-up' size='4'>
|
|
40
|
+
</Icon>
|
|
41
|
+
)
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export const withSizeFive = (args) => {
|
|
45
|
+
return (
|
|
46
|
+
<Icon type='thumbs-up' size='5'>
|
|
47
|
+
</Icon>
|
|
48
|
+
)
|
|
49
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
hello this is a button
|