@nationalarchives/frontend 0.1.5-prerelease → 0.1.6-prerelease
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/README.md +1 -1
- package/govuk-prototype-kit.config.json +10 -2
- package/nationalarchives/all.css +1 -1
- package/nationalarchives/all.css.map +1 -1
- package/nationalarchives/all.scss +4 -3
- package/nationalarchives/components/_all.scss +5 -7
- package/nationalarchives/components/button/_index.scss +15 -16
- package/nationalarchives/components/button/button.stories.js +1 -2
- package/nationalarchives/components/card/_index.scss +71 -24
- package/nationalarchives/components/card/card.stories.js +41 -10
- package/nationalarchives/components/card/fixtures.json +135 -7
- package/nationalarchives/components/card/macro-options.json +42 -10
- package/nationalarchives/components/card/template.njk +53 -24
- package/nationalarchives/components/footer/_index.scss +61 -51
- package/nationalarchives/components/footer/fixtures.json +1 -1
- package/nationalarchives/components/footer/footer.stories.js +22 -2
- package/nationalarchives/components/footer/macro-options.json +12 -0
- package/nationalarchives/components/footer/template.njk +16 -5
- package/nationalarchives/components/grid/_index.scss +127 -52
- package/nationalarchives/components/grid/grid.stories.js +2 -3
- package/nationalarchives/components/sensitive-image/_index.scss +55 -58
- package/nationalarchives/components/sensitive-image/sensitive-image.stories.js +1 -2
- package/nationalarchives/stories/design/about.mdx +25 -0
- package/nationalarchives/stories/utilities/heading-groups.stories.js +44 -0
- package/nationalarchives/stories/{global → utilities}/headings.stories.js +1 -1
- package/nationalarchives/stories/utilities/lists.stories.js +38 -0
- package/nationalarchives/stories/{global → utilities}/typography.mdx +8 -8
- package/nationalarchives/stories/utilities/typography.stories.js +14 -0
- package/nationalarchives/templates/homepage.njk +64 -0
- package/nationalarchives/templates/layouts/_generic.njk +60 -0
- package/nationalarchives/tools/_all.scss +2 -2
- package/nationalarchives/tools/_grid.scss +4 -91
- package/nationalarchives/tools/_typography.scss +6 -0
- package/nationalarchives/utilities/_all.scss +2 -2
- package/nationalarchives/utilities/_global.scss +8 -0
- package/nationalarchives/utilities/_typography.scss +126 -18
- package/nationalarchives/variables/_all.scss +3 -2
- package/nationalarchives/variables/_grid.scss +7 -7
- package/nationalarchives/variables/_media.scss +11 -11
- package/nationalarchives/variables/_typography.scss +10 -0
- package/package.json +1 -1
- package/nationalarchives/_base.scss +0 -3
- package/nationalarchives/_prototype-kit.scss +0 -3
- package/nationalarchives/components/button/_button.scss +0 -2
- package/nationalarchives/components/card/_card.scss +0 -2
- package/nationalarchives/components/footer/_footer.scss +0 -2
- package/nationalarchives/components/grid/_grid.scss +0 -2
- package/nationalarchives/components/sensitive-image/_sensitive-image.scss +0 -2
- package/nationalarchives/stories/global/heading-groups.stories.js +0 -23
- package/nationalarchives/stories/global/typography.stories.js +0 -15
- package/nationalarchives/tools/_exports.scss +0 -36
package/README.md
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
# The National Archives Frontend
|
4
4
|
|
5
|
-
[](https://github.com/nationalarchives/tna-frontend/actions/workflows/
|
5
|
+
[](https://github.com/nationalarchives/tna-frontend/actions/workflows/ci.yml?query=branch%3Amain)
|
6
6
|
[](https://github.com/nationalarchives/tna-frontend/releases)
|
7
7
|
[](https://www.npmjs.com/package/@nationalarchives/frontend)
|
8
8
|
[](https://github.com/nationalarchives/tna-frontend/blob/main/.nvmrc)
|
@@ -9,6 +9,14 @@
|
|
9
9
|
"/nationalarchives/assets"
|
10
10
|
],
|
11
11
|
"sass": [
|
12
|
-
"/nationalarchives/
|
13
|
-
]
|
12
|
+
"/nationalarchives/all.scss"
|
13
|
+
],
|
14
|
+
"stylesheets": [
|
15
|
+
"/nationalarchives/all.css"
|
16
|
+
],
|
17
|
+
"templates": {
|
18
|
+
"name": "National Archives homepage",
|
19
|
+
"path": "/nationalarchives/templates/homepage.njk",
|
20
|
+
"type": "nunjucks"
|
21
|
+
}
|
14
22
|
}
|
package/nationalarchives/all.css
CHANGED
@@ -1 +1 @@
|
|
1
|
-
@import"https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;700&family=Roboto+Mono:wght@500;700&display=swap";.tna-template{min-width:320px;width:100%;height:100%;overflow-x:hidden;overflow-y:auto;-webkit-overflow-scrolling:touch}@media(prefers-reduced-motion){.tna-template *{animation:none !important;transition:none !important}}.tna-template__body{margin:0;padding:0;background-color:#fff;overflow:auto}img,svg,video,canvas{max-width:100%;display:block}video,canvas{width:100%}.tna-template{font-family:"Open Sans",sans-serif;font-
|
1
|
+
@import"https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;700&family=Roboto+Mono:wght@500;700&display=swap";@import"https://use.typekit.net/hkj3kuz.css";.tna-template{min-width:320px;width:100%;height:100%;overflow-x:hidden;overflow-y:auto;-webkit-overflow-scrolling:touch;font-size:16}@media(prefers-reduced-motion){.tna-template *{animation:none !important;transition:none !important}}.tna-template__body{margin:0;padding:0;background-color:#fff;overflow:auto}img,svg,video,canvas{max-width:100%;display:block}video,canvas{width:100%}*:focus{outline:3px #f0a solid}.tna-template{font-family:"Open Sans",sans-serif;font-weight:400;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility;-webkit-text-size-adjust:none;direction:ltr}.tna-template h1,.tna-template h2,.tna-template h3,.tna-template h4,.tna-template h5,.tna-template h6,.tna-template p,.tna-template ul,.tna-template ol{margin:0 0 2rem}.tna-template h1:last-child,.tna-template h2:last-child,.tna-template h3:last-child,.tna-template h4:last-child,.tna-template h5:last-child,.tna-template h6:last-child,.tna-template p:last-child,.tna-template ul:last-child,.tna-template ol:last-child{margin-bottom:0}.tna-template a:hover,.tna-template a:link:hover{text-decoration-thickness:3px}.tna-template a:active,.tna-template a:link:active{text-decoration-thickness:4px}.tna-template ul,.tna-ul,.tna-template ol,.tna-ol{padding-left:2rem}.tna-template ul li::marker,.tna-ul li::marker,.tna-template ol li::marker,.tna-ol li::marker{color:#f0a;font-weight:700}.tna-template .tna-ul--plain,.tna-template .tna-ol--plain{padding-left:0;list-style:none}.tna-template__body{font-size:1rem;line-height:1.6}.tna-heading{margin-bottom:2rem;font-family:supria-sans-condensed,monospace;font-weight:600}.tna-heading--xl{font-size:4rem}.tna-heading--l{font-size:2rem}.tna-heading--m{font-size:1.25rem}.tna-heading--s{font-size:1.125rem}.tna-hgroup__supertitle{font-size:0.875rem;font-family:"Roboto Mono",monospace;font-weight:500;text-transform:uppercase}.tna-hgroup .tna-hgroup__supertitle{margin:0}.tna-hgroup__title .tna-hgroup__supertitle{display:block}.tna-hgroup--xl .tna-hgroup__title{font-size:4rem}.tna-hgroup--l .tna-hgroup__title{font-size:2rem}.tna-hgroup--m .tna-hgroup__title{font-size:1.25rem}.tna-hgroup--s .tna-hgroup__title{font-size:1.125rem}.tna-button{padding:.25rem 1rem;display:inline-block;color:#fff;font-weight:700;text-decoration:none;background-color:#000}.tna-button:hover{background-color:#069}.tna-button--secondary{color:#000;background-color:#ff0}.tna-button--secondary:hover{color:#fff}.tna-card__inner{display:-ms-flexbox;display:flex;-ms-box-orient:vertical;-ms-flex-direction:column;flex-direction:column}.tna-card__heading{order:2}.tna-card__title{order:2}.tna-card__image-container{order:1}.tna-card__body{margin-top:2rem;order:3}.tna-card__actions{margin-top:2rem;order:4}.tna-card--featured{padding-left:50%;position:relative;background-color:#ff0}.tna-card--featured .tna-card__inner{padding:2rem}.tna-card--featured .tna-card__heading{padding-bottom:2rem;border-bottom:2px #000 solid}.tna-card--featured .tna-card__image-container{display:flex;align-items:center;justify-content:center;position:absolute;top:0;right:50%;bottom:0;left:0}.tna-card--featured .tna-card__image{width:100%;height:100%;object-fit:cover}.tna-footer{padding-top:3rem;padding-bottom:3rem;color:#fff;background-color:#26262a}.tna-footer__link{color:inherit}.tna-footer__link:hover{color:#f0a}.tna-footer__navigation{padding-bottom:3rem}.tna-footer__navigation-group-items{padding-left:0;list-style:none}.tna-footer__social{padding-bottom:4rem}.tna-footer__social.tna-container{align-items:flex-end}.tna-footer__social-item{text-align:center}.tna-footer__social-item-link{display:block}.tna-footer__social-item-link-image{display:block}.tna-footer__licence.tna-container{align-items:center}.tna-footer__licence-logo{display:block}.tna-footer__govuk-link{display:inline-block;color:inherit;fill:#fff}.tna-footer__govuk-link:hover{color:#f0a;fill:#f0a}.tna-footer__govuk-logotype-crown{margin:0 auto;display:block;fill:inherit}.tna-container{max-width:75.25rem;width:100%;margin-right:auto;margin-left:auto;padding-right:1rem;padding-left:1rem;box-sizing:border-box;display:-ms-flexbox;display:flex;flex-wrap:wrap;justify-content:stretch;align-items:stretch}.tna-container.tna-container--max{max-width:none}.tna-container.tna-container--no-padding{max-width:71.25rem;padding-right:0;padding-left:0}.tna-container.tna-container--no-padding .tna-column{padding-right:0;padding-left:0}.tna-column{padding-right:1rem;padding-left:1rem;box-sizing:border-box}.tna-column.tna-column--full{width:100%}.tna-column--flex-1{flex:1 0}.tna-column--flex-2{flex:2 0}.tna-column--flex-3{flex:3 0}.tna-column--width-1-12{width:8.3333333333%;flex:none}.tna-column--width-1-6{width:16.6666666667%;flex:none}.tna-column--width-1-4{width:25%;flex:none}.tna-column--width-1-3{width:33.3333333333%;flex:none}.tna-column--width-5-12{width:41.6666666667%;flex:none}.tna-column--width-1-2{width:50%;flex:none}.tna-column--width-7-12{width:58.3333333333%;flex:none}.tna-column--width-2-3{width:66.6666666667%;flex:none}.tna-column--width-3-4{width:75%;flex:none}.tna-column--width-5-6{width:83.3333333333%;flex:none}.tna-column--width-11-12{width:91.6666666667%;flex:none}@media(min-width: 769px)and (max-width: 1024px){.tna-column--full-medium{width:100%;flex:none}.tna-column--flex-1-medium{flex:1 0}.tna-column--flex-2-medium{flex:2 0}.tna-column--flex-3-medium{flex:3 0}.tna-column--width-1-6-medium{width:16.6666666667%;flex:none}.tna-column--width-1-3-medium{width:33.3333333333%;flex:none}.tna-column--width-1-2-medium{width:50%;flex:none}.tna-column--width-2-3-medium{width:66.6666666667%;flex:none}.tna-column--width-5-6-medium{width:83.3333333333%;flex:none}}@media(max-width: 768px){.tna-container{padding-right:1.125rem;padding-left:1.125rem}.tna-column{padding-right:.375rem;padding-left:.375rem}}@media(min-width: 481px)and (max-width: 768px){.tna-column--full-small{width:100%;flex:none}.tna-column--flex-1-small{flex:1 0}.tna-column--flex-2-small{flex:2 0}.tna-column--flex-3-small{flex:3 0}.tna-column--width-1-4-small{width:25%;flex:none}.tna-column--width-1-2-small{width:50%;flex:none}.tna-column--width-3-4-small{width:75%;flex:none}}@media(max-width: 480px){.tna-column--full-tiny{width:100%;flex:none}.tna-column--flex-1-tiny{width:auto;flex:1 0}.tna-column--flex-2-tiny{width:auto;flex:2 0}.tna-column--flex-3-tiny{width:auto;flex:3 0}.tna-column--width-1-2-tiny{width:50%;flex:none}}.tna-sensitive-image__details{position:relative}.tna-sensitive-image__details::after{width:100%;padding-bottom:calc(100%*var(--sensitive-image-height)/var(--sensitive-image-width));display:block;position:relative;z-index:-1;background-image:var(--sensitive-image);background-clip:padding-box;background-size:contain;filter:blur(20px) saturate(0);content:""}.tna-sensitive-image__show{display:flex;align-items:center;justify-content:center;position:absolute;top:0;right:0;bottom:0;left:0;z-index:1;font-size:0;cursor:pointer}.tna-sensitive-image__show::after{padding:.5rem 2rem;font-size:1rem;background-color:#ff0;content:attr(data-action)}.tna-sensitive-image__show:hover::after{color:#fff;background-color:#000}.tna-sensitive-image__image{width:100%}.tna-sensitive-image__details[open]::after,.tna-sensitive-image__details[open] .tna-sensitive-image__show{display:none}/*# sourceMappingURL=all.css.map */
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sourceRoot":"","sources":["../../src/nationalarchives/utilities/_typography.scss","../../src/nationalarchives/utilities/_global.scss","../../src/nationalarchives/components/button/_index.scss","../../src/nationalarchives/components/card/_index.scss","../../src/nationalarchives/components/footer/_index.scss","../../src/nationalarchives/components/grid/_index.scss","../../src/nationalarchives/variables/_grid.scss","../../src/nationalarchives/tools/_grid.scss","../../src/nationalarchives/components/sensitive-image/_index.scss"],"names":[],"mappings":"
|
1
|
+
{"version":3,"sourceRoot":"","sources":["../../src/nationalarchives/utilities/_typography.scss","../../src/nationalarchives/utilities/_global.scss","../../src/nationalarchives/variables/_typography.scss","../../src/nationalarchives/tools/_typography.scss","../../src/nationalarchives/components/button/_index.scss","../../src/nationalarchives/components/card/_index.scss","../../src/nationalarchives/components/footer/_index.scss","../../src/nationalarchives/components/grid/_index.scss","../../src/nationalarchives/variables/_grid.scss","../../src/nationalarchives/tools/_grid.scss","../../src/nationalarchives/components/sensitive-image/_index.scss"],"names":[],"mappings":"AAIQ,sHACA,6CCHR,cACE,gBACA,WACA,YAEA,kBACA,gBACA,iCAEA,UCXe,GDaf,+BACE,gBACE,0BACA,4BAKN,oBACE,SACA,UAEA,sBAEA,cAGF,qBAIE,eAEA,cAGF,aAEE,WAGF,QACE,uBDtCF,cACE,YENe,uBFOf,YENe,IFOf,kCACA,mCACA,kCACA,8BACA,cAEA,wJASE,gBAEA,2PACE,gBAOA,iDACE,8BAGF,mDACE,8BAgDR,kDAIE,kBAEA,8FACE,WACA,gBAIJ,0DAEE,eAEA,gBAGF,oBGvGE,eHyGA,gBAGF,aACE,mBAEA,YE9GkB,gCF+GlB,YE9GkB,IFiHpB,iBGnHE,eHuHF,gBGvHE,eH2HF,gBG3HE,kBH+HF,gBG/HE,mBHsIF,wBGtIE,mBHwIA,YEpIiB,wBFqIjB,YEpIiB,IFqIjB,yBAEA,oCACE,SAKF,2CACE,cAQF,mCG3JA,eHoKA,kCGpKA,eH6KA,kCG7KA,kBHsLA,kCGtLA,mBCJF,YACE,oBAEA,qBAEA,WACA,gBACA,qBAEA,sBAEA,kBACE,sBAIJ,uBACE,WAEA,sBAEA,6BACE,WCjBJ,iBACE,oBACA,aACA,wBACA,0BACA,sBAGF,mBACE,QAMF,iBACE,QAMF,2BACE,QAMF,gBACE,gBAEA,QAGF,mBACE,gBAEA,QAMF,oBACE,iBAEA,kBAEA,sBAEA,qCACE,aAGF,uCACE,oBAEA,6BAGF,+CACE,aACA,mBACA,uBAEA,kBACA,MACA,UACA,SACA,OAGF,qCACE,WACA,YACA,iBCjFJ,YACE,iBACA,oBAEA,WAEA,yBAGF,kBACE,cAEA,wBACE,WAIJ,wBACE,oBASF,oCACE,eAEA,gBASF,oBACE,oBAEA,kCACE,qBAIJ,yBACE,kBAGF,8BACE,cAGF,oCACE,cAIA,mCACE,mBAIJ,0BACE,cAGF,wBACE,qBAEA,cACA,UAEA,8BACE,WACA,UAIJ,kCACE,cACA,cAEA,aChFF,eACE,UCNwB,SDOxB,WACA,kBACA,iBACA,mBACA,kBAEA,sBAEA,oBACA,aACA,eACA,wBACA,oBAEA,kCACE,eAGF,yCACE,mBACA,gBACA,eAEA,qDACE,gBACA,eAKN,YACE,mBACA,kBAEA,sBAEA,6BACE,WAUF,oBACE,SADF,oBACE,SADF,oBACE,SE5CI,wBACE,oBACA,UAFF,uBACE,qBACA,UAFF,uBACE,UACA,UAFF,uBACE,qBACA,UAFF,wBACE,qBACA,UAFF,uBACE,UACA,UAFF,wBACE,qBACA,UAFF,uBACE,qBACA,UAFF,uBACE,UACA,UAFF,uBACE,qBACA,UAFF,yBACE,qBACA,UFsDV,gDACE,yBACE,WACA,UAIA,2BACE,SADF,2BACE,SADF,2BACE,SEhEE,8BACE,qBACA,UAFF,8BACE,qBACA,UAFF,8BACE,UACA,UAFF,8BACE,qBACA,UAFF,8BACE,qBACA,WF2EV,yBACE,eACE,uBACA,sBAGF,YACE,sBACA,sBAoBJ,+CACE,wBACE,WACA,UAIA,0BACE,SADF,0BACE,SADF,0BACE,SEjHE,6BACE,UACA,UAFF,6BACE,UACA,UAFF,6BACE,UACA,WF4HV,yBACE,uBACE,WACA,UAIA,yBACE,WAEA,SAHF,yBACE,WAEA,SAHF,yBACE,WAEA,SExIE,4BACE,UACA,WCLV,8BACE,kBAIA,qCACE,WACA,qFAIA,cAEA,kBACA,WAEA,wCACA,4BACA,wBAEA,8BAEA,WAIJ,2BACE,aACA,mBACA,uBAEA,kBACA,MACA,QACA,SACA,OACA,UAEA,YAEA,eAEA,kCACE,mBP/CF,eOkDE,sBAEA,0BAIA,wCACE,WAEA,sBAQN,4BACE,WAIA,0GAEE","file":"all.css"}
|
@@ -1,7 +1,5 @@
|
|
1
|
-
@
|
2
|
-
|
3
|
-
@
|
4
|
-
@
|
5
|
-
@
|
6
|
-
@import "grid/index";
|
7
|
-
@import "sensitive-image/index";
|
1
|
+
@use "button/index" as button;
|
2
|
+
@use "card/index" as card;
|
3
|
+
@use "footer/index" as footer;
|
4
|
+
@use "grid/index" as grid;
|
5
|
+
@use "sensitive-image/index" as sensitive-image;
|
@@ -1,26 +1,25 @@
|
|
1
|
-
|
2
|
-
.
|
3
|
-
padding: 0.25rem 1rem;
|
1
|
+
.tna-button {
|
2
|
+
padding: 0.25rem 1rem;
|
4
3
|
|
5
|
-
|
4
|
+
display: inline-block;
|
6
5
|
|
7
|
-
|
8
|
-
|
6
|
+
color: #fff;
|
7
|
+
font-weight: 700;
|
8
|
+
text-decoration: none;
|
9
9
|
|
10
|
-
|
10
|
+
background-color: #000;
|
11
11
|
|
12
|
-
|
13
|
-
|
14
|
-
}
|
12
|
+
&:hover {
|
13
|
+
background-color: #069;
|
15
14
|
}
|
15
|
+
}
|
16
16
|
|
17
|
-
|
18
|
-
|
17
|
+
.tna-button--secondary {
|
18
|
+
color: #000;
|
19
19
|
|
20
|
-
|
20
|
+
background-color: #ff0;
|
21
21
|
|
22
|
-
|
23
|
-
|
24
|
-
}
|
22
|
+
&:hover {
|
23
|
+
color: #fff;
|
25
24
|
}
|
26
25
|
}
|
@@ -1,37 +1,84 @@
|
|
1
|
-
@
|
2
|
-
.tna-card {
|
3
|
-
display: -ms-flexbox;
|
4
|
-
display: flex;
|
5
|
-
-ms-box-orient: vertical;
|
6
|
-
-ms-flex-direction: column;
|
7
|
-
flex-direction: column;
|
8
|
-
}
|
1
|
+
@use "../../tools/typography" as typographyTools;
|
9
2
|
|
10
|
-
|
11
|
-
|
12
|
-
}
|
3
|
+
.tna-card {
|
4
|
+
}
|
13
5
|
|
14
|
-
|
15
|
-
|
6
|
+
.tna-card__inner {
|
7
|
+
display: -ms-flexbox;
|
8
|
+
display: flex;
|
9
|
+
-ms-box-orient: vertical;
|
10
|
+
-ms-flex-direction: column;
|
11
|
+
flex-direction: column;
|
12
|
+
}
|
16
13
|
|
17
|
-
|
18
|
-
|
14
|
+
.tna-card__heading {
|
15
|
+
order: 2;
|
16
|
+
}
|
19
17
|
|
20
|
-
|
21
|
-
|
18
|
+
.tna-card__supertitle {
|
19
|
+
}
|
22
20
|
|
23
|
-
|
24
|
-
|
21
|
+
.tna-card__title {
|
22
|
+
order: 2;
|
23
|
+
}
|
24
|
+
|
25
|
+
.tna-card__title-link {
|
26
|
+
}
|
27
|
+
|
28
|
+
.tna-card__image-container {
|
29
|
+
order: 1;
|
30
|
+
}
|
31
|
+
|
32
|
+
.tna-card__image {
|
33
|
+
}
|
34
|
+
|
35
|
+
.tna-card__body {
|
36
|
+
margin-top: 2rem;
|
37
|
+
|
38
|
+
order: 3;
|
39
|
+
}
|
40
|
+
|
41
|
+
.tna-card__actions {
|
42
|
+
margin-top: 2rem;
|
43
|
+
|
44
|
+
order: 4;
|
45
|
+
}
|
46
|
+
|
47
|
+
.tna-card__action {
|
48
|
+
}
|
49
|
+
|
50
|
+
.tna-card--featured {
|
51
|
+
padding-left: 50%;
|
52
|
+
|
53
|
+
position: relative;
|
54
|
+
|
55
|
+
background-color: #ff0;
|
56
|
+
|
57
|
+
.tna-card__inner {
|
58
|
+
padding: 2rem;
|
25
59
|
}
|
26
60
|
|
27
|
-
.tna-
|
28
|
-
|
61
|
+
.tna-card__heading {
|
62
|
+
padding-bottom: 2rem;
|
63
|
+
|
64
|
+
border-bottom: 2px #000 solid;
|
29
65
|
}
|
30
66
|
|
31
|
-
.tna-
|
32
|
-
|
67
|
+
.tna-card__image-container {
|
68
|
+
display: flex;
|
69
|
+
align-items: center;
|
70
|
+
justify-content: center;
|
71
|
+
|
72
|
+
position: absolute;
|
73
|
+
top: 0;
|
74
|
+
right: 50%;
|
75
|
+
bottom: 0;
|
76
|
+
left: 0;
|
33
77
|
}
|
34
78
|
|
35
|
-
.tna-
|
79
|
+
.tna-card__image {
|
80
|
+
width: 100%;
|
81
|
+
height: 100%;
|
82
|
+
object-fit: cover;
|
36
83
|
}
|
37
84
|
}
|
@@ -1,16 +1,15 @@
|
|
1
1
|
import Card from "./template.njk";
|
2
|
-
import "
|
3
|
-
import "./_card.scss";
|
2
|
+
import "./_index.scss";
|
4
3
|
import macroOptions from "./macro-options.json";
|
5
4
|
|
6
5
|
const argTypes = {
|
7
|
-
|
8
|
-
title: { control: "text" },
|
6
|
+
heading: { control: "object" },
|
9
7
|
href: { control: "text" },
|
10
8
|
image: { control: "object" },
|
11
9
|
body: { control: "text" },
|
12
10
|
text: { control: "text" },
|
13
11
|
actions: { control: "object" },
|
12
|
+
featured: { control: "boolean" },
|
14
13
|
htmlElement: { control: "text" },
|
15
14
|
classes: { control: "text" },
|
16
15
|
attributes: { control: "text" },
|
@@ -28,26 +27,26 @@ export default {
|
|
28
27
|
};
|
29
28
|
|
30
29
|
const Template = ({
|
31
|
-
|
32
|
-
title,
|
30
|
+
heading,
|
33
31
|
href,
|
34
32
|
image,
|
35
33
|
body,
|
36
34
|
text,
|
37
35
|
actions,
|
36
|
+
featured,
|
38
37
|
htmlElement,
|
39
38
|
classes,
|
40
39
|
attributes,
|
41
40
|
}) => {
|
42
41
|
return Card({
|
43
42
|
params: {
|
44
|
-
|
45
|
-
title,
|
43
|
+
heading,
|
46
44
|
href,
|
47
45
|
image,
|
48
46
|
body,
|
49
47
|
text,
|
50
48
|
actions,
|
49
|
+
featured,
|
51
50
|
htmlElement,
|
52
51
|
classes,
|
53
52
|
attributes,
|
@@ -57,8 +56,39 @@ const Template = ({
|
|
57
56
|
|
58
57
|
export const Standard = Template.bind({});
|
59
58
|
Standard.args = {
|
60
|
-
|
61
|
-
|
59
|
+
heading: {
|
60
|
+
supertitle: "Card supertitle",
|
61
|
+
title: "Card title",
|
62
|
+
level: 3,
|
63
|
+
size: "m",
|
64
|
+
singleSentence: true,
|
65
|
+
},
|
66
|
+
href: "#",
|
67
|
+
image: {
|
68
|
+
src: "https://loremflickr.com/640/360",
|
69
|
+
alt: "A placeholder image",
|
70
|
+
},
|
71
|
+
body: "<p>Card body</p>",
|
72
|
+
actions: [
|
73
|
+
{
|
74
|
+
text: "Card action",
|
75
|
+
href: "#",
|
76
|
+
title: "Go and do the action",
|
77
|
+
},
|
78
|
+
],
|
79
|
+
htmlElement: "article",
|
80
|
+
classes: "tna-card--demo",
|
81
|
+
};
|
82
|
+
|
83
|
+
export const Featured = Template.bind({});
|
84
|
+
Featured.args = {
|
85
|
+
heading: {
|
86
|
+
supertitle: "Card supertitle",
|
87
|
+
title: "Card title",
|
88
|
+
level: 3,
|
89
|
+
size: "m",
|
90
|
+
singleSentence: true,
|
91
|
+
},
|
62
92
|
href: "#",
|
63
93
|
image: {
|
64
94
|
src: "https://loremflickr.com/640/360",
|
@@ -72,6 +102,7 @@ Standard.args = {
|
|
72
102
|
title: "Go and do the action",
|
73
103
|
},
|
74
104
|
],
|
105
|
+
featured: true,
|
75
106
|
htmlElement: "article",
|
76
107
|
classes: "tna-card--demo",
|
77
108
|
};
|
@@ -2,15 +2,117 @@
|
|
2
2
|
"component": "card",
|
3
3
|
"fixtures": [
|
4
4
|
{
|
5
|
-
"name": "
|
5
|
+
"name": "basic card",
|
6
6
|
"options": {
|
7
|
-
"
|
8
|
-
|
7
|
+
"heading": {
|
8
|
+
"title": "Card title",
|
9
|
+
"level": 3
|
10
|
+
},
|
11
|
+
"body": "<p>Card body</p>"
|
12
|
+
},
|
13
|
+
"html": "<div class=\"tna-card \">\n <div class=\"tna-card__inner\"><h3 class=\"tna-card__title tna-heading tna-heading--m\">Card title</h3><div class=\"tna-card__body\"><p>Card body</p></div></div>\n</div>",
|
14
|
+
"hidden": false
|
15
|
+
},
|
16
|
+
{
|
17
|
+
"name": "with supertitle",
|
18
|
+
"options": {
|
19
|
+
"heading": {
|
20
|
+
"supertitle": "Card supertitle",
|
21
|
+
"title": "Card title",
|
22
|
+
"level": 3
|
23
|
+
},
|
24
|
+
"body": "<p>Card body</p>"
|
25
|
+
},
|
26
|
+
"html": "<div class=\"tna-card \">\n <div class=\"tna-card__inner\"><hgroup class=\"tna-card__heading tna-hgroup tna-hgroup--m\">\n <p class=\"tna-card__supertitle tna-hgroup__supertitle\">Card supertitle</p>\n <h3 class=\"tna-card__title tna-hgroup__title\">Card title</h3>\n </hgroup><div class=\"tna-card__body\"><p>Card body</p></div></div>\n</div>",
|
27
|
+
"hidden": false
|
28
|
+
},
|
29
|
+
{
|
30
|
+
"name": "with single sentence supertitle",
|
31
|
+
"options": {
|
32
|
+
"heading": {
|
33
|
+
"supertitle": "Card supertitle",
|
34
|
+
"title": "Card title",
|
35
|
+
"level": 3,
|
36
|
+
"singleSentence": true
|
37
|
+
},
|
38
|
+
"body": "<p>Card body</p>"
|
39
|
+
},
|
40
|
+
"html": "<div class=\"tna-card \">\n <div class=\"tna-card__inner\"><hgroup class=\"tna-card__heading tna-hgroup tna-hgroup--m\">\n <h3 class=\"tna-card__title tna-hgroup__title\">\n <span class=\"tna-card__supertitle tna-hgroup__supertitle\">Card supertitle</span>Card title</h3>\n </hgroup><div class=\"tna-card__body\"><p>Card body</p></div></div>\n</div>",
|
41
|
+
"hidden": false
|
42
|
+
},
|
43
|
+
{
|
44
|
+
"name": "heading size",
|
45
|
+
"options": {
|
46
|
+
"heading": {
|
47
|
+
"title": "Card title",
|
48
|
+
"level": 3,
|
49
|
+
"size": "m"
|
50
|
+
},
|
51
|
+
"body": "<p>Card body</p>"
|
52
|
+
},
|
53
|
+
"html": "<div class=\"tna-card \">\n <div class=\"tna-card__inner\"><h3 class=\"tna-card__title tna-heading tna-heading--m\">Card title</h3><div class=\"tna-card__body\"><p>Card body</p></div></div>\n</div>",
|
54
|
+
"hidden": false
|
55
|
+
},
|
56
|
+
{
|
57
|
+
"name": "heading level",
|
58
|
+
"options": {
|
59
|
+
"heading": {
|
60
|
+
"title": "Card title",
|
61
|
+
"level": 1
|
62
|
+
},
|
63
|
+
"body": "<p>Card body</p>"
|
64
|
+
},
|
65
|
+
"html": "<div class=\"tna-card \">\n <div class=\"tna-card__inner\"><h1 class=\"tna-card__title tna-heading tna-heading--m\">Card title</h1><div class=\"tna-card__body\"><p>Card body</p></div></div>\n</div>",
|
66
|
+
"hidden": false
|
67
|
+
},
|
68
|
+
{
|
69
|
+
"name": "with link",
|
70
|
+
"options": {
|
71
|
+
"heading": {
|
72
|
+
"title": "Card title",
|
73
|
+
"level": 3
|
74
|
+
},
|
9
75
|
"href": "#",
|
76
|
+
"body": "<p>Card body</p>"
|
77
|
+
},
|
78
|
+
"html": "<div class=\"tna-card \">\n <div class=\"tna-card__inner\"><h3 class=\"tna-card__title tna-heading tna-heading--m\"><a href=\"#\" class=\"tna-card__title-link\">Card title</a></h3><div class=\"tna-card__body\"><p>Card body</p></div></div>\n</div>",
|
79
|
+
"hidden": false
|
80
|
+
},
|
81
|
+
{
|
82
|
+
"name": "with text",
|
83
|
+
"options": {
|
84
|
+
"heading": {
|
85
|
+
"title": "Card title",
|
86
|
+
"level": 3
|
87
|
+
},
|
88
|
+
"text": "Card body"
|
89
|
+
},
|
90
|
+
"html": "<div class=\"tna-card \">\n <div class=\"tna-card__inner\"><h3 class=\"tna-card__title tna-heading tna-heading--m\">Card title</h3><div class=\"tna-card__body\"><p>Card body</p></div></div>\n</div>",
|
91
|
+
"hidden": false
|
92
|
+
},
|
93
|
+
{
|
94
|
+
"name": "with image",
|
95
|
+
"options": {
|
96
|
+
"heading": {
|
97
|
+
"title": "Card title",
|
98
|
+
"level": 3
|
99
|
+
},
|
10
100
|
"image": {
|
11
101
|
"src": "https://loremflickr.com/640/360",
|
12
102
|
"alt": "A placeholder image"
|
13
103
|
},
|
104
|
+
"body": "<p>Card body</p>"
|
105
|
+
},
|
106
|
+
"html": "<div class=\"tna-card \">\n <div class=\"tna-card__inner\"><h3 class=\"tna-card__title tna-heading tna-heading--m\">Card title</h3><div class=\"tna-card__image-container\">\n <img src=\"https://loremflickr.com/640/360\" alt=\"A placeholder image\" class=\"tna-card__image\" />\n </div><div class=\"tna-card__body\"><p>Card body</p></div></div>\n</div>",
|
107
|
+
"hidden": false
|
108
|
+
},
|
109
|
+
{
|
110
|
+
"name": "with actions",
|
111
|
+
"options": {
|
112
|
+
"heading": {
|
113
|
+
"title": "Card title",
|
114
|
+
"level": 3
|
115
|
+
},
|
14
116
|
"body": "<p>Card body</p>",
|
15
117
|
"actions": [
|
16
118
|
{
|
@@ -18,11 +120,37 @@
|
|
18
120
|
"href": "#",
|
19
121
|
"title": "Go and do the action"
|
20
122
|
}
|
21
|
-
]
|
22
|
-
|
23
|
-
|
123
|
+
]
|
124
|
+
},
|
125
|
+
"html": "<div class=\"tna-card \">\n <div class=\"tna-card__inner\"><h3 class=\"tna-card__title tna-heading tna-heading--m\">Card title</h3><div class=\"tna-card__body\"><p>Card body</p></div><div class=\"tna-card__actions\"><a href=\"#\" class=\"tna-card__action tna-button\"title=\"Go and do the action\">Card action</a></div></div>\n</div>",
|
126
|
+
"hidden": false
|
127
|
+
},
|
128
|
+
{
|
129
|
+
"name": "with classes",
|
130
|
+
"options": {
|
131
|
+
"heading": {
|
132
|
+
"title": "Card title",
|
133
|
+
"level": 3
|
134
|
+
},
|
135
|
+
"body": "<p>Card body</p>",
|
136
|
+
"classes": "card__test-class"
|
137
|
+
},
|
138
|
+
"html": "<div class=\"tna-card card__test-class\">\n <div class=\"tna-card__inner\"><h3 class=\"tna-card__title tna-heading tna-heading--m\">Card title</h3><div class=\"tna-card__body\"><p>Card body</p></div></div>\n</div>",
|
139
|
+
"hidden": false
|
140
|
+
},
|
141
|
+
{
|
142
|
+
"name": "with attributes",
|
143
|
+
"options": {
|
144
|
+
"heading": {
|
145
|
+
"title": "Card title",
|
146
|
+
"level": 3
|
147
|
+
},
|
148
|
+
"body": "<p>Card body</p>",
|
149
|
+
"attributes": {
|
150
|
+
"data-testattribute": "foobar"
|
151
|
+
}
|
24
152
|
},
|
25
|
-
"html": "<
|
153
|
+
"html": "<div class=\"tna-card \" data-testattribute=\"foobar\">\n <div class=\"tna-card__inner\"><h3 class=\"tna-card__title tna-heading tna-heading--m\">Card title</h3><div class=\"tna-card__body\"><p>Card body</p></div></div>\n</div>",
|
26
154
|
"hidden": false
|
27
155
|
}
|
28
156
|
]
|
@@ -1,15 +1,41 @@
|
|
1
1
|
[
|
2
2
|
{
|
3
|
-
"name": "
|
4
|
-
"type": "
|
5
|
-
"required": false,
|
6
|
-
"description": ""
|
7
|
-
},
|
8
|
-
{
|
9
|
-
"name": "title",
|
10
|
-
"type": "string",
|
3
|
+
"name": "heading",
|
4
|
+
"type": "object",
|
11
5
|
"required": true,
|
12
|
-
"description": ""
|
6
|
+
"description": "",
|
7
|
+
"params": [
|
8
|
+
{
|
9
|
+
"name": "supertitle",
|
10
|
+
"type": "string",
|
11
|
+
"required": false,
|
12
|
+
"description": ""
|
13
|
+
},
|
14
|
+
{
|
15
|
+
"name": "title",
|
16
|
+
"type": "string",
|
17
|
+
"required": true,
|
18
|
+
"description": ""
|
19
|
+
},
|
20
|
+
{
|
21
|
+
"name": "level",
|
22
|
+
"type": "number",
|
23
|
+
"required": true,
|
24
|
+
"description": ""
|
25
|
+
},
|
26
|
+
{
|
27
|
+
"name": "size",
|
28
|
+
"type": "text",
|
29
|
+
"required": false,
|
30
|
+
"description": ""
|
31
|
+
},
|
32
|
+
{
|
33
|
+
"name": "singleSentence",
|
34
|
+
"type": "boolean",
|
35
|
+
"required": false,
|
36
|
+
"description": ""
|
37
|
+
}
|
38
|
+
]
|
13
39
|
},
|
14
40
|
{
|
15
41
|
"name": "href",
|
@@ -52,7 +78,7 @@
|
|
52
78
|
{
|
53
79
|
"name": "actions",
|
54
80
|
"type": "array",
|
55
|
-
"required":
|
81
|
+
"required": false,
|
56
82
|
"description": "",
|
57
83
|
"params": [
|
58
84
|
{
|
@@ -75,6 +101,12 @@
|
|
75
101
|
}
|
76
102
|
]
|
77
103
|
},
|
104
|
+
{
|
105
|
+
"name": "featured",
|
106
|
+
"type": "boolean",
|
107
|
+
"required": false,
|
108
|
+
"description": ""
|
109
|
+
},
|
78
110
|
{
|
79
111
|
"name": "htmlElement",
|
80
112
|
"type": "string",
|