@nationalarchives/frontend 0.1.15-prerelease → 0.1.17-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/LICENCE +21 -0
- package/nationalarchives/all.css +13 -1
- package/nationalarchives/all.css.map +1 -1
- package/nationalarchives/all.js +1 -1
- package/nationalarchives/all.js.map +1 -1
- package/nationalarchives/all.scss +2 -3
- package/nationalarchives/assets/fonts/fa-brands-400.ttf +0 -0
- package/nationalarchives/assets/fonts/fa-brands-400.woff2 +0 -0
- package/nationalarchives/assets/fonts/fa-regular-400.ttf +0 -0
- package/nationalarchives/assets/fonts/fa-regular-400.woff2 +0 -0
- package/nationalarchives/assets/fonts/fa-solid-900.ttf +0 -0
- package/nationalarchives/assets/fonts/fa-solid-900.woff2 +0 -0
- package/nationalarchives/components/_index.scss +1 -0
- package/nationalarchives/components/breadcrumbs/_index.scss +13 -41
- package/nationalarchives/components/breadcrumbs/breadcrumbs.js +1 -1
- package/nationalarchives/components/breadcrumbs/breadcrumbs.js.map +1 -1
- package/nationalarchives/components/breadcrumbs/breadcrumbs.mjs +8 -4
- package/nationalarchives/components/breadcrumbs/breadcrumbs.stories.js +9 -30
- package/nationalarchives/components/breadcrumbs/fixtures.json +23 -1
- package/nationalarchives/components/breadcrumbs/macro-options.json +6 -0
- package/nationalarchives/components/breadcrumbs/template.njk +17 -12
- package/nationalarchives/components/button/_button-group.scss +18 -0
- package/nationalarchives/components/button/_index.scss +25 -9
- package/nationalarchives/components/button/button.stories.js +64 -8
- package/nationalarchives/components/button/fixtures.json +3 -3
- package/nationalarchives/components/button/macro-options.json +13 -1
- package/nationalarchives/components/button/template.njk +7 -2
- package/nationalarchives/components/card/_index.scss +67 -51
- package/nationalarchives/components/card/card.stories.js +123 -10
- package/nationalarchives/components/card/fixtures.json +62 -10
- package/nationalarchives/components/card/macro-options.json +9 -3
- package/nationalarchives/components/card/template.njk +12 -8
- package/nationalarchives/components/filters/_index.scss +19 -14
- package/nationalarchives/components/filters/filters.stories.js +3 -4
- package/nationalarchives/components/footer/_index.scss +195 -72
- package/nationalarchives/components/footer/fixtures.json +1 -1
- package/nationalarchives/components/footer/footer.stories.js +82 -74
- package/nationalarchives/components/footer/macro-options.json +34 -8
- package/nationalarchives/components/footer/template.njk +110 -53
- package/nationalarchives/components/grid/_index.scss +2 -2
- package/nationalarchives/components/grid/grid.stories.js +2 -3
- package/nationalarchives/components/header/_index.scss +57 -23
- package/nationalarchives/components/header/header.stories.js +2 -3
- package/nationalarchives/components/hero/_index.scss +4 -8
- package/nationalarchives/components/hero/hero.stories.js +2 -3
- package/nationalarchives/components/index-grid/_index.scss +28 -7
- package/nationalarchives/components/index-grid/index-grid.stories.js +27 -4
- package/nationalarchives/components/index-grid/macro-options.json +12 -0
- package/nationalarchives/components/index-grid/template.njk +9 -11
- package/nationalarchives/components/message/_index.scss +12 -6
- package/nationalarchives/components/message/phase-banner.stories.js +2 -3
- package/nationalarchives/components/phase-banner/phase-banner.stories.js +2 -3
- package/nationalarchives/components/picture/_index.scss +5 -5
- package/nationalarchives/components/picture/picture.js +1 -1
- package/nationalarchives/components/picture/picture.js.map +1 -1
- package/nationalarchives/components/picture/picture.mjs +2 -0
- package/nationalarchives/components/picture/picture.stories.js +2 -3
- package/nationalarchives/components/profile/profile.stories.js +2 -3
- package/nationalarchives/components/sensitive-image/sensitive-image.stories.js +3 -4
- package/nationalarchives/components/skip-link/_index.scss +63 -0
- package/nationalarchives/components/skip-link/fixtures.json +11 -0
- package/nationalarchives/{patterns/featured-collection → components/skip-link}/macro-options.json +10 -4
- package/nationalarchives/components/skip-link/macro.njk +3 -0
- package/nationalarchives/{patterns/featured-collection/featured-collection.stories.js → components/skip-link/skip-link.stories.js} +7 -10
- package/nationalarchives/components/skip-link/template.njk +4 -0
- package/nationalarchives/components/tabs/_index.scss +7 -5
- package/nationalarchives/components/tabs/tabs.stories.js +8 -9
- package/nationalarchives/lib/font-awesome/_animated.scss +276 -0
- package/nationalarchives/lib/font-awesome/_bordered-pulled.scss +20 -0
- package/nationalarchives/lib/font-awesome/_core.scss +42 -0
- package/nationalarchives/lib/font-awesome/_fixed-width.scss +7 -0
- package/nationalarchives/lib/font-awesome/_functions.scss +57 -0
- package/nationalarchives/lib/font-awesome/_icons.scss +11 -0
- package/nationalarchives/lib/font-awesome/_list.scss +20 -0
- package/nationalarchives/lib/font-awesome/_mixins.scss +74 -0
- package/nationalarchives/lib/font-awesome/_rotated-flipped.scss +31 -0
- package/nationalarchives/lib/font-awesome/_screen-reader.scss +14 -0
- package/nationalarchives/lib/font-awesome/_shims.scss +2653 -0
- package/nationalarchives/lib/font-awesome/_sizing.scss +16 -0
- package/nationalarchives/lib/font-awesome/_stacked.scss +32 -0
- package/nationalarchives/lib/font-awesome/_variables.scss +4976 -0
- package/nationalarchives/lib/font-awesome/brands.scss +34 -0
- package/nationalarchives/lib/font-awesome/fontawesome.scss +21 -0
- package/nationalarchives/lib/font-awesome/regular.scss +28 -0
- package/nationalarchives/lib/font-awesome/solid.scss +28 -0
- package/nationalarchives/lib/font-awesome/v4-shims.scss +11 -0
- package/nationalarchives/stories/utilities/colour-schemes/colour-schemes.mdx +22 -0
- package/nationalarchives/stories/utilities/colour-schemes/colour-schemes.stories.js +494 -91
- package/nationalarchives/stories/utilities/overrides/overrides.mdx +37 -57
- package/nationalarchives/stories/utilities/overrides/overrides.stories.js +8 -14
- package/nationalarchives/stories/utilities/typography/heading-groups.stories.js +1 -1
- package/nationalarchives/stories/utilities/typography/typography.mdx +2 -0
- package/nationalarchives/stories/utilities/typography/typography.stories.js +20 -1
- package/nationalarchives/templates/layouts/_generic.njk +10 -8
- package/nationalarchives/tools/_colour.scss +163 -49
- package/nationalarchives/tools/_index.scss +0 -1
- package/nationalarchives/tools/_typography.scss +13 -0
- package/nationalarchives/utilities/_debug.scss +41 -1
- package/nationalarchives/utilities/_font-awesome.scss +5 -0
- package/nationalarchives/utilities/_global.scss +75 -26
- package/nationalarchives/utilities/_index.scss +1 -0
- package/nationalarchives/utilities/_overrides.scss +54 -9
- package/nationalarchives/utilities/_typography.scss +203 -65
- package/nationalarchives/variables/_assets.scss +1 -1
- package/nationalarchives/variables/_colour.scss +93 -93
- package/nationalarchives/variables/_grid.scss +1 -1
- package/nationalarchives/variables/_media.scss +23 -23
- package/nationalarchives/variables/_spacing.scss +12 -2
- package/nationalarchives/variables/_typography.scss +4 -1
- package/package.json +14 -14
- package/nationalarchives/patterns/_index.scss +0 -1
- package/nationalarchives/patterns/featured-collection/_index.scss +0 -13
- package/nationalarchives/patterns/featured-collection/macro.njk +0 -3
- package/nationalarchives/patterns/featured-collection/template.njk +0 -96
- package/nationalarchives/tools/_assets.scss +0 -5
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"components/picture/picture.js","mappings":"CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,IACQ,mBAAXG,QAAyBA,OAAOC,IAC9CD,OAAO,cAAe,GAAIH,GACA,iBAAZC,QACdA,QAAqB,YAAID,KAEzBD,EAAkB,YAAIA,EAAkB,aAAK,CAAC,EAAGA,EAAkB,YAAE,8BAAgCC,IACtG,CATD,CASGK,MAAM,I,yDCDT,QARe,WAAH,OACT,CAAC,MAAQ,KAAO,KAAO,KAAO,MAAMC,QAAQ,UAAU,SAACC,GAAC,OAErDA,EACCC,OAAOC,gBAAgB,IAAIC,WAAW,IAAI,GAAM,IAAOH,EAAI,GAC5DI,SAAS,GAAG,GACf,C,GCLCC,EAA2B,CAAC,EAGhC,SAASC,EAAoBC,GAE5B,IAAIC,EAAeH,EAAyBE,GAC5C,QAAqBE,IAAjBD,EACH,OAAOA,EAAad,QAGrB,IAAIC,EAASU,EAAyBE,GAAY,CAGjDb,QAAS,CAAC,GAOX,OAHAgB,EAAoBH,GAAUZ,EAAQA,EAAOD,QAASY,GAG/CX,EAAOD,OACf,CCrBAY,EAAoBK,EAAI,CAACjB,EAASkB,KACjC,IAAI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AAYlB,KAAKS,mBAEpCT,KAAKG,YAAYW,aAAa,KAAMR,GACpCN,KAAKG,YAAYW,aAAa,UAAU,EApBxC,CAsBF,GAAC,CAAAhC,IAAA,yBAAAc,MAED,WACE,IAAMuB,EACJ,yCACFnB,KAAKI,kBAAoBJ,KAAKI,iBAC1BJ,KAAKI,kBACPJ,KAAKS,kBAAkBG,UAAUC,IAAIM,GACrCnB,KAAKS,kBAAkBK,aAAa,iBAAiB,GACrDd,KAAKS,kBAAkBM,UAAY,mBACnCf,KAAKG,YAAYiB,gBAAgB,YAIjCpB,KAAKS,kBAAkBG,UAAUS,OAAOF,GACxCnB,KAAKS,kBAAkBK,aAAa,iBAAiB,GACrDd,KAAKS,kBAAkBM,UAAY,kBACnCf,KAAKG,YAAYW,aAAa,UAAU,GAG5C,M,oEAACjB,CAAA,CAvDiB,E","sources":["webpack://TNAFrontend/webpack/universalModuleDefinition","webpack://TNAFrontend/./src/nationalarchives/lib/uuid.mjs","webpack://TNAFrontend/webpack/bootstrap","webpack://TNAFrontend/webpack/runtime/define property getters","webpack://TNAFrontend/webpack/runtime/hasOwnProperty shorthand","webpack://TNAFrontend/webpack/runtime/make namespace object","webpack://TNAFrontend/./src/nationalarchives/components/picture/picture.mjs"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"TNAFrontend\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"TNAFrontend\"] = factory();\n\telse\n\t\troot[\"TNAFrontend\"] = root[\"TNAFrontend\"] || {}, root[\"TNAFrontend\"][\"components/picture/picture\"] = factory();\n})(self, () => {\nreturn ","const uuidv4 = () =>\n ([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, (c) =>\n (\n c ^\n (crypto.getRandomValues(new Uint8Array(1))[0] & (15 >> (c / 4)))\n ).toString(16),\n );\n\nexport default uuidv4;\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","import uuidv4 from \"../../lib/uuid.mjs\";\n\nexport class Picture {\n constructor($module) {\n this.$module = $module;\n this.$imageWrapper =\n $module && $module.querySelector(\".tna-picture__image-wrapper\");\n this.$transcript =\n $module && $module.querySelector(\".tna-picture__transcript\");\n this.transcriptOpened = false;\n }\n\n init() {\n if (!this.$module || !this.$imageWrapper || !this.$transcript) {\n return;\n }\n\n const uniqueId = `tna-picture-${uuidv4()}`;\n\n this.$transcriptToggle = document.createElement(\"button\");\n this.$transcriptToggle.classList.add(\n \"tna-picture__toggle-transcript\",\n \"tna-button\",\n \"tna-button--accent\",\n \"tna-button--solid-hover\",\n );\n this.$transcriptToggle.setAttribute(\"aria-controls\", uniqueId);\n this.$transcriptToggle.setAttribute(\"aria-expanded\", false);\n this.$transcriptToggle.innerText = \"Open transcript\";\n this.$transcriptToggle.addEventListener(\"click\", () =>\n this.handleToggleTranscript(),\n );\n this.$imageWrapper.appendChild(this.$transcriptToggle);\n\n this.$transcript.setAttribute(\"id\", uniqueId);\n this.$transcript.setAttribute(\"hidden\", true);\n // this.$transcript.setAttribute(\"tabindex\", \"-1\");\n }\n\n handleToggleTranscript() {\n const transcriptToggleOpenedClass =\n \"tna-picture__toggle-transcript--opened\";\n this.transcriptOpened = !this.transcriptOpened;\n if (this.transcriptOpened) {\n this.$transcriptToggle.classList.add(transcriptToggleOpenedClass);\n this.$transcriptToggle.setAttribute(\"aria-expanded\", true);\n this.$transcriptToggle.innerText = \"Close transcript\";\n this.$transcript.removeAttribute(\"hidden\");\n // this.$transcript.setAttribute(\"tabindex\", \"0\");\n // this.$transcript.focus();\n } else {\n this.$transcriptToggle.classList.remove(transcriptToggleOpenedClass);\n this.$transcriptToggle.setAttribute(\"aria-expanded\", false);\n this.$transcriptToggle.innerText = \"Open transcript\";\n this.$transcript.setAttribute(\"hidden\", true);\n // this.$transcript.setAttribute(\"tabindex\", \"-1\");\n }\n }\n}\n"],"names":["root","factory","exports","module","define","amd","self","replace","c","crypto","getRandomValues","Uint8Array","toString","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__","d","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","r","Symbol","toStringTag","value","Picture","$module","_classCallCheck","this","$imageWrapper","querySelector","$transcript","transcriptOpened","_this","uniqueId","concat","uuidv4","$transcriptToggle","document","createElement","classList","add","setAttribute","innerText","addEventListener","handleToggleTranscript","appendChild","transcriptToggleOpenedClass","removeAttribute","remove"],"sourceRoot":""}
|
@@ -21,6 +21,8 @@ export class Picture {
|
|
21
21
|
this.$transcriptToggle.classList.add(
|
22
22
|
"tna-picture__toggle-transcript",
|
23
23
|
"tna-button",
|
24
|
+
"tna-button--accent",
|
25
|
+
"tna-button--solid-hover",
|
24
26
|
);
|
25
27
|
this.$transcriptToggle.setAttribute("aria-controls", uniqueId);
|
26
28
|
this.$transcriptToggle.setAttribute("aria-expanded", false);
|
@@ -34,8 +34,8 @@ const Template = ({
|
|
34
34
|
translation,
|
35
35
|
classes,
|
36
36
|
attributes,
|
37
|
-
}) =>
|
38
|
-
|
37
|
+
}) =>
|
38
|
+
Picture({
|
39
39
|
params: {
|
40
40
|
src,
|
41
41
|
width,
|
@@ -48,7 +48,6 @@ const Template = ({
|
|
48
48
|
attributes,
|
49
49
|
},
|
50
50
|
});
|
51
|
-
};
|
52
51
|
|
53
52
|
export const Standard = Template.bind({});
|
54
53
|
Standard.args = {
|
@@ -17,14 +17,13 @@ export default {
|
|
17
17
|
argTypes,
|
18
18
|
};
|
19
19
|
|
20
|
-
const Template = ({ classes, attributes }) =>
|
21
|
-
|
20
|
+
const Template = ({ classes, attributes }) =>
|
21
|
+
Profile({
|
22
22
|
params: {
|
23
23
|
classes,
|
24
24
|
attributes,
|
25
25
|
},
|
26
26
|
});
|
27
|
-
};
|
28
27
|
|
29
28
|
export const Standard = Template.bind({});
|
30
29
|
Standard.args = {
|
@@ -19,12 +19,12 @@ Object.keys(argTypes).forEach((argType) => {
|
|
19
19
|
});
|
20
20
|
|
21
21
|
export default {
|
22
|
-
title: "Components/
|
22
|
+
title: "Components/Sensitive image",
|
23
23
|
argTypes,
|
24
24
|
};
|
25
25
|
|
26
|
-
const Template = ({ image, warning, action, classes, attributes }) =>
|
27
|
-
|
26
|
+
const Template = ({ image, warning, action, classes, attributes }) =>
|
27
|
+
SensitiveImage({
|
28
28
|
params: {
|
29
29
|
image,
|
30
30
|
warning,
|
@@ -33,7 +33,6 @@ const Template = ({ image, warning, action, classes, attributes }) => {
|
|
33
33
|
attributes,
|
34
34
|
},
|
35
35
|
});
|
36
|
-
};
|
37
36
|
|
38
37
|
export const Standard = Template.bind({});
|
39
38
|
Standard.args = {
|
@@ -0,0 +1,63 @@
|
|
1
|
+
@use "../../tools/colour";
|
2
|
+
|
3
|
+
.tna-skip-link {
|
4
|
+
width: 1px !important;
|
5
|
+
height: 1px !important;
|
6
|
+
margin: 0 !important;
|
7
|
+
padding: 1rem !important;
|
8
|
+
|
9
|
+
display: block !important;
|
10
|
+
|
11
|
+
position: absolute !important;
|
12
|
+
|
13
|
+
overflow: hidden !important;
|
14
|
+
|
15
|
+
white-space: nowrap !important;
|
16
|
+
|
17
|
+
clip: rect(0 0 0 0) !important;
|
18
|
+
-webkit-clip-path: inset(50%) !important;
|
19
|
+
clip-path: inset(50%) !important;
|
20
|
+
|
21
|
+
&,
|
22
|
+
&:link,
|
23
|
+
&:visited {
|
24
|
+
@include colour.colour-font("button-primary-text", $important: true);
|
25
|
+
}
|
26
|
+
|
27
|
+
&:active,
|
28
|
+
&:focus {
|
29
|
+
width: auto !important;
|
30
|
+
height: auto !important;
|
31
|
+
margin: inherit !important;
|
32
|
+
|
33
|
+
position: static !important;
|
34
|
+
|
35
|
+
overflow: visible !important;
|
36
|
+
|
37
|
+
white-space: inherit !important;
|
38
|
+
|
39
|
+
clip: auto !important;
|
40
|
+
-webkit-clip-path: none !important;
|
41
|
+
clip-path: none !important;
|
42
|
+
}
|
43
|
+
|
44
|
+
&:focus {
|
45
|
+
@include colour.colour-background(
|
46
|
+
"button-primary-background",
|
47
|
+
$important: true
|
48
|
+
);
|
49
|
+
|
50
|
+
@include colour.colour-border("focus-outline", 0.3125rem, $important: true);
|
51
|
+
|
52
|
+
outline: none !important;
|
53
|
+
}
|
54
|
+
|
55
|
+
&:hover {
|
56
|
+
@include colour.colour-font("button-primary-hover-text", $important: true);
|
57
|
+
|
58
|
+
@include colour.colour-background(
|
59
|
+
"button-primary-hover-background",
|
60
|
+
$important: true
|
61
|
+
);
|
62
|
+
}
|
63
|
+
}
|
package/nationalarchives/{patterns/featured-collection → components/skip-link}/macro-options.json
RENAMED
@@ -1,20 +1,26 @@
|
|
1
1
|
[
|
2
2
|
{
|
3
|
-
"name": "
|
3
|
+
"name": "text",
|
4
4
|
"type": "string",
|
5
|
-
"required":
|
5
|
+
"required": false,
|
6
|
+
"description": ""
|
7
|
+
},
|
8
|
+
{
|
9
|
+
"name": "href",
|
10
|
+
"type": "string",
|
11
|
+
"required": false,
|
6
12
|
"description": ""
|
7
13
|
},
|
8
14
|
{
|
9
15
|
"name": "classes",
|
10
16
|
"type": "string",
|
11
17
|
"required": false,
|
12
|
-
"description": "Classes to add to the
|
18
|
+
"description": "Classes to add to the skip link."
|
13
19
|
},
|
14
20
|
{
|
15
21
|
"name": "attributes",
|
16
22
|
"type": "object",
|
17
23
|
"required": false,
|
18
|
-
"description": "HTML attributes (for example data attributes) to add to the
|
24
|
+
"description": "HTML attributes (for example data attributes) to add to the skip link."
|
19
25
|
}
|
20
26
|
]
|
@@ -1,8 +1,7 @@
|
|
1
|
-
import
|
1
|
+
import SkipLink from "./template.njk";
|
2
2
|
import macroOptions from "./macro-options.json";
|
3
3
|
|
4
4
|
const argTypes = {
|
5
|
-
heading: { control: "text" },
|
6
5
|
classes: { control: "text" },
|
7
6
|
attributes: { control: "object" },
|
8
7
|
};
|
@@ -14,22 +13,20 @@ Object.keys(argTypes).forEach((argType) => {
|
|
14
13
|
});
|
15
14
|
|
16
15
|
export default {
|
17
|
-
title: "
|
16
|
+
title: "Components/Skip link",
|
18
17
|
argTypes,
|
19
18
|
};
|
20
19
|
|
21
|
-
const Template = ({
|
22
|
-
|
20
|
+
const Template = ({ classes, attributes }) =>
|
21
|
+
`<p>To view the skip link component tab to this example, or click inside this example and press tab.</p>
|
22
|
+
${SkipLink({
|
23
23
|
params: {
|
24
|
-
heading,
|
25
24
|
classes,
|
26
25
|
attributes,
|
27
26
|
},
|
28
|
-
})
|
29
|
-
};
|
27
|
+
})}`;
|
30
28
|
|
31
29
|
export const Standard = Template.bind({});
|
32
30
|
Standard.args = {
|
33
|
-
|
34
|
-
classes: "tna-featured-collection--demo",
|
31
|
+
classes: "tna-skip-link--demo",
|
35
32
|
};
|
@@ -0,0 +1,4 @@
|
|
1
|
+
{%- set containerClasses = [params.classes] if params.classes else [] -%}
|
2
|
+
<a href="#{{ params.href if params.href else 'main-content' }}" class="tna-skip-link {{ containerClasses | join(' ') }}" {%- for attribute, value in params.attributes %} {{ attribute }}="{{ value }}"{% endfor %}>
|
3
|
+
{{ params.text if params.text else 'Skip to main content' }}
|
4
|
+
</a>
|
@@ -1,4 +1,5 @@
|
|
1
1
|
@use "../../tools/colour";
|
2
|
+
@use "../../tools/typography";
|
2
3
|
|
3
4
|
.tna-tabs {
|
4
5
|
margin-bottom: 2rem;
|
@@ -34,9 +35,11 @@
|
|
34
35
|
position: relative;
|
35
36
|
|
36
37
|
@include colour.colour-font("font-dark");
|
37
|
-
font-size: inherit;
|
38
|
-
font-
|
39
|
-
font-
|
38
|
+
// font-size: inherit;
|
39
|
+
@include typography.relative-font-size(20);
|
40
|
+
// font-family: inherit;
|
41
|
+
@include typography.heading-font;
|
42
|
+
// font-weight: 700;
|
40
43
|
text-decoration: none;
|
41
44
|
line-height: 1.5;
|
42
45
|
text-align: center;
|
@@ -135,8 +138,7 @@
|
|
135
138
|
|
136
139
|
overflow: hidden;
|
137
140
|
|
138
|
-
border
|
139
|
-
@include colour.colour-border("keyline-dark");
|
141
|
+
@include colour.colour-border("keyline-dark", 1px);
|
140
142
|
}
|
141
143
|
}
|
142
144
|
}
|
@@ -22,8 +22,8 @@ export default {
|
|
22
22
|
argTypes,
|
23
23
|
};
|
24
24
|
|
25
|
-
const Template = ({ title, items, sticky, classes, attributes }) =>
|
26
|
-
|
25
|
+
const Template = ({ title, items, sticky, classes, attributes }) =>
|
26
|
+
Tabs({
|
27
27
|
params: {
|
28
28
|
title,
|
29
29
|
items,
|
@@ -32,7 +32,6 @@ const Template = ({ title, items, sticky, classes, attributes }) => {
|
|
32
32
|
attributes,
|
33
33
|
},
|
34
34
|
});
|
35
|
-
};
|
36
35
|
|
37
36
|
export const Standard = Template.bind({});
|
38
37
|
Standard.args = {
|
@@ -41,17 +40,17 @@ Standard.args = {
|
|
41
40
|
{
|
42
41
|
id: "unique-id-a",
|
43
42
|
title: "Alpha section",
|
44
|
-
body:
|
43
|
+
body: '<h2 class="tna-heading">Alpha title</h2><p>Lorem ipsum</p>',
|
45
44
|
},
|
46
45
|
{
|
47
46
|
id: "unique-id-b",
|
48
47
|
title: "Beta section",
|
49
|
-
body:
|
48
|
+
body: '<h2 class="tna-heading">Beta title</h2><p>Lorem ipsum</p>',
|
50
49
|
},
|
51
50
|
{
|
52
51
|
id: "unique-id-c",
|
53
52
|
title: "Gamma section",
|
54
|
-
body:
|
53
|
+
body: '<h2 class="tna-heading">Gamma title</h2><p>Lorem ipsum</p>',
|
55
54
|
},
|
56
55
|
],
|
57
56
|
classes: "tna-tabs--demo",
|
@@ -64,17 +63,17 @@ Test.args = {
|
|
64
63
|
{
|
65
64
|
id: "unique-id-a",
|
66
65
|
title: "Alpha section",
|
67
|
-
body:
|
66
|
+
body: '<h2 class="tna-heading">Alpha title</h2><p>Lorem ipsum</p>',
|
68
67
|
},
|
69
68
|
{
|
70
69
|
id: "unique-id-b",
|
71
70
|
title: "Beta section",
|
72
|
-
body:
|
71
|
+
body: '<h2 class="tna-heading">Beta title</h2><p>Lorem ipsum</p>',
|
73
72
|
},
|
74
73
|
{
|
75
74
|
id: "unique-id-c",
|
76
75
|
title: "Gamma section",
|
77
|
-
body:
|
76
|
+
body: '<h2 class="tna-heading">Gamma title</h2><p>Lorem ipsum</p>',
|
78
77
|
},
|
79
78
|
],
|
80
79
|
classes: "tna-tabs--demo",
|
@@ -0,0 +1,276 @@
|
|
1
|
+
// animating icons
|
2
|
+
// --------------------------
|
3
|
+
|
4
|
+
.#{$fa-css-prefix}-beat {
|
5
|
+
animation-name: #{$fa-css-prefix}-beat;
|
6
|
+
animation-delay: var(--#{$fa-css-prefix}-animation-delay, 0s);
|
7
|
+
animation-direction: var(--#{$fa-css-prefix}-animation-direction, normal);
|
8
|
+
animation-duration: var(--#{$fa-css-prefix}-animation-duration, 1s);
|
9
|
+
animation-iteration-count: var(
|
10
|
+
--#{$fa-css-prefix}-animation-iteration-count,
|
11
|
+
infinite
|
12
|
+
);
|
13
|
+
animation-timing-function: var(
|
14
|
+
--#{$fa-css-prefix}-animation-timing,
|
15
|
+
ease-in-out
|
16
|
+
);
|
17
|
+
}
|
18
|
+
|
19
|
+
.#{$fa-css-prefix}-bounce {
|
20
|
+
animation-name: #{$fa-css-prefix}-bounce;
|
21
|
+
animation-delay: var(--#{$fa-css-prefix}-animation-delay, 0s);
|
22
|
+
animation-direction: var(--#{$fa-css-prefix}-animation-direction, normal);
|
23
|
+
animation-duration: var(--#{$fa-css-prefix}-animation-duration, 1s);
|
24
|
+
animation-iteration-count: var(
|
25
|
+
--#{$fa-css-prefix}-animation-iteration-count,
|
26
|
+
infinite
|
27
|
+
);
|
28
|
+
animation-timing-function: var(
|
29
|
+
--#{$fa-css-prefix}-animation-timing,
|
30
|
+
cubic-bezier(0.28, 0.84, 0.42, 1)
|
31
|
+
);
|
32
|
+
}
|
33
|
+
|
34
|
+
.#{$fa-css-prefix}-fade {
|
35
|
+
animation-name: #{$fa-css-prefix}-fade;
|
36
|
+
animation-delay: var(--#{$fa-css-prefix}-animation-delay, 0s);
|
37
|
+
animation-direction: var(--#{$fa-css-prefix}-animation-direction, normal);
|
38
|
+
animation-duration: var(--#{$fa-css-prefix}-animation-duration, 1s);
|
39
|
+
animation-iteration-count: var(
|
40
|
+
--#{$fa-css-prefix}-animation-iteration-count,
|
41
|
+
infinite
|
42
|
+
);
|
43
|
+
animation-timing-function: var(
|
44
|
+
--#{$fa-css-prefix}-animation-timing,
|
45
|
+
cubic-bezier(0.4, 0, 0.6, 1)
|
46
|
+
);
|
47
|
+
}
|
48
|
+
|
49
|
+
.#{$fa-css-prefix}-beat-fade {
|
50
|
+
animation-name: #{$fa-css-prefix}-beat-fade;
|
51
|
+
animation-delay: var(--#{$fa-css-prefix}-animation-delay, 0s);
|
52
|
+
animation-direction: var(--#{$fa-css-prefix}-animation-direction, normal);
|
53
|
+
animation-duration: var(--#{$fa-css-prefix}-animation-duration, 1s);
|
54
|
+
animation-iteration-count: var(
|
55
|
+
--#{$fa-css-prefix}-animation-iteration-count,
|
56
|
+
infinite
|
57
|
+
);
|
58
|
+
animation-timing-function: var(
|
59
|
+
--#{$fa-css-prefix}-animation-timing,
|
60
|
+
cubic-bezier(0.4, 0, 0.6, 1)
|
61
|
+
);
|
62
|
+
}
|
63
|
+
|
64
|
+
.#{$fa-css-prefix}-flip {
|
65
|
+
animation-name: #{$fa-css-prefix}-flip;
|
66
|
+
animation-delay: var(--#{$fa-css-prefix}-animation-delay, 0s);
|
67
|
+
animation-direction: var(--#{$fa-css-prefix}-animation-direction, normal);
|
68
|
+
animation-duration: var(--#{$fa-css-prefix}-animation-duration, 1s);
|
69
|
+
animation-iteration-count: var(
|
70
|
+
--#{$fa-css-prefix}-animation-iteration-count,
|
71
|
+
infinite
|
72
|
+
);
|
73
|
+
animation-timing-function: var(
|
74
|
+
--#{$fa-css-prefix}-animation-timing,
|
75
|
+
ease-in-out
|
76
|
+
);
|
77
|
+
}
|
78
|
+
|
79
|
+
.#{$fa-css-prefix}-shake {
|
80
|
+
animation-name: #{$fa-css-prefix}-shake;
|
81
|
+
animation-delay: var(--#{$fa-css-prefix}-animation-delay, 0s);
|
82
|
+
animation-direction: var(--#{$fa-css-prefix}-animation-direction, normal);
|
83
|
+
animation-duration: var(--#{$fa-css-prefix}-animation-duration, 1s);
|
84
|
+
animation-iteration-count: var(
|
85
|
+
--#{$fa-css-prefix}-animation-iteration-count,
|
86
|
+
infinite
|
87
|
+
);
|
88
|
+
animation-timing-function: var(--#{$fa-css-prefix}-animation-timing, linear);
|
89
|
+
}
|
90
|
+
|
91
|
+
.#{$fa-css-prefix}-spin {
|
92
|
+
animation-name: #{$fa-css-prefix}-spin;
|
93
|
+
animation-delay: var(--#{$fa-css-prefix}-animation-delay, 0s);
|
94
|
+
animation-direction: var(--#{$fa-css-prefix}-animation-direction, normal);
|
95
|
+
animation-duration: var(--#{$fa-css-prefix}-animation-duration, 2s);
|
96
|
+
animation-iteration-count: var(
|
97
|
+
--#{$fa-css-prefix}-animation-iteration-count,
|
98
|
+
infinite
|
99
|
+
);
|
100
|
+
animation-timing-function: var(--#{$fa-css-prefix}-animation-timing, linear);
|
101
|
+
}
|
102
|
+
|
103
|
+
.#{$fa-css-prefix}-spin-reverse {
|
104
|
+
--#{$fa-css-prefix}-animation-direction: reverse;
|
105
|
+
}
|
106
|
+
|
107
|
+
.#{$fa-css-prefix}-pulse,
|
108
|
+
.#{$fa-css-prefix}-spin-pulse {
|
109
|
+
animation-name: #{$fa-css-prefix}-spin;
|
110
|
+
animation-direction: var(--#{$fa-css-prefix}-animation-direction, normal);
|
111
|
+
animation-duration: var(--#{$fa-css-prefix}-animation-duration, 1s);
|
112
|
+
animation-iteration-count: var(
|
113
|
+
--#{$fa-css-prefix}-animation-iteration-count,
|
114
|
+
infinite
|
115
|
+
);
|
116
|
+
animation-timing-function: var(
|
117
|
+
--#{$fa-css-prefix}-animation-timing,
|
118
|
+
steps(8)
|
119
|
+
);
|
120
|
+
}
|
121
|
+
|
122
|
+
// if agent or operating system prefers reduced motion, disable animations
|
123
|
+
// see: https://www.smashingmagazine.com/2020/09/design-reduced-motion-sensitivities/
|
124
|
+
// see: https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-reduced-motion
|
125
|
+
@media (prefers-reduced-motion: reduce) {
|
126
|
+
.#{$fa-css-prefix}-beat,
|
127
|
+
.#{$fa-css-prefix}-bounce,
|
128
|
+
.#{$fa-css-prefix}-fade,
|
129
|
+
.#{$fa-css-prefix}-beat-fade,
|
130
|
+
.#{$fa-css-prefix}-flip,
|
131
|
+
.#{$fa-css-prefix}-pulse,
|
132
|
+
.#{$fa-css-prefix}-shake,
|
133
|
+
.#{$fa-css-prefix}-spin,
|
134
|
+
.#{$fa-css-prefix}-spin-pulse {
|
135
|
+
animation-delay: -1ms;
|
136
|
+
animation-duration: 1ms;
|
137
|
+
animation-iteration-count: 1;
|
138
|
+
transition-delay: 0s;
|
139
|
+
transition-duration: 0s;
|
140
|
+
}
|
141
|
+
}
|
142
|
+
|
143
|
+
@keyframes #{$fa-css-prefix}-beat {
|
144
|
+
0%,
|
145
|
+
90% {
|
146
|
+
transform: scale(1);
|
147
|
+
}
|
148
|
+
|
149
|
+
45% {
|
150
|
+
transform: scale(var(--#{$fa-css-prefix}-beat-scale, 1.25));
|
151
|
+
}
|
152
|
+
}
|
153
|
+
|
154
|
+
@keyframes #{$fa-css-prefix}-bounce {
|
155
|
+
0% {
|
156
|
+
transform: scale(1, 1) translateY(0);
|
157
|
+
}
|
158
|
+
|
159
|
+
10% {
|
160
|
+
transform: scale(
|
161
|
+
var(--#{$fa-css-prefix}-bounce-start-scale-x, 1.1),
|
162
|
+
var(--#{$fa-css-prefix}-bounce-start-scale-y, 0.9)
|
163
|
+
)
|
164
|
+
translateY(0);
|
165
|
+
}
|
166
|
+
|
167
|
+
30% {
|
168
|
+
transform: scale(
|
169
|
+
var(--#{$fa-css-prefix}-bounce-jump-scale-x, 0.9),
|
170
|
+
var(--#{$fa-css-prefix}-bounce-jump-scale-y, 1.1)
|
171
|
+
)
|
172
|
+
translateY(var(--#{$fa-css-prefix}-bounce-height, -0.5em));
|
173
|
+
}
|
174
|
+
|
175
|
+
50% {
|
176
|
+
transform: scale(
|
177
|
+
var(--#{$fa-css-prefix}-bounce-land-scale-x, 1.05),
|
178
|
+
var(--#{$fa-css-prefix}-bounce-land-scale-y, 0.95)
|
179
|
+
)
|
180
|
+
translateY(0);
|
181
|
+
}
|
182
|
+
|
183
|
+
57% {
|
184
|
+
transform: scale(1, 1)
|
185
|
+
translateY(var(--#{$fa-css-prefix}-bounce-rebound, -0.125em));
|
186
|
+
}
|
187
|
+
|
188
|
+
64% {
|
189
|
+
transform: scale(1, 1) translateY(0);
|
190
|
+
}
|
191
|
+
|
192
|
+
100% {
|
193
|
+
transform: scale(1, 1) translateY(0);
|
194
|
+
}
|
195
|
+
}
|
196
|
+
|
197
|
+
@keyframes #{$fa-css-prefix}-fade {
|
198
|
+
50% {
|
199
|
+
opacity: var(--#{$fa-css-prefix}-fade-opacity, 0.4);
|
200
|
+
}
|
201
|
+
}
|
202
|
+
|
203
|
+
@keyframes #{$fa-css-prefix}-beat-fade {
|
204
|
+
0%,
|
205
|
+
100% {
|
206
|
+
opacity: var(--#{$fa-css-prefix}-beat-fade-opacity, 0.4);
|
207
|
+
transform: scale(1);
|
208
|
+
}
|
209
|
+
|
210
|
+
50% {
|
211
|
+
opacity: 1;
|
212
|
+
transform: scale(var(--#{$fa-css-prefix}-beat-fade-scale, 1.125));
|
213
|
+
}
|
214
|
+
}
|
215
|
+
|
216
|
+
@keyframes #{$fa-css-prefix}-flip {
|
217
|
+
50% {
|
218
|
+
transform: rotate3d(
|
219
|
+
var(--#{$fa-css-prefix}-flip-x, 0),
|
220
|
+
var(--#{$fa-css-prefix}-flip-y, 1),
|
221
|
+
var(--#{$fa-css-prefix}-flip-z, 0),
|
222
|
+
var(--#{$fa-css-prefix}-flip-angle, -180deg)
|
223
|
+
);
|
224
|
+
}
|
225
|
+
}
|
226
|
+
|
227
|
+
@keyframes #{$fa-css-prefix}-shake {
|
228
|
+
0% {
|
229
|
+
transform: rotate(-15deg);
|
230
|
+
}
|
231
|
+
|
232
|
+
4% {
|
233
|
+
transform: rotate(15deg);
|
234
|
+
}
|
235
|
+
|
236
|
+
8%,
|
237
|
+
24% {
|
238
|
+
transform: rotate(-18deg);
|
239
|
+
}
|
240
|
+
|
241
|
+
12%,
|
242
|
+
28% {
|
243
|
+
transform: rotate(18deg);
|
244
|
+
}
|
245
|
+
|
246
|
+
16% {
|
247
|
+
transform: rotate(-22deg);
|
248
|
+
}
|
249
|
+
|
250
|
+
20% {
|
251
|
+
transform: rotate(22deg);
|
252
|
+
}
|
253
|
+
|
254
|
+
32% {
|
255
|
+
transform: rotate(-12deg);
|
256
|
+
}
|
257
|
+
|
258
|
+
36% {
|
259
|
+
transform: rotate(12deg);
|
260
|
+
}
|
261
|
+
|
262
|
+
40%,
|
263
|
+
100% {
|
264
|
+
transform: rotate(0deg);
|
265
|
+
}
|
266
|
+
}
|
267
|
+
|
268
|
+
@keyframes #{$fa-css-prefix}-spin {
|
269
|
+
0% {
|
270
|
+
transform: rotate(0deg);
|
271
|
+
}
|
272
|
+
|
273
|
+
100% {
|
274
|
+
transform: rotate(360deg);
|
275
|
+
}
|
276
|
+
}
|
@@ -0,0 +1,20 @@
|
|
1
|
+
// bordered + pulled icons
|
2
|
+
// -------------------------
|
3
|
+
|
4
|
+
.#{$fa-css-prefix}-border {
|
5
|
+
border-color: var(--#{$fa-css-prefix}-border-color, #{$fa-border-color});
|
6
|
+
border-radius: var(--#{$fa-css-prefix}-border-radius, #{$fa-border-radius});
|
7
|
+
border-style: var(--#{$fa-css-prefix}-border-style, #{$fa-border-style});
|
8
|
+
border-width: var(--#{$fa-css-prefix}-border-width, #{$fa-border-width});
|
9
|
+
padding: var(--#{$fa-css-prefix}-border-padding, #{$fa-border-padding});
|
10
|
+
}
|
11
|
+
|
12
|
+
.#{$fa-css-prefix}-pull-left {
|
13
|
+
float: left;
|
14
|
+
margin-right: var(--#{$fa-css-prefix}-pull-margin, #{$fa-pull-margin});
|
15
|
+
}
|
16
|
+
|
17
|
+
.#{$fa-css-prefix}-pull-right {
|
18
|
+
float: right;
|
19
|
+
margin-left: var(--#{$fa-css-prefix}-pull-margin, #{$fa-pull-margin});
|
20
|
+
}
|