@cruk/cruk-react-components 1.1.6 → 1.1.7
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/CHANGELOG.md +6 -0
- package/lib/cjs/src/components/Carousel/index.js +1 -1
- package/lib/cjs/src/components/Footer/index.js +1 -1
- package/lib/components/AddressLookup/index.d.ts +1 -26
- package/lib/components/Button/index.d.ts +1 -19
- package/lib/components/Carousel/Dots.d.ts +4 -4
- package/lib/components/Carousel/index.d.ts +8 -3
- package/lib/components/Checkbox/index.d.ts +3 -2
- package/lib/components/Collapse/styles.d.ts +1 -11
- package/lib/components/Divider.d.ts +5 -2
- package/lib/components/Footer/index.d.ts +3 -2
- package/lib/components/Icon/index.d.ts +0 -1
- package/lib/components/IconFa/index.d.ts +0 -1
- package/lib/components/LabelWrapper/index.d.ts +1 -0
- package/lib/components/LegendWrapper/index.d.ts +2 -2
- package/lib/components/Link/index.d.ts +1 -21
- package/lib/components/Loader/index.d.ts +1 -2
- package/lib/components/Modal/index.d.ts +4 -2
- package/lib/components/Modal/styles.d.ts +1 -11
- package/lib/components/Pagination/index.d.ts +2 -1
- package/lib/components/PopOver/index.d.ts +3 -2
- package/lib/components/ProgressBar/index.d.ts +3 -2
- package/lib/components/Radio/index.d.ts +3 -2
- package/lib/components/RadioConsent/styles.d.ts +1 -1
- package/lib/components/Step/index.d.ts +2 -1
- package/lib/components/TestWrapper.d.ts +7 -3
- package/lib/components/ThemeCheatSheet.d.ts +1 -3
- package/lib/components/Totaliser/styles.d.ts +1 -2
- package/lib/docs/Docs.d.ts +2 -0
- package/lib/docs/index.d.ts +1 -0
- package/lib/es/src/components/Carousel/index.js +1 -1
- package/lib/es/src/components/Footer/index.js +1 -1
- package/lib/hocs/MdxProvider.d.ts +5 -2
- package/package.json +6 -4
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [1.1.7] - 2022-08-19
|
|
9
|
+
|
|
10
|
+
### Changed
|
|
11
|
+
|
|
12
|
+
Adding react and react-dom 18 as peer dependency option and removeing a types that use FC or FunctionComponent [#540](https://github.com/CRUKorg/cruk-react-components/issues/#540))
|
|
13
|
+
|
|
8
14
|
## [1.1.6] - 2022-08-15
|
|
9
15
|
|
|
10
16
|
### Fixed
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("../../../node_modules/react-intersection-observer/react-intersection-observer.modern.mjs.js"),r=require("../Box/index.js"),n=require("./Dots.js"),l=require("./styles.js");function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("../../../node_modules/react-intersection-observer/react-intersection-observer.modern.mjs.js"),r=require("../Box/index.js"),n=require("./Dots.js"),l=require("./styles.js");function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var a=o(e),u=function(o){var u=o.startPosition,s=void 0===u?0:u,c=o.children,i=o.onPositionChanged,d=o.shrinkUnselectedPages,f=void 0!==d&&d,h=e.useState(s),m=h[0],v=h[1],C=e.useState(!0),E=C[0],g=C[1],p=e.useRef(null),j=a.default.Children.toArray(c).filter(Boolean),x=function(e){if(p&&p.current){var t=p.current.scrollWidth,r=0===e,n=e===p.current.children.length-1,l=p.current.children[e];if(!l)return;var o=l.offsetLeft;r?p.current.scrollTo(0,0):n?p.current.scrollTo(t,0):p.current.scrollTo(o,0),E||g(!0)}};e.useEffect((function(){0!==s&&g(!1)}),[s]),e.useEffect((function(){!1===E&&x(s)}),[E]);var y=1===j.length;return a.default.createElement(a.default.Fragment,null,a.default.createElement(r.default,null,a.default.createElement(l.CarouselWrapper,null,a.default.createElement(l.CarouselScrollArea,{ref:p,"aria-live":"assertive",smoothScrolling:E,tabIndex:0},j.map((function(e,r){var n=r===m;return a.default.createElement(l.CarouselCard,{key:"card".concat(r),onlyChild:y},a.default.createElement(t.InView,{threshold:.5,as:"div",onChange:function(e){var t;e&&m!==(t=r)&&(v(t),i&&i(t))}},a.default.createElement(l.CarouselCardInner,{onlyChild:y,isSelected:n,shrinkUnselectedPages:f},e)))}))))),j.length>1?a.default.createElement(r.default,null,a.default.createElement(n.Dots,{count:j.length,currentPosition:m,scrollToPosition:x,next:function(){x(m+1)},previous:function(){x(m-1)}})):null)},s=e.memo(u);exports.Carousel=u,exports.default=s;
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../node_modules/tslib/tslib.es6.js"),t=require("react"),l=require("styled-components"),r=require("../../themes/cruk.js"),n=require("../Text/index.js"),a=require("./styles.js");function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var u=o(t),d=function(t){var o=t.children,d=t.middleSection,s=u.default.Children.toArray(o),i=l.useTheme(),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../node_modules/tslib/tslib.es6.js"),t=require("react"),l=require("styled-components"),r=require("../../themes/cruk.js"),n=require("../Text/index.js"),a=require("./styles.js");function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var u=o(t),d=function(t){var o=t.children,d=t.middleSection,s=u.default.Children.toArray(o),i=l.useTheme(),c=e.__assign(e.__assign({},r.default),i);return u.default.createElement(l.ThemeProvider,{theme:c},u.default.createElement(a.StyledFooter,null,u.default.createElement(a.FooterContentWrapper,null,u.default.createElement(a.FooterSectionLogo,null,u.default.createElement(a.StyledRegulatorLogo,{alt:c.siteConfig.footerLogoAlt||"",src:c.siteConfig.footerLogoSrc||""})),u.default.createElement(a.FooterSectionLinks,null,u.default.createElement(a.StyledNav,{"aria-label":"footer links"},u.default.createElement(a.StyledUL,null,s.length?s.map((function(e,t){return u.default.createElement(a.StyledLI,{key:"footerLink".concat(t)},e)})):null))),u.default.createElement(a.FooterSection,null,d?"string"==typeof d?u.default.createElement(n.Text,{textSize:"s"},d):u.default.createElement(u.default.Fragment,null,d):u.default.createElement(n.Text,{textSize:"s"},c.siteConfig.footerCopyText)),u.default.createElement(a.FooterSectionAddress,null,u.default.createElement(a.StyledAddress,null,u.default.createElement(n.Text,{as:"span",textSize:"s"},"2 Redman Place"),u.default.createElement(n.Text,{as:"span",textSize:"s"},"London"),u.default.createElement(n.Text,{as:"span",textSize:"s"},"E20 1JQ"))))))};exports.Footer=d,exports.default=d;
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -32,30 +32,5 @@ export declare type AddressLookupProps = InputHTMLAttributes<HTMLInputElement> &
|
|
|
32
32
|
* You will need a Loqate api key, the examples below use "MG17-ZD93-FF33-KF13" our development key.
|
|
33
33
|
* This component is generally only used for country codes including "GBR", "GGY", "IMN", "JEY". An example of this behavior is included bellow.
|
|
34
34
|
*/
|
|
35
|
-
declare const AddressLookup: React.ForwardRefExoticComponent<Pick<React.InputHTMLAttributes<HTMLInputElement
|
|
36
|
-
/** api key for loqate */
|
|
37
|
-
apiKey: string;
|
|
38
|
-
/** list of countries codes you want the address look up to search within */
|
|
39
|
-
countries?: string[] | undefined;
|
|
40
|
-
/** callback function which is passed the selected address data */
|
|
41
|
-
onAddressSelected: (address: AddressDataType) => void;
|
|
42
|
-
/** error message */
|
|
43
|
-
errorMessage?: string | undefined;
|
|
44
|
-
/** when true a input has a red border */
|
|
45
|
-
hasError?: boolean | undefined;
|
|
46
|
-
/** flag which effects the check or cross icons to the right of the input */
|
|
47
|
-
isValid?: boolean | undefined;
|
|
48
|
-
/** flag to hide or show the check icon when valid */
|
|
49
|
-
isValidVisible?: boolean | undefined;
|
|
50
|
-
/** flag to hide or show the cross icon when invalid */
|
|
51
|
-
isInvalidVisible?: boolean | undefined;
|
|
52
|
-
/** label text */
|
|
53
|
-
label?: string | undefined;
|
|
54
|
-
/** callback function which is passed the error */
|
|
55
|
-
onAddressError?: ((error: Error) => void) | undefined;
|
|
56
|
-
/** onBlur handler */
|
|
57
|
-
onBlur?: ((e: FocusEvent<HTMLInputElement>) => void) | undefined;
|
|
58
|
-
/** attach a DOM reference variable to your component */
|
|
59
|
-
ref?: React.Ref<HTMLInputElement> | undefined;
|
|
60
|
-
}, "apiKey" | "countries" | "errorMessage" | "hasError" | "isValid" | "isValidVisible" | "isInvalidVisible" | "label" | "onAddressError" | "onAddressSelected" | keyof React.InputHTMLAttributes<HTMLInputElement>> & React.RefAttributes<HTMLInputElement>>;
|
|
35
|
+
declare const AddressLookup: React.ForwardRefExoticComponent<Pick<AddressLookupProps, "apiKey" | "countries" | "errorMessage" | "hasError" | "isValid" | "isValidVisible" | "isInvalidVisible" | "label" | "onAddressError" | "onAddressSelected" | keyof React.InputHTMLAttributes<HTMLInputElement>> & React.RefAttributes<HTMLInputElement>>;
|
|
61
36
|
export default AddressLookup;
|
|
@@ -24,23 +24,5 @@ export declare type Props = ButtonHTMLAttributes<HTMLElement> & {
|
|
|
24
24
|
*
|
|
25
25
|
* Design system documentation SU2C https://zeroheight.com/79db39f7e/p/22ff0e-button/b/32e1a2
|
|
26
26
|
*/
|
|
27
|
-
export declare const Button: React.ForwardRefExoticComponent<Pick<React.ButtonHTMLAttributes<HTMLElement> &
|
|
28
|
-
/** the look and feel of the button */
|
|
29
|
-
appearance?: ButtonAppearanceType | undefined;
|
|
30
|
-
/** flag to streatch but to 100% width */
|
|
31
|
-
full?: boolean | undefined;
|
|
32
|
-
/** this is a url which will convert the button to an anchor tag */
|
|
33
|
-
href?: string | undefined;
|
|
34
|
-
/** the height of the button, this will add padding not increase text size */
|
|
35
|
-
size?: "m" | "l" | undefined;
|
|
36
|
-
css?: any;
|
|
37
|
-
/** styled-components polymorphism where you can use the styling of a button but convert to another element like an anchor tag */
|
|
38
|
-
as?: React.ElementType<any> | undefined;
|
|
39
|
-
/** flag to force button into an icon button shape which is square or round */
|
|
40
|
-
isIconButton?: boolean | undefined;
|
|
41
|
-
/** Element reference */
|
|
42
|
-
ref?: React.Ref<HTMLElement> | undefined;
|
|
43
|
-
/** Component reference */
|
|
44
|
-
children?: ReactNode;
|
|
45
|
-
}, keyof React.ButtonHTMLAttributes<HTMLElement> | "appearance" | "full" | "href" | "size" | "css" | "as" | "isIconButton"> & React.RefAttributes<HTMLElement>>;
|
|
27
|
+
export declare const Button: React.ForwardRefExoticComponent<Pick<Props, keyof React.ButtonHTMLAttributes<HTMLElement> | "appearance" | "full" | "href" | "size" | "css" | "as" | "isIconButton"> & React.RefAttributes<HTMLElement>>;
|
|
46
28
|
export default Button;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ButtonHTMLAttributes } from "react";
|
|
2
2
|
declare type DotProps = {
|
|
3
3
|
count: number;
|
|
4
4
|
currentPosition: number;
|
|
@@ -6,7 +6,7 @@ declare type DotProps = {
|
|
|
6
6
|
next: () => void;
|
|
7
7
|
previous: () => void;
|
|
8
8
|
};
|
|
9
|
-
export declare const CarouselLeftButton:
|
|
10
|
-
export declare const CarouselRightButton:
|
|
11
|
-
export declare const Dots:
|
|
9
|
+
export declare const CarouselLeftButton: (props: ButtonHTMLAttributes<HTMLElement>) => JSX.Element;
|
|
10
|
+
export declare const CarouselRightButton: (props: ButtonHTMLAttributes<HTMLElement>) => JSX.Element;
|
|
11
|
+
export declare const Dots: ({ count, currentPosition, scrollToPosition, next, previous, }: DotProps) => JSX.Element;
|
|
12
12
|
export default Dots;
|
|
@@ -1,13 +1,18 @@
|
|
|
1
|
-
import React, {
|
|
1
|
+
import React, { ReactNode } from "react";
|
|
2
2
|
export declare type CarouselProps = {
|
|
3
|
+
/** Index in which the carousel is scrolled to on mount */
|
|
3
4
|
startPosition?: number;
|
|
5
|
+
/** call back for on position changed first prop is the possition */
|
|
4
6
|
onPositionChanged?: (position: number) => void;
|
|
7
|
+
/** show item left and right of current smaller than current item */
|
|
5
8
|
shrinkUnselectedPages?: boolean;
|
|
9
|
+
/** childrent item of the carousel */
|
|
10
|
+
children?: ReactNode;
|
|
6
11
|
};
|
|
7
12
|
/**
|
|
8
13
|
*
|
|
9
14
|
* Light weight carousel component that works with mouse and touch events, will work with divs and much anything you chuck in children
|
|
10
15
|
*/
|
|
11
|
-
export declare const Carousel:
|
|
12
|
-
declare const _default: React.MemoExoticComponent<
|
|
16
|
+
export declare const Carousel: ({ startPosition, children, onPositionChanged, shrinkUnselectedPages, }: CarouselProps) => JSX.Element;
|
|
17
|
+
declare const _default: React.MemoExoticComponent<({ startPosition, children, onPositionChanged, shrinkUnselectedPages, }: CarouselProps) => JSX.Element>;
|
|
13
18
|
export default _default;
|
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import React, { InputHTMLAttributes, Ref, ReactNode } from "react";
|
|
2
2
|
export declare type CheckBoxProps = InputHTMLAttributes<HTMLInputElement> & {
|
|
3
3
|
ref?: Ref<HTMLInputElement>;
|
|
4
4
|
/** flag for error styling */
|
|
5
5
|
hasError?: boolean;
|
|
6
6
|
/** error message text */
|
|
7
7
|
errorMessage?: string;
|
|
8
|
+
children?: ReactNode;
|
|
8
9
|
};
|
|
9
10
|
/**
|
|
10
11
|
* Checkboxes allow the user to select one or more items.
|
|
11
12
|
*
|
|
12
13
|
* The value or children becomes the label, if you want an outer label for a checkbox or group of checkboxes please use a LegendWrapper component
|
|
13
14
|
*/
|
|
14
|
-
declare const Checkbox:
|
|
15
|
+
declare const Checkbox: React.ForwardRefExoticComponent<Pick<CheckBoxProps, keyof React.InputHTMLAttributes<HTMLInputElement> | "hasError" | "errorMessage"> & React.RefAttributes<HTMLInputElement>>;
|
|
15
16
|
export default Checkbox;
|
|
@@ -4,17 +4,7 @@ export declare const transitionDurationSeconds = 0.5;
|
|
|
4
4
|
export declare const FlippingIcon: import("styled-components").StyledComponent<({ faIcon, color, size, ...rest }: import("../IconFa").IconFaProps) => JSX.Element, any, {
|
|
5
5
|
open: boolean;
|
|
6
6
|
}, never>;
|
|
7
|
-
export declare const DefaultHeader: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<Pick<import("react").ButtonHTMLAttributes<HTMLElement> & {
|
|
8
|
-
appearance?: import("../../types").ButtonAppearanceType | undefined;
|
|
9
|
-
full?: boolean | undefined;
|
|
10
|
-
href?: string | undefined;
|
|
11
|
-
size?: "m" | "l" | undefined;
|
|
12
|
-
css?: any;
|
|
13
|
-
as?: import("react").ElementType<any> | undefined;
|
|
14
|
-
isIconButton?: boolean | undefined;
|
|
15
|
-
ref?: import("react").Ref<HTMLElement> | undefined;
|
|
16
|
-
children?: import("react").ReactNode;
|
|
17
|
-
}, "size" | keyof import("react").ButtonHTMLAttributes<HTMLElement> | "appearance" | "full" | "href" | "css" | "as" | "isIconButton"> & import("react").RefAttributes<HTMLElement>>, any, {
|
|
7
|
+
export declare const DefaultHeader: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<Pick<import("../Button").Props, "size" | keyof import("react").ButtonHTMLAttributes<HTMLElement> | "appearance" | "full" | "href" | "css" | "as" | "isIconButton"> & import("react").RefAttributes<HTMLElement>>, any, {
|
|
18
8
|
textColor?: string | undefined;
|
|
19
9
|
textSize?: FontSizeType | undefined;
|
|
20
10
|
textFontFamily?: string | undefined;
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
declare type DividerProps = {
|
|
3
|
+
children?: ReactNode;
|
|
4
|
+
};
|
|
5
|
+
export declare const Divider: ({ children }: DividerProps) => JSX.Element;
|
|
3
6
|
export default Divider;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ReactNode, HTMLAttributes } from "react";
|
|
2
2
|
export declare type FooterProps = HTMLAttributes<HTMLElement> & {
|
|
3
3
|
/** used to customise text in middle section, it could also be react element, this is not to be confused with the component children which is primarily for the links in the footer */
|
|
4
4
|
middleSection?: ReactNode;
|
|
5
|
+
children?: ReactNode;
|
|
5
6
|
};
|
|
6
7
|
/**
|
|
7
8
|
* There should be only one footer component at the bottom of the body of each page. Links can be passed as children
|
|
8
9
|
* */
|
|
9
|
-
export declare const Footer:
|
|
10
|
+
export declare const Footer: ({ children, middleSection }: FooterProps) => JSX.Element;
|
|
10
11
|
export default Footer;
|
|
@@ -8,6 +8,7 @@ declare type LabelWrapperProps = {
|
|
|
8
8
|
required?: boolean;
|
|
9
9
|
/** flag to stop (required) appearing in label, useful for compound form components like DateInput */
|
|
10
10
|
hideRequiredInLabel?: boolean;
|
|
11
|
+
children?: ReactNode;
|
|
11
12
|
};
|
|
12
13
|
export declare const LabelWrapper: FunctionComponent<LabelWrapperProps>;
|
|
13
14
|
export default LabelWrapper;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
2
|
export declare type LegendWrapperProps = {
|
|
3
3
|
children?: ReactNode;
|
|
4
4
|
/** legend text */
|
|
@@ -18,5 +18,5 @@ export declare type LegendWrapperProps = {
|
|
|
18
18
|
* hasError and errorMessage props are just props that can be passed into the component.
|
|
19
19
|
* There is no functionality checking if the children are valid/required etc this functionality will be needed to ne added outside of this component.
|
|
20
20
|
*/
|
|
21
|
-
export declare const LegendWrapper:
|
|
21
|
+
export declare const LegendWrapper: ({ children, legendText, required, errorMessage, hasError, hintText, }: LegendWrapperProps) => JSX.Element;
|
|
22
22
|
export default LegendWrapper;
|
|
@@ -22,25 +22,5 @@ export declare 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<
|
|
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
|
-
} & {
|
|
35
|
-
/** link text hover colour */
|
|
36
|
-
textHoverColor?: string | undefined;
|
|
37
|
-
/** link appearance variant, undefined is a standarding link withing a text block */
|
|
38
|
-
appearance?: "primary" | "secondary" | undefined;
|
|
39
|
-
/** styled-components polymorphism where you can use the styling of a link but convert to another element like a button */
|
|
40
|
-
ref?: React.Ref<HTMLElement> | undefined;
|
|
41
|
-
/** styled-component polymorphic feature so you take the styling of a link and cast the component to be a "span" for example */
|
|
42
|
-
as?: React.ElementType<any> | undefined;
|
|
43
|
-
/** Component children */
|
|
44
|
-
children?: ReactNode;
|
|
45
|
-
}, "slot" | "style" | "title" | "download" | "href" | "hrefLang" | "media" | "ping" | "rel" | "target" | "type" | "referrerPolicy" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "margin" | "marginTop" | "marginRight" | "marginBottom" | "marginLeft" | "marginVertical" | "marginHorizontal" | "padding" | "paddingTop" | "paddingRight" | "paddingBottom" | "paddingLeft" | "paddingVertical" | "paddingHorizontal" | "textColor" | "textAlign" | "textSize" | "textWeight" | "as" | "wordBreak" | "overflowWrap" | "textHoverColor" | "appearance"> & React.RefAttributes<HTMLElement>>;
|
|
25
|
+
export declare const Link: React.ForwardRefExoticComponent<Pick<LinkProps, "slot" | "style" | "title" | "download" | "href" | "hrefLang" | "media" | "ping" | "rel" | "target" | "type" | "referrerPolicy" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "margin" | "marginTop" | "marginRight" | "marginBottom" | "marginLeft" | "marginVertical" | "marginHorizontal" | "padding" | "paddingTop" | "paddingRight" | "paddingBottom" | "paddingLeft" | "paddingVertical" | "paddingHorizontal" | "textColor" | "textAlign" | "textSize" | "textWeight" | "as" | "wordBreak" | "overflowWrap" | "textHoverColor" | "appearance"> & React.RefAttributes<HTMLElement>>;
|
|
46
26
|
export default Link;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { FC } from "react";
|
|
2
1
|
/**
|
|
3
2
|
*
|
|
4
3
|
* Loaders are used after some user interaction that we assume will take some time to complete. They inform the user that their request is beeing processed and that they should wait.
|
|
5
4
|
*/
|
|
6
|
-
declare const Loader:
|
|
5
|
+
declare const Loader: () => JSX.Element;
|
|
7
6
|
export default Loader;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
2
|
export declare type ModalProps = {
|
|
3
3
|
/** modal name used for aria-label */
|
|
4
4
|
modalName: string;
|
|
@@ -12,6 +12,8 @@ export declare type ModalProps = {
|
|
|
12
12
|
top?: string;
|
|
13
13
|
/** background color of dialogue */
|
|
14
14
|
backgroundColor?: string;
|
|
15
|
+
/** children components */
|
|
16
|
+
children?: ReactNode;
|
|
15
17
|
};
|
|
16
18
|
/**
|
|
17
19
|
*
|
|
@@ -23,5 +25,5 @@ export declare type ModalProps = {
|
|
|
23
25
|
* ## Accessibility
|
|
24
26
|
* - Once the Modal is appeared on the screen, the focus must be within the Modal container which will enable the screen readers to be able to navigate within the Modal. You may wish to hide the close button so that a user must click on another button to confirm a choice before the modal is closed. However closing with the 'ESC' key must always work, so the props which contains the function that allows the modal to close itself 'closeFunction' is always required.
|
|
25
27
|
*/
|
|
26
|
-
declare const Modal:
|
|
28
|
+
declare const Modal: ({ modalName, closeFunction, showCloseButton, maxWidth, top, backgroundColor, children, }: ModalProps) => JSX.Element;
|
|
27
29
|
export default Modal;
|
|
@@ -5,14 +5,4 @@ export declare const Content: import("styled-components").StyledComponent<import
|
|
|
5
5
|
maxWidth: string;
|
|
6
6
|
top: string;
|
|
7
7
|
}, never>;
|
|
8
|
-
export declare const CloseButton: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<Pick<import("react").ButtonHTMLAttributes<HTMLElement> & {
|
|
9
|
-
appearance?: import("../../types").ButtonAppearanceType | undefined;
|
|
10
|
-
full?: boolean | undefined;
|
|
11
|
-
href?: string | undefined;
|
|
12
|
-
size?: "m" | "l" | undefined;
|
|
13
|
-
css?: any;
|
|
14
|
-
as?: import("react").ElementType<any> | undefined;
|
|
15
|
-
isIconButton?: boolean | undefined;
|
|
16
|
-
ref?: import("react").Ref<HTMLElement> | undefined;
|
|
17
|
-
children?: import("react").ReactNode;
|
|
18
|
-
}, "css" | "as" | keyof import("react").ButtonHTMLAttributes<HTMLElement> | "appearance" | "full" | "href" | "size" | "isIconButton"> & import("react").RefAttributes<HTMLElement>>, any, {}, never>;
|
|
8
|
+
export declare const CloseButton: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<Pick<import("../Button").Props, "css" | "as" | keyof import("react").ButtonHTMLAttributes<HTMLElement> | "appearance" | "full" | "href" | "size" | "isIconButton"> & import("react").RefAttributes<HTMLElement>>, any, {}, never>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FunctionComponent } from "react";
|
|
1
|
+
import { FunctionComponent, ReactNode } from "react";
|
|
2
2
|
export declare type PaginationProps = {
|
|
3
3
|
/** set current page number */
|
|
4
4
|
current: number;
|
|
@@ -12,6 +12,7 @@ export declare type PaginationProps = {
|
|
|
12
12
|
perPage: number;
|
|
13
13
|
/** the name of the search param in the url that is modified on page click, defaults to 'page' */
|
|
14
14
|
searchParam?: string;
|
|
15
|
+
children?: ReactNode;
|
|
15
16
|
};
|
|
16
17
|
/**
|
|
17
18
|
*
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
2
|
import { PopOverPositionType } from "../../types";
|
|
3
3
|
export declare type PopOverProps = {
|
|
4
4
|
/** used for aria-label of modal */
|
|
@@ -14,10 +14,11 @@ export declare type PopOverProps = {
|
|
|
14
14
|
minWidth?: string;
|
|
15
15
|
/** popover isOpen changed handler */
|
|
16
16
|
onPopOverIsOpenChange?: (isOpen: boolean) => void;
|
|
17
|
+
children?: ReactNode;
|
|
17
18
|
};
|
|
18
19
|
/**
|
|
19
20
|
* Popover is a non-modal dialog that floats around its disclosure. It's
|
|
20
21
|
commonly used for displaying additional rich content on top of something.
|
|
21
22
|
*/
|
|
22
|
-
declare const PopOver:
|
|
23
|
+
declare const PopOver: ({ onPopOverIsOpenChange, children, minWidth, maxWidth, position, modalLabel, modalContent, css, }: PopOverProps) => JSX.Element;
|
|
23
24
|
export default PopOver;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
2
|
export declare type ProgressBarProps = {
|
|
3
3
|
/** percentage value of the progressbar */
|
|
4
4
|
percentage: number;
|
|
@@ -14,10 +14,11 @@ export declare type ProgressBarProps = {
|
|
|
14
14
|
barColor?: string;
|
|
15
15
|
/** foreground colour of chart secondary bar */
|
|
16
16
|
secondaryBarColor?: string;
|
|
17
|
+
children?: ReactNode;
|
|
17
18
|
};
|
|
18
19
|
/**
|
|
19
20
|
* Provide up-to-date feedback on the progress of a workflow or action with
|
|
20
21
|
simple yet flexible progress bars.
|
|
21
22
|
*/
|
|
22
|
-
declare const ProgressBar:
|
|
23
|
+
declare const ProgressBar: ({ percentage, isCircular, circleContents, circleSize, barColor, secondaryBarColor, secondaryPercentage, children, }: ProgressBarProps) => JSX.Element;
|
|
23
24
|
export default ProgressBar;
|
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import React, { InputHTMLAttributes, Ref, ReactNode } from "react";
|
|
2
2
|
export declare type RadioProps = InputHTMLAttributes<HTMLInputElement> & {
|
|
3
3
|
ref?: Ref<HTMLInputElement>;
|
|
4
4
|
/** flag for error styling */
|
|
5
5
|
hasError?: boolean;
|
|
6
6
|
/** error message text */
|
|
7
7
|
errorMessage?: string;
|
|
8
|
+
children?: ReactNode;
|
|
8
9
|
};
|
|
9
10
|
/**
|
|
10
11
|
* A single radio button which should be part of a field set of radio buttons
|
|
11
12
|
*
|
|
12
13
|
* The value or children becomes the label, if you want an outer label for a radio or group of radios please use a LegendWrapper component
|
|
13
14
|
*/
|
|
14
|
-
declare const Radio:
|
|
15
|
+
declare const Radio: React.ForwardRefExoticComponent<Pick<RadioProps, keyof React.InputHTMLAttributes<HTMLInputElement> | "hasError" | "errorMessage"> & React.RefAttributes<HTMLInputElement>>;
|
|
15
16
|
export default Radio;
|
|
@@ -3,7 +3,7 @@ import { ThemeType } from "../../types";
|
|
|
3
3
|
declare type ThemeProp = {
|
|
4
4
|
theme: ThemeType;
|
|
5
5
|
};
|
|
6
|
-
export declare const StyledRadio: import("styled-components").StyledComponent<import("react").
|
|
6
|
+
export declare const StyledRadio: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<Pick<import("../Radio").RadioProps, keyof import("react").InputHTMLAttributes<HTMLInputElement> | "hasError" | "errorMessage"> & import("react").RefAttributes<HTMLInputElement>>, any, {
|
|
7
7
|
numberOfAttributes: number;
|
|
8
8
|
} & ThemeProp, never>;
|
|
9
9
|
export declare const StyledLegend: import("styled-components").StyledComponent<"legend", any, {}, never>;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { FunctionComponent } from "react";
|
|
1
|
+
import { FunctionComponent, ReactNode } from "react";
|
|
2
2
|
export declare type StepProps = {
|
|
3
3
|
/** current step number */
|
|
4
4
|
current: number;
|
|
5
5
|
/** list of step */
|
|
6
6
|
steps: string[];
|
|
7
|
+
children?: ReactNode;
|
|
7
8
|
};
|
|
8
9
|
/**
|
|
9
10
|
*
|
|
@@ -1,8 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
2
|
import { ThemeType } from "src/types";
|
|
3
3
|
declare type TestThemeWrapperProps = {
|
|
4
4
|
theme?: ThemeType;
|
|
5
|
+
children?: ReactNode;
|
|
5
6
|
};
|
|
6
|
-
export declare const TestThemeWrapper:
|
|
7
|
-
|
|
7
|
+
export declare const TestThemeWrapper: ({ children, theme, }: TestThemeWrapperProps) => JSX.Element;
|
|
8
|
+
declare type TestWrapperProps = {
|
|
9
|
+
children?: ReactNode;
|
|
10
|
+
};
|
|
11
|
+
export declare const TestWrapper: ({ children }: TestWrapperProps) => JSX.Element;
|
|
8
12
|
export default TestWrapper;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
export declare const BubbleWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
3
2
|
export declare const ProgressBarWrapper: import("styled-components").StyledComponent<"div", any, {
|
|
4
3
|
isCompact?: boolean | undefined;
|
|
@@ -12,5 +11,5 @@ declare type TotaliserWrapperProps = {
|
|
|
12
11
|
};
|
|
13
12
|
export declare const TotaliserWrapper: import("styled-components").StyledComponent<"div", any, TotaliserWrapperProps, never>;
|
|
14
13
|
export declare const CompactWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
15
|
-
export declare const StyledProgressBar: import("styled-components").StyledComponent<
|
|
14
|
+
export declare const StyledProgressBar: import("styled-components").StyledComponent<({ percentage, isCircular, circleContents, circleSize, barColor, secondaryBarColor, secondaryPercentage, children, }: import("../ProgressBar").ProgressBarProps) => JSX.Element, any, {}, never>;
|
|
16
15
|
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import e,{memo as r,useState as t,useRef as n,useEffect as o}from"react";import{InView as l}from"../../../node_modules/react-intersection-observer/react-intersection-observer.modern.mjs.js";import i from"../Box/index.js";import{Dots as c}from"./Dots.js";import{CarouselWrapper as s,CarouselScrollArea as a,CarouselCard as u,CarouselCardInner as m}from"./styles.js";var d=function(r){var d=r.startPosition,f=void 0===d?0:d,h=r.children,v=r.onPositionChanged,g=r.shrinkUnselectedPages,E=void 0!==g&&g,p=t(f),P=p[0],j=p[1],x=t(!0),y=x[0],C=x[1],T=n(null),b=e.Children.toArray(h).filter(Boolean),k=function(e){if(T&&T.current){var r=T.current.scrollWidth,t=0===e,n=e===T.current.children.length-1,o=T.current.children[e];if(!o)return;var l=o.offsetLeft;t?T.current.scrollTo(0,0):n?T.current.scrollTo(r,0):T.current.scrollTo(l,0),y||C(!0)}};o((function(){0!==f&&C(!1)}),[f]),o((function(){!1===y&&k(f)}),[y]);var B=1===b.length;return e.createElement(e.Fragment,null,e.createElement(i,null,e.createElement(s,null,e.createElement(a,{ref:T,"aria-live":"assertive",smoothScrolling:y,tabIndex:0},b.map((function(r,t){var n=t===P;return e.createElement(u,{key:t,onlyChild:B},e.createElement(l,{threshold:.5,as:"div",onChange:function(e){var r;e&&P!==(r=t)&&(j(r),v&&v(r))}},e.createElement(m,{onlyChild:B,isSelected:n,shrinkUnselectedPages:E},r)))}))))),b.length>1?e.createElement(i,null,e.createElement(c,{count:b.length,currentPosition:P,scrollToPosition:k,next:function(){k(P+1)},previous:function(){k(P-1)}})):null)},f=r(d);export{d as Carousel,f as default};
|
|
1
|
+
import e,{memo as r,useState as t,useRef as n,useEffect as o}from"react";import{InView as l}from"../../../node_modules/react-intersection-observer/react-intersection-observer.modern.mjs.js";import i from"../Box/index.js";import{Dots as c}from"./Dots.js";import{CarouselWrapper as s,CarouselScrollArea as a,CarouselCard as u,CarouselCardInner as m}from"./styles.js";var d=function(r){var d=r.startPosition,f=void 0===d?0:d,h=r.children,v=r.onPositionChanged,g=r.shrinkUnselectedPages,E=void 0!==g&&g,p=t(f),P=p[0],j=p[1],x=t(!0),y=x[0],C=x[1],T=n(null),b=e.Children.toArray(h).filter(Boolean),k=function(e){if(T&&T.current){var r=T.current.scrollWidth,t=0===e,n=e===T.current.children.length-1,o=T.current.children[e];if(!o)return;var l=o.offsetLeft;t?T.current.scrollTo(0,0):n?T.current.scrollTo(r,0):T.current.scrollTo(l,0),y||C(!0)}};o((function(){0!==f&&C(!1)}),[f]),o((function(){!1===y&&k(f)}),[y]);var B=1===b.length;return e.createElement(e.Fragment,null,e.createElement(i,null,e.createElement(s,null,e.createElement(a,{ref:T,"aria-live":"assertive",smoothScrolling:y,tabIndex:0},b.map((function(r,t){var n=t===P;return e.createElement(u,{key:"card".concat(t),onlyChild:B},e.createElement(l,{threshold:.5,as:"div",onChange:function(e){var r;e&&P!==(r=t)&&(j(r),v&&v(r))}},e.createElement(m,{onlyChild:B,isSelected:n,shrinkUnselectedPages:E},r)))}))))),b.length>1?e.createElement(i,null,e.createElement(c,{count:b.length,currentPosition:P,scrollToPosition:k,next:function(){k(P+1)},previous:function(){k(P-1)}})):null)},f=r(d);export{d as Carousel,f as default};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__assign as e}from"../../../node_modules/tslib/tslib.es6.js";import t from"react";import{useTheme as
|
|
1
|
+
import{__assign as e}from"../../../node_modules/tslib/tslib.es6.js";import t from"react";import{useTheme as n,ThemeProvider as l}from"styled-components";import r from"../../themes/cruk.js";import{Text as o}from"../Text/index.js";import{StyledFooter as a,FooterContentWrapper as m,FooterSectionLogo as s,StyledRegulatorLogo as c,FooterSectionLinks as i,StyledNav as E,StyledUL as f,StyledLI as u,FooterSection as p,FooterSectionAddress as d,StyledAddress as x}from"./styles.js";var g=function(g){var S=g.children,y=g.middleSection,h=t.Children.toArray(S),z=n(),C=e(e({},r),z);return t.createElement(l,{theme:C},t.createElement(a,null,t.createElement(m,null,t.createElement(s,null,t.createElement(c,{alt:C.siteConfig.footerLogoAlt||"",src:C.siteConfig.footerLogoSrc||""})),t.createElement(i,null,t.createElement(E,{"aria-label":"footer links"},t.createElement(f,null,h.length?h.map((function(e,n){return t.createElement(u,{key:"footerLink".concat(n)},e)})):null))),t.createElement(p,null,y?"string"==typeof y?t.createElement(o,{textSize:"s"},y):t.createElement(t.Fragment,null,y):t.createElement(o,{textSize:"s"},C.siteConfig.footerCopyText)),t.createElement(d,null,t.createElement(x,null,t.createElement(o,{as:"span",textSize:"s"},"2 Redman Place"),t.createElement(o,{as:"span",textSize:"s"},"London"),t.createElement(o,{as:"span",textSize:"s"},"E20 1JQ"))))))};export{g as Footer,g as default};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
declare
|
|
1
|
+
import { ReactNode } from "@mdx-js/react/lib";
|
|
2
|
+
declare type MdxProviderProps = {
|
|
3
|
+
children?: ReactNode;
|
|
4
|
+
};
|
|
5
|
+
declare const MdxProvider: ({ children }: MdxProviderProps) => JSX.Element;
|
|
3
6
|
export default MdxProvider;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cruk/cruk-react-components",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.7",
|
|
4
4
|
"description": "React components implementing CRUK and SU2C designs",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"publishConfig": {
|
|
@@ -99,9 +99,11 @@
|
|
|
99
99
|
"@types/assert": "^1.5.1",
|
|
100
100
|
"@types/cypress-image-snapshot": "^3.1.6",
|
|
101
101
|
"@types/jest": "^27.4.0",
|
|
102
|
+
"@types/mdx": "^2.0.2",
|
|
102
103
|
"@types/mdx-js__react": "^1.5.1",
|
|
103
104
|
"@types/node": "^17.0.25",
|
|
104
|
-
"@types/
|
|
105
|
+
"@types/reach__router": "^1.3.10",
|
|
106
|
+
"@types/react": "^18.0.17",
|
|
105
107
|
"@types/react-dom": "^17.0.17",
|
|
106
108
|
"@types/styled-components": "^5.1.22",
|
|
107
109
|
"@typescript-eslint/eslint-plugin": "^5.29.0",
|
|
@@ -147,8 +149,8 @@
|
|
|
147
149
|
"webpack-dev-server": "^4.7.3"
|
|
148
150
|
},
|
|
149
151
|
"peerDependencies": {
|
|
150
|
-
"react": "^16.12.0 || ^17.0.1 ",
|
|
151
|
-
"react-dom": "^16.12.0 || ^17.0.1 ",
|
|
152
|
+
"react": "^16.12.0 || ^17.0.1 || ^18.0.1 ",
|
|
153
|
+
"react-dom": "^16.12.0 || ^17.0.1 || ^18.0.1 ",
|
|
152
154
|
"styled-components": "^5.3.5"
|
|
153
155
|
},
|
|
154
156
|
"dependencies": {
|