@cruk/cruk-react-components 1.2.4 → 1.3.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.
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var n=require("../../../node_modules/tslib/tslib.es6.js"),e=require("styled-components"),t=require("../../themes/cruk.js");function i(n){return n&&"object"==typeof n&&"default"in n?n:{default:n}}var o,a,r,d,h,
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var n=require("../../../node_modules/tslib/tslib.es6.js"),e=require("styled-components"),t=require("../../themes/cruk.js");function i(n){return n&&"object"==typeof n&&"default"in n?n:{default:n}}var o,a,r,d,l,h,s,u,p,c,m,f=i(e),g="120px",x="72px",b=t.default.spacing.s,y="40px",k="0.2s",w=f.default.header(o||(o=n.__makeTemplateObject(["\n box-sizing: border-box;\n position: relative;\n width: 100%;\n background-color: ",";\n z-index: 9998;\n"],["\n box-sizing: border-box;\n position: relative;\n width: 100%;\n background-color: ",";\n z-index: 9998;\n"])),(function(n){return n.theme.colors.headerBackground})),v=f.default.div(a||(a=n.__makeTemplateObject(["\n position: relative;\n box-sizing: border-box;\n width: 100%;\n height: ",";\n\n @media (min-width: ",") {\n height: ",";\n }\n"],["\n position: relative;\n box-sizing: border-box;\n width: 100%;\n height: ",";\n\n @media (min-width: ",") {\n height: ",";\n }\n"])),x,(function(n){return n.theme.breakpoint.desktop}),g),_=f.default.div(r||(r=n.__makeTemplateObject(["\n width: 100%;\n height: 100%;\n padding: 0 ",";\n background-color: ",";\n position: relative;\n border-bottom: ",";\n height: ",";\n\n top: ",";\n position: ",";\n transition: height "," ease;\n\n @media (min-width: ",") {\n position: ",";\n height: ",";\n }\n"],["\n width: 100%;\n height: 100%;\n padding: 0 ",";\n background-color: ",";\n position: relative;\n border-bottom: ",";\n height: ",";\n\n top: ",";\n position: ",";\n transition: height "," ease;\n\n @media (min-width: ",") {\n position: ",";\n height: ",";\n }\n"])),b,(function(n){return n.theme.colors.headerBackground}),(function(n){var e=n.theme.colors.headerBorder;return"solid 1px ".concat(e)}),x,(function(n){return n.isSticky?0:"auto"}),(function(n){return n.isSticky?"fixed":"relative"}),k,(function(n){return n.theme.breakpoint.desktop}),(function(n){return n.isSticky?"fixed":"relative"}),(function(n){var e=n.isSmall,t=n.isSticky;return e&&t?x:g})),j=f.default.div(d||(d=n.__makeTemplateObject(["\n display: flex;\n align-items: center;\n justify-content: space-between;\n width: 100%;\n height: 100%;\n margin: 0 auto;\n max-width: ",";\n"],["\n display: flex;\n align-items: center;\n justify-content: space-between;\n width: 100%;\n height: 100%;\n margin: 0 auto;\n max-width: ",";\n"])),(function(n){var e=n.fullWidth,t=n.theme.utilities.contentMaxWidth;return e?"100%":t})),z=f.default.img(l||(l=n.__makeTemplateObject(["\n height: 100%;\n width: auto;\n max-width: 100%;\n max-height: 100%;\n"],["\n height: 100%;\n width: auto;\n max-width: 100%;\n max-height: 100%;\n"]))),S=f.default.div(h||(h=n.__makeTemplateObject(["\n display: flex;\n flex-direction: column;\n justify-content: space-around;\n width: auto;\n transition: height "," ease;\n\n height: ",";\n\n @media (min-width: ",") {\n height: ",";\n }\n"],["\n display: flex;\n flex-direction: column;\n justify-content: space-around;\n width: auto;\n transition: height "," ease;\n\n height: ",";\n\n @media (min-width: ",") {\n height: ",";\n }\n"])),k,y,(function(n){return n.theme.breakpoint.desktop}),(function(n){var e=n.isSmall,t=n.isSticky;return e&&t?y:"80px"})),T=f.default.a(s||(s=n.__makeTemplateObject(["\n display: inline-block;\n"],["\n display: inline-block;\n"]))),O=f.default.a(u||(u=n.__makeTemplateObject(["\n left: -999px;\n position: absolute;\n top: auto;\n width: 1px;\n height: 1px;\n overflow: hidden;\n z-index: -999;\n &:focus,\n &:active,\n &:focus-within {\n left: auto;\n top: auto;\n width: 30%;\n height: auto;\n overflow: auto;\n margin: 10px 35%;\n padding: ",";\n border-radius: 15px;\n border: 4px solid yellow;\n text-align: center;\n font-size: 1.2em;\n z-index: 999;\n }\n"],["\n left: -999px;\n position: absolute;\n top: auto;\n width: 1px;\n height: 1px;\n overflow: hidden;\n z-index: -999;\n &:focus,\n &:active,\n &:focus-within {\n left: auto;\n top: auto;\n width: 30%;\n height: auto;\n overflow: auto;\n margin: 10px 35%;\n padding: ",";\n border-radius: 15px;\n border: 4px solid yellow;\n text-align: center;\n font-size: 1.2em;\n z-index: 999;\n }\n"])),(function(n){return n.theme.spacing.xs})),H=f.default.p(p||(p=n.__makeTemplateObject(["\n flex: 1 1 auto;\n font-family: ",";\n font-weight: ",";\n font-size: ",";\n color: ",";\n text-align: center;\n opacity: 0;\n transition: opacity "," ease;\n display: none;\n\n @media (min-width: ",") {\n display: block;\n opacity: ",";\n }\n"],["\n flex: 1 1 auto;\n font-family: ",";\n font-weight: ",";\n font-size: ",";\n color: ",";\n text-align: center;\n opacity: 0;\n transition: opacity "," ease;\n display: none;\n\n @media (min-width: ",") {\n display: block;\n opacity: ",";\n }\n"])),(function(n){return n.theme.typography.fontFamilyHeadings}),(function(n){return n.theme.typography.fontWeightLight}),(function(n){return n.theme.fontSizes.xl}),(function(n){return n.theme.colors.primary}),k,(function(n){return n.theme.breakpoint.desktop}),(function(n){var e=n.isSmall,t=n.isSticky;return e&&t?0:1})),W=f.default.div(c||(c=n.__makeTemplateObject(["\n height: 100%;\n display: flex;\n flex-direction: column;\n justify-content: space-around;\n"],["\n height: 100%;\n display: flex;\n flex-direction: column;\n justify-content: space-around;\n"]))),C=f.default.div(m||(m=n.__makeTemplateObject(["\n height: auto;\n margin: auto 0;\n"],["\n height: auto;\n margin: auto 0;\n"])));exports.ChildInner=C,exports.ChildWrapper=W,exports.HeaderMainContent=j,exports.HeaderStickyContainer=_,exports.HeaderStickyPlaceHolder=v,exports.Logo=z,exports.LogoWrapper=S,exports.SkipToMain=O,exports.StyledHeader=w,exports.StyledLink=T,exports.Tagline=H;
|
|
2
2
|
//# sourceMappingURL=styles.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { AnchorHTMLAttributes, Ref, ElementType, ReactNode } from "react";
|
|
2
2
|
import { TextProps } from "../Text";
|
|
3
|
-
export type LinkProps = AnchorHTMLAttributes<HTMLElement> & TextProps & {
|
|
3
|
+
export type LinkProps = Omit<AnchorHTMLAttributes<HTMLElement>, "nonce"> & Omit<TextProps, "as" | "ref"> & {
|
|
4
4
|
/** link text hover colour */
|
|
5
5
|
textHoverColor?: string;
|
|
6
6
|
/** link appearance variant, undefined is a standarding link withing a text block */
|
|
@@ -22,16 +22,7 @@ export type LinkProps = AnchorHTMLAttributes<HTMLElement> & TextProps & {
|
|
|
22
22
|
* If you want something that looks like a link but behaves like a button ie. nothing to do with navigation, please consider using Link with as='button'
|
|
23
23
|
*
|
|
24
24
|
* If you want something that looks like a button but behaves like a link ie. it takes the user to a new location, please consider using Button and simply passing it an href, it will automatically turn into a link. */
|
|
25
|
-
export declare const Link: React.ForwardRefExoticComponent<Pick<React.AnchorHTMLAttributes<HTMLElement> &
|
|
26
|
-
textColor?: string | undefined;
|
|
27
|
-
textAlign?: "left" | "right" | "center" | "justify" | undefined;
|
|
28
|
-
textSize?: import("..").FontSizeType | undefined;
|
|
29
|
-
textWeight?: number | undefined;
|
|
30
|
-
as?: any;
|
|
31
|
-
wordBreak?: import("..").WordBreakType | undefined;
|
|
32
|
-
overflowWrap?: import("..").OverflowWrapType | undefined;
|
|
33
|
-
ref?: React.Ref<HTMLElement> | undefined;
|
|
34
|
-
} & {
|
|
25
|
+
export declare const Link: React.ForwardRefExoticComponent<Pick<Omit<React.AnchorHTMLAttributes<HTMLElement>, "nonce"> & Omit<TextProps, "as" | "ref"> & {
|
|
35
26
|
/** link text hover colour */
|
|
36
27
|
textHoverColor?: string | undefined;
|
|
37
28
|
/** link appearance variant, undefined is a standarding link withing a text block */
|
|
@@ -42,5 +33,5 @@ export declare const Link: React.ForwardRefExoticComponent<Pick<React.AnchorHTML
|
|
|
42
33
|
as?: React.ElementType<any> | undefined;
|
|
43
34
|
/** Component children */
|
|
44
35
|
children?: ReactNode;
|
|
45
|
-
}, "
|
|
36
|
+
}, "download" | "href" | "hrefLang" | "media" | "ping" | "rel" | "target" | "type" | "referrerPolicy" | "as" | keyof import("../Spacing").SpacingProps | keyof React.HTMLAttributes<HTMLElement> | "textColor" | "textAlign" | "textSize" | "textWeight" | "wordBreak" | "overflowWrap" | "textHoverColor" | "appearance"> & React.RefAttributes<HTMLElement>>;
|
|
46
37
|
export default Link;
|
|
@@ -7,7 +7,7 @@ export declare const StyledLink: import("styled-components").StyledComponent<imp
|
|
|
7
7
|
textAlign?: "left" | "right" | "center" | "justify" | undefined;
|
|
8
8
|
textSize?: import("../../types").FontSizeType | undefined;
|
|
9
9
|
textWeight?: number | undefined;
|
|
10
|
-
as?: any;
|
|
10
|
+
as?: import("react").ElementType<any> | undefined;
|
|
11
11
|
wordBreak?: import("../../types").WordBreakType | undefined;
|
|
12
12
|
overflowWrap?: import("../../types").OverflowWrapType | undefined;
|
|
13
13
|
ref?: import("react").Ref<HTMLElement> | undefined;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FunctionComponent, HTMLAttributes, Ref } from "react";
|
|
1
|
+
import { FunctionComponent, HTMLAttributes, Ref, ElementType } from "react";
|
|
2
2
|
import { SpacingProps } from "../Spacing";
|
|
3
3
|
import { WordBreakType, FontSizeType, ColorKeyType, OverflowWrapType } from "../../types";
|
|
4
4
|
/**
|
|
@@ -14,7 +14,7 @@ export type TextProps = SpacingProps & HTMLAttributes<HTMLElement> & {
|
|
|
14
14
|
/** font weight theme.typography{fontWeightHeavy/fontWeightNormal/fontWeightMedium/fontWeightLight/fontWeightVLight} is better than a random number */
|
|
15
15
|
textWeight?: number;
|
|
16
16
|
/** styled-components polymorphism where you can set this to "span", "p" or "h2" it default to "p" */
|
|
17
|
-
as?:
|
|
17
|
+
as?: ElementType;
|
|
18
18
|
/** word-break behaviour */
|
|
19
19
|
wordBreak?: WordBreakType;
|
|
20
20
|
/** overflow-wrap behaviour */
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__makeTemplateObject as n}from"../../../node_modules/tslib/tslib.es6.js";import t from"styled-components";import i from"../../themes/cruk.js";var e,o,r,
|
|
1
|
+
import{__makeTemplateObject as n}from"../../../node_modules/tslib/tslib.es6.js";import t from"styled-components";import i from"../../themes/cruk.js";var e,o,a,r,h,d,s,u,l,c,p,f="120px",g="72px",m=i.spacing.s,x="40px",y="0.2s",w=t.header(e||(e=n(["\n box-sizing: border-box;\n position: relative;\n width: 100%;\n background-color: ",";\n z-index: 9998;\n"],["\n box-sizing: border-box;\n position: relative;\n width: 100%;\n background-color: ",";\n z-index: 9998;\n"])),(function(n){return n.theme.colors.headerBackground})),b=t.div(o||(o=n(["\n position: relative;\n box-sizing: border-box;\n width: 100%;\n height: ",";\n\n @media (min-width: ",") {\n height: ",";\n }\n"],["\n position: relative;\n box-sizing: border-box;\n width: 100%;\n height: ",";\n\n @media (min-width: ",") {\n height: ",";\n }\n"])),g,(function(n){return n.theme.breakpoint.desktop}),f),v=t.div(a||(a=n(["\n width: 100%;\n height: 100%;\n padding: 0 ",";\n background-color: ",";\n position: relative;\n border-bottom: ",";\n height: ",";\n\n top: ",";\n position: ",";\n transition: height "," ease;\n\n @media (min-width: ",") {\n position: ",";\n height: ",";\n }\n"],["\n width: 100%;\n height: 100%;\n padding: 0 ",";\n background-color: ",";\n position: relative;\n border-bottom: ",";\n height: ",";\n\n top: ",";\n position: ",";\n transition: height "," ease;\n\n @media (min-width: ",") {\n position: ",";\n height: ",";\n }\n"])),m,(function(n){return n.theme.colors.headerBackground}),(function(n){var t=n.theme.colors.headerBorder;return"solid 1px ".concat(t)}),g,(function(n){return n.isSticky?0:"auto"}),(function(n){return n.isSticky?"fixed":"relative"}),y,(function(n){return n.theme.breakpoint.desktop}),(function(n){return n.isSticky?"fixed":"relative"}),(function(n){var t=n.isSmall,i=n.isSticky;return t&&i?g:f})),k=t.div(r||(r=n(["\n display: flex;\n align-items: center;\n justify-content: space-between;\n width: 100%;\n height: 100%;\n margin: 0 auto;\n max-width: ",";\n"],["\n display: flex;\n align-items: center;\n justify-content: space-between;\n width: 100%;\n height: 100%;\n margin: 0 auto;\n max-width: ",";\n"])),(function(n){var t=n.fullWidth,i=n.theme.utilities.contentMaxWidth;return t?"100%":i})),z=t.img(h||(h=n(["\n height: 100%;\n width: auto;\n max-width: 100%;\n max-height: 100%;\n"],["\n height: 100%;\n width: auto;\n max-width: 100%;\n max-height: 100%;\n"]))),S=t.div(d||(d=n(["\n display: flex;\n flex-direction: column;\n justify-content: space-around;\n width: auto;\n transition: height "," ease;\n\n height: ",";\n\n @media (min-width: ",") {\n height: ",";\n }\n"],["\n display: flex;\n flex-direction: column;\n justify-content: space-around;\n width: auto;\n transition: height "," ease;\n\n height: ",";\n\n @media (min-width: ",") {\n height: ",";\n }\n"])),y,x,(function(n){return n.theme.breakpoint.desktop}),(function(n){var t=n.isSmall,i=n.isSticky;return t&&i?x:"80px"})),j=t.a(s||(s=n(["\n display: inline-block;\n"],["\n display: inline-block;\n"]))),B=t.a(u||(u=n(["\n left: -999px;\n position: absolute;\n top: auto;\n width: 1px;\n height: 1px;\n overflow: hidden;\n z-index: -999;\n &:focus,\n &:active,\n &:focus-within {\n left: auto;\n top: auto;\n width: 30%;\n height: auto;\n overflow: auto;\n margin: 10px 35%;\n padding: ",";\n border-radius: 15px;\n border: 4px solid yellow;\n text-align: center;\n font-size: 1.2em;\n z-index: 999;\n }\n"],["\n left: -999px;\n position: absolute;\n top: auto;\n width: 1px;\n height: 1px;\n overflow: hidden;\n z-index: -999;\n &:focus,\n &:active,\n &:focus-within {\n left: auto;\n top: auto;\n width: 30%;\n height: auto;\n overflow: auto;\n margin: 10px 35%;\n padding: ",";\n border-radius: 15px;\n border: 4px solid yellow;\n text-align: center;\n font-size: 1.2em;\n z-index: 999;\n }\n"])),(function(n){return n.theme.spacing.xs})),W=t.p(l||(l=n(["\n flex: 1 1 auto;\n font-family: ",";\n font-weight: ",";\n font-size: ",";\n color: ",";\n text-align: center;\n opacity: 0;\n transition: opacity "," ease;\n display: none;\n\n @media (min-width: ",") {\n display: block;\n opacity: ",";\n }\n"],["\n flex: 1 1 auto;\n font-family: ",";\n font-weight: ",";\n font-size: ",";\n color: ",";\n text-align: center;\n opacity: 0;\n transition: opacity "," ease;\n display: none;\n\n @media (min-width: ",") {\n display: block;\n opacity: ",";\n }\n"])),(function(n){return n.theme.typography.fontFamilyHeadings}),(function(n){return n.theme.typography.fontWeightLight}),(function(n){return n.theme.fontSizes.xl}),(function(n){return n.theme.colors.primary}),y,(function(n){return n.theme.breakpoint.desktop}),(function(n){var t=n.isSmall,i=n.isSticky;return t&&i?0:1})),F=t.div(c||(c=n(["\n height: 100%;\n display: flex;\n flex-direction: column;\n justify-content: space-around;\n"],["\n height: 100%;\n display: flex;\n flex-direction: column;\n justify-content: space-around;\n"]))),H=t.div(p||(p=n(["\n height: auto;\n margin: auto 0;\n"],["\n height: auto;\n margin: auto 0;\n"])));export{H as ChildInner,F as ChildWrapper,k as HeaderMainContent,v as HeaderStickyContainer,b as HeaderStickyPlaceHolder,z as Logo,S as LogoWrapper,B as SkipToMain,w as StyledHeader,j as StyledLink,W as Tagline};
|
|
2
2
|
//# sourceMappingURL=styles.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cruk/cruk-react-components",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.0",
|
|
4
4
|
"description": "React components implementing CRUK and SU2C designs",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"publishConfig": {
|
|
@@ -74,7 +74,6 @@
|
|
|
74
74
|
"@babel/preset-react": "^7.14.5",
|
|
75
75
|
"@babel/preset-typescript": "^7.9.0",
|
|
76
76
|
"@cruk/eslint-config": "^1.0.8",
|
|
77
|
-
"@cypress/react": "^7.0.2",
|
|
78
77
|
"@cypress/webpack-dev-server": "2.1.0",
|
|
79
78
|
"@cypress/webpack-preprocessor": "^5.12.0",
|
|
80
79
|
"@mdx-js/loader": "^2.2.1",
|
|
@@ -112,7 +111,7 @@
|
|
|
112
111
|
"babel-loader": "8.3.0",
|
|
113
112
|
"babel-plugin-styled-components": "^2.0.2",
|
|
114
113
|
"cypress": "^10.4.0",
|
|
115
|
-
"cypress-axe": "1.
|
|
114
|
+
"cypress-axe": "1.2.0",
|
|
116
115
|
"cypress-plugin-tab": "^1.0.5",
|
|
117
116
|
"eslint": "^8.30.0",
|
|
118
117
|
"eslint-config-airbnb": "^19.0.4",
|
|
@@ -144,7 +143,7 @@
|
|
|
144
143
|
"ts-loader": "9.4.1",
|
|
145
144
|
"typescript": "^4.9.4",
|
|
146
145
|
"webpack": "^5.53.0",
|
|
147
|
-
"webpack-cli": "
|
|
146
|
+
"webpack-cli": "5.0.1",
|
|
148
147
|
"webpack-dev-server": "^4.7.3"
|
|
149
148
|
},
|
|
150
149
|
"peerDependencies": {
|