@cruk/cruk-react-components 5.0.0 → 5.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +24 -0
- package/lib/components/AddressLookup/styles.d.ts +1 -1
- package/lib/components/Avatar/styles.d.ts +1 -1
- package/lib/components/Badge/index.d.ts +3 -3
- package/lib/components/Badge/styles.d.ts +5 -5
- package/lib/components/Box/styles.d.ts +4 -4
- package/lib/components/Button/styles.d.ts +5 -5
- package/lib/components/Carousel/styles.d.ts +8 -8
- package/lib/components/Checkbox/styles.d.ts +1 -1
- package/lib/components/Collapse/styles.d.ts +6 -6
- package/lib/components/Flex.d.ts +2 -1
- package/lib/components/Header/styles.d.ts +19 -22
- package/lib/components/Heading/index.d.ts +3 -3
- package/lib/components/Heading/styles.d.ts +8 -8
- package/lib/components/LabelWrapper/styles.d.ts +1 -1
- package/lib/components/LegendWrapper/styles.d.ts +3 -3
- package/lib/components/Link/styles.d.ts +2 -2
- package/lib/components/Modal/styles.d.ts +12 -13
- package/lib/components/Pagination/styles.d.ts +9 -11
- package/lib/components/PopOver/styles.d.ts +5 -5
- package/lib/components/ProgressBar/styles.d.ts +25 -29
- package/lib/components/Radio/styles.d.ts +13 -13
- package/lib/components/RadioConsent/styles.d.ts +8 -6
- package/lib/components/Select/styles.d.ts +2 -2
- package/lib/components/Spacing/index.d.ts +51 -2
- package/lib/components/Step/styles.d.ts +12 -14
- package/lib/components/Text/styles.d.ts +10 -10
- package/lib/components/TextAreaField/TextAreaField.stories.d.ts +0 -1
- package/lib/components/TextAreaField/styles.d.ts +2 -2
- package/lib/components/TextField/styles.d.ts +4 -4
- package/lib/components/Totaliser/index.d.ts +2 -2
- package/lib/components/Totaliser/styles.d.ts +20 -14
- package/lib/src/components/AddressLookup/index.js +1 -1
- package/lib/src/components/AddressLookup/index.js.map +1 -1
- package/lib/src/components/AddressLookup/styles.js +1 -1
- package/lib/src/components/AddressLookup/styles.js.map +1 -1
- package/lib/src/components/Avatar/index.js +1 -1
- package/lib/src/components/Avatar/index.js.map +1 -1
- package/lib/src/components/Avatar/styles.js +1 -1
- package/lib/src/components/Avatar/styles.js.map +1 -1
- package/lib/src/components/Badge/index.js +1 -1
- package/lib/src/components/Badge/index.js.map +1 -1
- package/lib/src/components/Badge/styles.js +1 -1
- package/lib/src/components/Badge/styles.js.map +1 -1
- package/lib/src/components/Box/index.js +1 -1
- package/lib/src/components/Box/index.js.map +1 -1
- package/lib/src/components/Box/styles.js +1 -1
- package/lib/src/components/Box/styles.js.map +1 -1
- package/lib/src/components/Button/index.js +1 -1
- package/lib/src/components/Button/index.js.map +1 -1
- package/lib/src/components/Button/styles.js +1 -1
- package/lib/src/components/Button/styles.js.map +1 -1
- package/lib/src/components/Carousel/index.js +1 -1
- package/lib/src/components/Carousel/index.js.map +1 -1
- package/lib/src/components/Carousel/styles.js +1 -1
- package/lib/src/components/Carousel/styles.js.map +1 -1
- package/lib/src/components/Checkbox/index.js +1 -1
- package/lib/src/components/Checkbox/index.js.map +1 -1
- package/lib/src/components/Checkbox/styles.js +1 -1
- package/lib/src/components/Checkbox/styles.js.map +1 -1
- package/lib/src/components/Collapse/index.js +1 -1
- package/lib/src/components/Collapse/index.js.map +1 -1
- package/lib/src/components/Collapse/styles.js +1 -1
- package/lib/src/components/Collapse/styles.js.map +1 -1
- package/lib/src/components/Divider.js +1 -1
- package/lib/src/components/Divider.js.map +1 -1
- package/lib/src/components/Flex.js +1 -1
- package/lib/src/components/Flex.js.map +1 -1
- package/lib/src/components/Header/index.js +1 -1
- package/lib/src/components/Header/index.js.map +1 -1
- package/lib/src/components/Header/styles.js +1 -1
- package/lib/src/components/Header/styles.js.map +1 -1
- package/lib/src/components/Heading/index.js +1 -1
- package/lib/src/components/Heading/index.js.map +1 -1
- package/lib/src/components/Heading/styles.js +1 -1
- package/lib/src/components/Heading/styles.js.map +1 -1
- package/lib/src/components/LabelWrapper/index.js +1 -1
- package/lib/src/components/LabelWrapper/index.js.map +1 -1
- package/lib/src/components/LabelWrapper/styles.js +1 -1
- package/lib/src/components/LabelWrapper/styles.js.map +1 -1
- package/lib/src/components/LegendWrapper/index.js +1 -1
- package/lib/src/components/LegendWrapper/index.js.map +1 -1
- package/lib/src/components/LegendWrapper/styles.js +1 -1
- package/lib/src/components/LegendWrapper/styles.js.map +1 -1
- package/lib/src/components/Link/index.js +1 -1
- package/lib/src/components/Link/index.js.map +1 -1
- package/lib/src/components/Link/styles.js +1 -1
- package/lib/src/components/Link/styles.js.map +1 -1
- package/lib/src/components/Modal/index.js +1 -1
- package/lib/src/components/Modal/index.js.map +1 -1
- package/lib/src/components/Modal/styles.js +1 -1
- package/lib/src/components/Modal/styles.js.map +1 -1
- package/lib/src/components/Pagination/index.js +1 -1
- package/lib/src/components/Pagination/index.js.map +1 -1
- package/lib/src/components/Pagination/styles.js +1 -1
- package/lib/src/components/Pagination/styles.js.map +1 -1
- package/lib/src/components/PopOver/index.js +1 -1
- package/lib/src/components/PopOver/index.js.map +1 -1
- package/lib/src/components/PopOver/styles.js +1 -1
- package/lib/src/components/PopOver/styles.js.map +1 -1
- package/lib/src/components/ProgressBar/index.js +1 -1
- package/lib/src/components/ProgressBar/index.js.map +1 -1
- package/lib/src/components/ProgressBar/styles.js +1 -1
- package/lib/src/components/ProgressBar/styles.js.map +1 -1
- package/lib/src/components/Radio/index.js +1 -1
- package/lib/src/components/Radio/index.js.map +1 -1
- package/lib/src/components/Radio/styles.js +1 -1
- package/lib/src/components/Radio/styles.js.map +1 -1
- package/lib/src/components/RadioConsent/index.js +1 -1
- package/lib/src/components/RadioConsent/index.js.map +1 -1
- package/lib/src/components/RadioConsent/styles.js +1 -1
- package/lib/src/components/RadioConsent/styles.js.map +1 -1
- package/lib/src/components/Select/index.js +1 -1
- package/lib/src/components/Select/index.js.map +1 -1
- package/lib/src/components/Select/styles.js +1 -1
- package/lib/src/components/Select/styles.js.map +1 -1
- package/lib/src/components/Spacing/index.js +1 -1
- package/lib/src/components/Spacing/index.js.map +1 -1
- package/lib/src/components/Step/index.js +1 -1
- package/lib/src/components/Step/index.js.map +1 -1
- package/lib/src/components/Step/styles.js +1 -1
- package/lib/src/components/Step/styles.js.map +1 -1
- package/lib/src/components/Text/index.js +1 -1
- package/lib/src/components/Text/index.js.map +1 -1
- package/lib/src/components/Text/styles.js +1 -1
- package/lib/src/components/Text/styles.js.map +1 -1
- package/lib/src/components/TextAreaField/index.js +1 -1
- package/lib/src/components/TextAreaField/index.js.map +1 -1
- package/lib/src/components/TextAreaField/styles.js +1 -1
- package/lib/src/components/TextAreaField/styles.js.map +1 -1
- package/lib/src/components/TextField/index.js +1 -1
- package/lib/src/components/TextField/index.js.map +1 -1
- package/lib/src/components/TextField/styles.js +1 -1
- package/lib/src/components/TextField/styles.js.map +1 -1
- package/lib/src/components/Totaliser/index.js +1 -1
- package/lib/src/components/Totaliser/index.js.map +1 -1
- package/lib/src/components/Totaliser/styles.js +1 -1
- package/lib/src/components/Totaliser/styles.js.map +1 -1
- package/package.json +1 -1
|
@@ -15,5 +15,54 @@ export type SpacingProps = {
|
|
|
15
15
|
paddingVertical?: SpaceType;
|
|
16
16
|
paddingHorizontal?: SpaceType;
|
|
17
17
|
};
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
interface SpacingPropsInterface {
|
|
19
|
+
margin?: SpaceType;
|
|
20
|
+
marginTop?: SpaceType;
|
|
21
|
+
marginRight?: SpaceType;
|
|
22
|
+
marginBottom?: SpaceType;
|
|
23
|
+
marginLeft?: SpaceType;
|
|
24
|
+
marginVertical?: SpaceType;
|
|
25
|
+
marginHorizontal?: SpaceType;
|
|
26
|
+
padding?: SpaceType;
|
|
27
|
+
paddingTop?: SpaceType;
|
|
28
|
+
paddingRight?: SpaceType;
|
|
29
|
+
paddingBottom?: SpaceType;
|
|
30
|
+
paddingLeft?: SpaceType;
|
|
31
|
+
paddingVertical?: SpaceType;
|
|
32
|
+
paddingHorizontal?: SpaceType;
|
|
33
|
+
}
|
|
34
|
+
export type SpacingPropsInternal = {
|
|
35
|
+
$margin?: SpaceType;
|
|
36
|
+
$marginTop?: SpaceType;
|
|
37
|
+
$marginRight?: SpaceType;
|
|
38
|
+
$marginBottom?: SpaceType;
|
|
39
|
+
$marginLeft?: SpaceType;
|
|
40
|
+
$marginVertical?: SpaceType;
|
|
41
|
+
$marginHorizontal?: SpaceType;
|
|
42
|
+
$padding?: SpaceType;
|
|
43
|
+
$paddingTop?: SpaceType;
|
|
44
|
+
$paddingRight?: SpaceType;
|
|
45
|
+
$paddingBottom?: SpaceType;
|
|
46
|
+
$paddingLeft?: SpaceType;
|
|
47
|
+
$paddingVertical?: SpaceType;
|
|
48
|
+
$paddingHorizontal?: SpaceType;
|
|
49
|
+
};
|
|
50
|
+
interface SpacingPropsInternalInterface {
|
|
51
|
+
$margin?: SpaceType;
|
|
52
|
+
$marginTop?: SpaceType;
|
|
53
|
+
$marginRight?: SpaceType;
|
|
54
|
+
$marginBottom?: SpaceType;
|
|
55
|
+
$marginLeft?: SpaceType;
|
|
56
|
+
$marginVertical?: SpaceType;
|
|
57
|
+
$marginHorizontal?: SpaceType;
|
|
58
|
+
$padding?: SpaceType;
|
|
59
|
+
$paddingTop?: SpaceType;
|
|
60
|
+
$paddingRight?: SpaceType;
|
|
61
|
+
$paddingBottom?: SpaceType;
|
|
62
|
+
$paddingLeft?: SpaceType;
|
|
63
|
+
$paddingVertical?: SpaceType;
|
|
64
|
+
$paddingHorizontal?: SpaceType;
|
|
65
|
+
}
|
|
66
|
+
export declare function spacingPropsToSpacingPropsInternal(props: SpacingPropsInterface): SpacingPropsInternalInterface;
|
|
67
|
+
export declare function spacing(props: SpacingPropsInternal, theme: ThemeType): string;
|
|
68
|
+
export default spacing;
|
|
@@ -1,18 +1,16 @@
|
|
|
1
1
|
import { type ThemeType } from "../../types";
|
|
2
2
|
export declare const StepWrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
3
|
-
|
|
4
|
-
total: number;
|
|
5
|
-
};
|
|
6
|
-
|
|
3
|
+
export declare const StepList: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLUListElement>, HTMLUListElement>, {
|
|
4
|
+
$total: number;
|
|
5
|
+
}>> & string;
|
|
6
|
+
export declare const StepBar: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {
|
|
7
7
|
theme: ThemeType;
|
|
8
|
-
};
|
|
9
|
-
export declare const
|
|
10
|
-
export declare const StepBar: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, ThemeProps>> & string;
|
|
11
|
-
export declare const StepTick: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, ThemeProps>> & string;
|
|
12
|
-
type StepItemProps = {
|
|
13
|
-
active: boolean;
|
|
14
|
-
done: boolean;
|
|
8
|
+
}>> & string;
|
|
9
|
+
export declare const StepTick: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {
|
|
15
10
|
theme: ThemeType;
|
|
16
|
-
};
|
|
17
|
-
export declare const StepItem: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>,
|
|
18
|
-
|
|
11
|
+
}>> & string;
|
|
12
|
+
export declare const StepItem: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>, {
|
|
13
|
+
$active: boolean;
|
|
14
|
+
$done: boolean;
|
|
15
|
+
theme: ThemeType;
|
|
16
|
+
}>> & string;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { type ElementType } from "react";
|
|
2
|
-
import { type
|
|
3
|
-
import { type WordBreakType, type FontSizeType, type ThemeType, type
|
|
4
|
-
export type TextStyledProps =
|
|
5
|
-
textColor?:
|
|
6
|
-
textAlign?: "left" | "right" | "center" | "justify";
|
|
7
|
-
textSize?: FontSizeType;
|
|
8
|
-
textWeight?: number;
|
|
2
|
+
import { type SpacingPropsInternal } from "../Spacing";
|
|
3
|
+
import { type WordBreakType, type FontSizeType, type ThemeType, type OverflowWrapType } from "../../types";
|
|
4
|
+
export type TextStyledProps = SpacingPropsInternal & {
|
|
5
|
+
$textColor?: string;
|
|
6
|
+
$textAlign?: "left" | "right" | "center" | "justify";
|
|
7
|
+
$textSize?: FontSizeType;
|
|
8
|
+
$textWeight?: number | string;
|
|
9
9
|
as?: ElementType;
|
|
10
|
-
wordBreak?: WordBreakType;
|
|
11
|
-
overflowWrap?: OverflowWrapType;
|
|
12
|
-
textFontFamily?: string;
|
|
10
|
+
$wordBreak?: WordBreakType;
|
|
11
|
+
$overflowWrap?: OverflowWrapType;
|
|
12
|
+
$textFontFamily?: string;
|
|
13
13
|
theme: ThemeType;
|
|
14
14
|
};
|
|
15
15
|
export declare const TextStyled: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>, TextStyledProps>> & string;
|
|
@@ -6,7 +6,6 @@ declare const _default: {
|
|
|
6
6
|
component: React.ForwardRefExoticComponent<Omit<import(".").TextAreaFieldProps, "ref"> & React.RefAttributes<HTMLTextAreaElement>>;
|
|
7
7
|
args: {
|
|
8
8
|
defaultValue: string;
|
|
9
|
-
textColor: string;
|
|
10
9
|
disabled: boolean;
|
|
11
10
|
required: boolean;
|
|
12
11
|
label: string;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { type ThemeType } from "../../types";
|
|
2
2
|
type StyledTextareaProps = {
|
|
3
|
-
hasError: boolean;
|
|
3
|
+
$hasError: boolean;
|
|
4
|
+
$lineCount: number;
|
|
4
5
|
resize: "both" | "vertical" | "horizontal" | "none";
|
|
5
|
-
lineCount: number;
|
|
6
6
|
theme: ThemeType;
|
|
7
7
|
};
|
|
8
8
|
declare const StyledTextArea: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement>, StyledTextareaProps>> & string;
|
|
@@ -3,11 +3,11 @@ type ExtraProps = {
|
|
|
3
3
|
theme: ThemeType;
|
|
4
4
|
};
|
|
5
5
|
type StyledInputProps = {
|
|
6
|
-
hasError: boolean;
|
|
7
|
-
isValid: boolean;
|
|
6
|
+
$hasError: boolean;
|
|
7
|
+
$isValid: boolean;
|
|
8
8
|
theme: ThemeType;
|
|
9
|
-
isValidVisible?: boolean;
|
|
10
|
-
isInvalidVisible?: boolean;
|
|
9
|
+
$isValidVisible?: boolean;
|
|
10
|
+
$isInvalidVisible?: boolean;
|
|
11
11
|
};
|
|
12
12
|
export declare const Extra: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, ExtraProps>> & string;
|
|
13
13
|
export declare const ExtraLeft: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<Omit<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "theme"> & ExtraProps, "ref"> & {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { type
|
|
1
|
+
import React, { type ReactNode } from "react";
|
|
2
2
|
export type TotaliserProps = {
|
|
3
3
|
/** financial total as a number */
|
|
4
4
|
total: number;
|
|
@@ -11,7 +11,7 @@ export type TotaliserProps = {
|
|
|
11
11
|
/** flag for low height compact appearance */
|
|
12
12
|
isCompact?: boolean;
|
|
13
13
|
/** component for custom summary message underneath total graph only visible if there is a target */
|
|
14
|
-
summaryMessage?:
|
|
14
|
+
summaryMessage?: ReactNode;
|
|
15
15
|
/** component children */
|
|
16
16
|
children?: ReactNode;
|
|
17
17
|
};
|
|
@@ -1,21 +1,27 @@
|
|
|
1
1
|
import { type ThemeType } from "../../types";
|
|
2
2
|
import ProgressBar from "../ProgressBar";
|
|
3
|
-
|
|
3
|
+
export declare const BubbleWrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
|
|
4
4
|
theme: ThemeType;
|
|
5
|
-
};
|
|
6
|
-
export declare const BubbleWrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, ThemeProps>> & string;
|
|
7
|
-
export declare const ProgressBarWrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, ThemeProps & {
|
|
8
|
-
isCompact?: boolean;
|
|
9
5
|
}>> & string;
|
|
10
|
-
export declare const
|
|
11
|
-
|
|
12
|
-
export declare const GiftAid: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>, ThemeProps>> & string;
|
|
13
|
-
export declare const Summary: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, ThemeProps>> & string;
|
|
14
|
-
type TotaliserWrapperProps = {
|
|
15
|
-
isCompact: boolean;
|
|
6
|
+
export declare const ProgressBarWrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
|
|
7
|
+
$isCompact?: boolean;
|
|
16
8
|
theme: ThemeType;
|
|
17
|
-
};
|
|
18
|
-
export declare const
|
|
9
|
+
}>> & string;
|
|
10
|
+
export declare const Total: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>, {
|
|
11
|
+
theme: ThemeType;
|
|
12
|
+
}>> & string;
|
|
13
|
+
export declare const BubbleText: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>, {
|
|
14
|
+
theme: ThemeType;
|
|
15
|
+
}>> & string;
|
|
16
|
+
export declare const GiftAid: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>, {
|
|
17
|
+
theme: ThemeType;
|
|
18
|
+
}>> & string;
|
|
19
|
+
export declare const Summary: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {
|
|
20
|
+
theme: ThemeType;
|
|
21
|
+
}>> & string;
|
|
22
|
+
export declare const TotaliserWrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
|
|
23
|
+
$isCompact: boolean;
|
|
24
|
+
theme: ThemeType;
|
|
25
|
+
}>> & string;
|
|
19
26
|
export declare const CompactWrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
20
27
|
export declare const StyledProgressBar: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("../ProgressBar").ProgressBarProps, never>> & string & Omit<typeof ProgressBar, keyof import("react").Component<any, {}, any>>;
|
|
21
|
-
export {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__rest as e,__assign as t}from"../../../node_modules/tslib/tslib.es6.js";import n,{forwardRef as r,useState as o,useRef as s,useCallback as a,useEffect as i}from"react";import{useTheme as l}from"styled-components";import{faChevronRight as c}from"../../../node_modules/@fortawesome/free-solid-svg-icons/index.js";import{useKey as d}from"../../hooks/useKey.js";import{debounce as u}from"../../utils/debounce.js";import{removeCommasFromObjectStringValues as m}from"../../utils/Helper.js";import{Text as f}from"../Text/index.js";import{TextField as p}from"../TextField/index.js";import{IconFa as h}from"../IconFa/index.js";import{crukTheme as g}from"../../themes/cruk.js";import{ScreenReaderOnly as v,ListWrapper as y,List as E,ListItem as w}from"./styles.js";var b=r((function(r,b){var x=r.apiKey,j=r.countries,I=r.errorMessage,T=r.hasError,V=r.isValid,k=r.isValidVisible,A=r.isInvalidVisible,C=r.label,K=r.hintText,D=r.onAddressError,F=void 0===D?function(e){console.log(e)}:D,S=r.onAddressSelected,M=r.onChange,_=r.onBlur,B=e(r,["apiKey","countries","errorMessage","hasError","isValid","isValidVisible","isInvalidVisible","label","hintText","onAddressError","onAddressSelected","onChange","onBlur"]),H=o([]),L=H[0],O=H[1],U=o(-1),q=U[0],R=U[1],W=s(null)
|
|
1
|
+
import{__rest as e,__assign as t}from"../../../node_modules/tslib/tslib.es6.js";import n,{forwardRef as r,useState as o,useRef as s,useCallback as a,useEffect as i}from"react";import{useTheme as l}from"styled-components";import{faChevronRight as c}from"../../../node_modules/@fortawesome/free-solid-svg-icons/index.js";import{useKey as d}from"../../hooks/useKey.js";import{debounce as u}from"../../utils/debounce.js";import{removeCommasFromObjectStringValues as m}from"../../utils/Helper.js";import{Text as f}from"../Text/index.js";import{TextField as p}from"../TextField/index.js";import{IconFa as h}from"../IconFa/index.js";import{crukTheme as g}from"../../themes/cruk.js";import{ScreenReaderOnly as v,ListWrapper as y,List as E,ListItem as w}from"./styles.js";var b=r((function(r,b){var x=r.apiKey,j=r.countries,I=r.errorMessage,T=r.hasError,V=r.isValid,k=r.isValidVisible,A=r.isInvalidVisible,C=r.label,K=r.hintText,D=r.onAddressError,F=void 0===D?function(e){console.log(e)}:D,S=r.onAddressSelected,M=r.onChange,_=r.onBlur,B=e(r,["apiKey","countries","errorMessage","hasError","isValid","isValidVisible","isInvalidVisible","label","hintText","onAddressError","onAddressSelected","onChange","onBlur"]),H=o([]),L=H[0],O=H[1],U=o(-1),q=U[0],R=U[1],W=s(null),$=l(),z=t(t({},g),$),G=function(){R(-1),O([])},J=a(u(500,(function(e){return N(e)})),[]),N=function(e,t){if(void 0===t&&(t=""),0===e.length)return O([]);var n="".concat("https://api.addressy.com/Capture/Interactive/Find/v1.1/json3.ws","?Key=").concat(x,"&Text=").concat(e,"&Container=").concat(t);return void 0!==j&&(n="".concat(n,"&Countries=").concat(j.join(","))),fetch(n).then((function(e){if(!e.ok)throw new Error("Something went wrong please try again");return e.json()})).then((function(e){if(e.Items[0].Error)throw new Error("Something went wrong please try again");return O(e.Items||[]),null})).catch((function(e){return F(e)})),null},P=function(e){fetch("".concat("https://api.addressy.com/Capture/Interactive/Retrieve/v1/json3.ws","?Key=").concat(x,"&Id=").concat(e)).then((function(e){if(!e.ok)throw new Error("Something went wrong please try again");return e.json()})).then((function(e){var t=e.Items[0],n=m(t);return S(n),G(),null})).catch((function(e){return F(e)}))},Q=function(e){return"Address"===e.Type?P(e.Id):(N(e.Text,e.Id),null)},X=function(e){W.current&&e.target instanceof HTMLElement&&!W.current.contains(e.target)&&G()};return i((function(){return document.addEventListener("mousedown",X),function(){document.removeEventListener("mousedown",X)}})),d((function(){G()}),{detectKeys:["Escape","Tab"]},[]),n.createElement(n.Fragment,null,n.createElement(p,t({"aria-activedescendant":L.length?"addressOptions-".concat(q):"","aria-owns":"found_addresses","aria-autocomplete":"both","aria-expanded":L.length?"true":"false",autoComplete:"off",hasError:T||!!I,errorMessage:I,hintText:null!=K?K:"Start typing your address or postcode",isValid:V,isValidVisible:k,isInvalidVisible:A,label:null!=C?C:"Home address",ref:b,required:!0,role:"combobox",type:"search"},B,{onKeyDown:function(e){"Enter"===e.key&&L[q]?(e.preventDefault(),"Address"===L[q].Type&&P(L[q].Id),N(L[q].Text,L[q].Id),R(-1)):"ArrowUp"===e.key?(e.preventDefault(),q<=-1&&R(L.length-1),R(q-1)):"ArrowDown"===e.key?(e.preventDefault(),q+1>=L.length&&R(0),R(q+1)):R(-1)},onChange:function(e){J(e.target.value),M&&M(e)},onBlur:function(e){var t=!!L.length;_&&!t&&_(e)}})),!!L.length&&n.createElement(n.Fragment,null,n.createElement(v,{role:"status","aria-live":"assertive"},!!L.length&&"We have found ".concat(L.length," result").concat(1!==L.length?"s":""," matching your search. Use up and down arrow keys to navigate")),n.createElement(y,{ref:W},n.createElement(E,{"aria-label":"found addresses",id:"found_addresses",role:"listbox",theme:z},L.map((function(e,t){return n.createElement(w,{tabIndex:0,id:"addressOptions-".concat(t),$isActive:t===q,key:e.Id,onClick:function(){Q(e)},onKeyDown:function(t){"Enter"===t.key&&Q(e)},role:"option","data-hj-suppress":!0,theme:z},n.createElement(f,{as:"span","data-hj-suppress":!0},e.Text," ",e.Description),"Address"!==e.Type&&n.createElement(n.Fragment,null,n.createElement(v,null,"press enter for these addresses"),n.createElement(h,{faIcon:c})))}))))))}));export{b as AddressLookup,b as default};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../src/components/AddressLookup/index.tsx"],"sourcesContent":["import React, {\n type InputHTMLAttributes,\n useCallback,\n useEffect,\n type Ref,\n useRef,\n forwardRef,\n type FocusEvent,\n type ChangeEvent,\n type KeyboardEvent,\n useState,\n type ReactNode,\n} from \"react\";\nimport { useTheme } from \"styled-components\";\nimport { faChevronRight } from \"@fortawesome/free-solid-svg-icons\";\n\nimport { type AddressDataType, type AddressOptionsType } from \"../../types\";\nimport { useKey } from \"../../hooks/useKey\";\n\nimport { debounce } from \"../../utils/debounce\";\nimport { removeCommasFromObjectStringValues } from \"../../utils/Helper\";\nimport { Text } from \"../Text\";\nimport { TextField } from \"../TextField\";\nimport { IconFa } from \"../IconFa\";\nimport { crukTheme as defaultTheme } from \"../../themes/cruk\";\n\nimport { ListWrapper, ListItem, ScreenReaderOnly, List } from \"./styles\";\n\nconst FIND_URL =\n \"https://api.addressy.com/Capture/Interactive/Find/v1.1/json3.ws\";\nconst RETRIEVE_URL =\n \"https://api.addressy.com/Capture/Interactive/Retrieve/v1/json3.ws\";\n\nexport type AddressLookupProps = InputHTMLAttributes<HTMLInputElement> & {\n /** api key for loqate */\n apiKey: string;\n /** list of countries codes you want the address look up to search within */\n countries?: string[];\n /** callback function which is passed the selected address data */\n onAddressSelected: (address: AddressDataType) => void;\n /** error message */\n errorMessage?: string;\n /** when true a input has a red border */\n hasError?: boolean;\n /** flag which effects the check or cross icons to the right of the input */\n isValid?: boolean;\n /** flag to hide or show the check icon when valid */\n isValidVisible?: boolean;\n /** flag to hide or show the cross icon when invalid */\n isInvalidVisible?: boolean;\n /** label text */\n label?: string;\n /** hint text text */\n hintText?: ReactNode;\n /** callback function which is passed the error */\n onAddressError?: (error: Error) => void;\n /** onBlur handler */\n onBlur?: (e: FocusEvent<HTMLInputElement>) => void;\n /** attach a DOM reference variable to your component */\n ref?: Ref<HTMLInputElement>;\n};\n\n/**\n * This component creates a combobox for a user to type in a post code or partial address and be presented with a of verified addresses.\n * We use Loqate (formerly Addressy and Postcode Anywhere) API v3, we have looked at v4 but it is more expensive without many benefits for our use case.\n * You will need a Loqate api key, the examples below use \"MG17-ZD93-FF33-KF13\" our development key.\n * This component is generally only used for country codes including \"GBR\", \"GGY\", \"IMN\", \"JEY\". An example of this behavior is included bellow.\n */\nexport const AddressLookup = forwardRef(\n (\n {\n apiKey,\n countries,\n errorMessage,\n hasError,\n isValid,\n isValidVisible,\n isInvalidVisible,\n label,\n hintText,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n onAddressError = (error: Error) => {\n console.log(error);\n },\n onAddressSelected,\n onChange,\n onBlur,\n ...props\n }: AddressLookupProps,\n ref?: Ref<HTMLInputElement>,\n ) => {\n const [addressOptions, setAddressOptions] = useState<AddressOptionsType[]>(\n [],\n );\n const [activeOption, setActiveOption] = useState(-1);\n const wrapperRef = useRef<HTMLDivElement>(null);\n const foundTheme = useTheme();\n const theme = {\n ...defaultTheme,\n ...foundTheme,\n };\n\n const clearOptions = () => {\n setActiveOption(-1);\n setAddressOptions([]);\n };\n\n const searchDebounced = useCallback(\n debounce(500, (query: string) => search(query)),\n [],\n );\n\n const search = (query: string, id = \"\") => {\n if (query.length === 0) return setAddressOptions([]);\n let searchUrl = `${FIND_URL}?Key=${apiKey}&Text=${query}&Container=${id}`;\n if (countries !== undefined) {\n searchUrl = `${searchUrl}&Countries=${countries.join(\",\")}`;\n }\n fetch(searchUrl)\n .then((res: Response) => {\n if (!res.ok) throw new Error(\"Something went wrong please try again\");\n return res.json();\n })\n .then((data: { Items: AddressOptionsType[] }) => {\n // Occasionally get the error \"The query didn't respond fast enough, it may be too complex.\"\n // returned with a 200 response. Example query \"n17 6t\"\n if (data.Items[0].Error)\n throw new Error(\"Something went wrong please try again\");\n setAddressOptions(data.Items || []);\n return null;\n })\n .catch((err) => onAddressError(err as Error));\n return null;\n };\n\n const getAddress = (id: string) => {\n fetch(`${RETRIEVE_URL}?Key=${apiKey}&Id=${id}`)\n .then((res: Response) => {\n if (!res.ok) throw new Error(\"Something went wrong please try again\");\n return res.json();\n })\n .then((data: { Items: AddressDataType[] }) => {\n const selectedAddress = data.Items[0];\n const selectedAddressWithoutCommas =\n removeCommasFromObjectStringValues<AddressDataType>(\n selectedAddress,\n );\n onAddressSelected(selectedAddressWithoutCommas);\n clearOptions();\n return null;\n })\n .catch((err) => onAddressError(err as Error));\n };\n\n const selectAddress = (address: AddressOptionsType) => {\n if (address.Type === \"Address\") return getAddress(address.Id);\n search(address.Text, address.Id);\n return null;\n };\n\n const handleKeyDown = (e: KeyboardEvent<HTMLInputElement>): void => {\n if (e.key === \"Enter\" && addressOptions[activeOption]) {\n e.preventDefault();\n if (addressOptions[activeOption].Type === \"Address\")\n getAddress(addressOptions[activeOption].Id);\n search(\n addressOptions[activeOption].Text,\n addressOptions[activeOption].Id,\n );\n setActiveOption(-1);\n } else if (e.key === \"ArrowUp\") {\n e.preventDefault();\n if (activeOption <= -1) setActiveOption(addressOptions.length - 1);\n setActiveOption(activeOption - 1);\n } else if (e.key === \"ArrowDown\") {\n e.preventDefault();\n if (activeOption + 1 >= addressOptions.length) setActiveOption(0);\n setActiveOption(activeOption + 1);\n } else {\n setActiveOption(-1);\n }\n };\n\n const handleChange = (e: ChangeEvent<HTMLInputElement>) => {\n searchDebounced(e.target.value);\n if (onChange) onChange(e);\n };\n\n const handleBlur = (e: FocusEvent<HTMLInputElement>) => {\n const isOptionsOpen = !!addressOptions.length;\n if (onBlur && !isOptionsOpen) onBlur(e);\n };\n\n const handleClickOutside = (event: MouseEvent) => {\n if (\n wrapperRef.current &&\n event.target instanceof HTMLElement &&\n !wrapperRef.current.contains(event.target)\n )\n clearOptions();\n };\n\n useEffect(() => {\n document.addEventListener(\"mousedown\", handleClickOutside);\n return () => {\n document.removeEventListener(\"mousedown\", handleClickOutside);\n };\n });\n\n useKey(\n () => {\n clearOptions();\n },\n {\n detectKeys: [\"Escape\", \"Tab\"],\n },\n [],\n );\n\n return (\n <>\n <TextField\n aria-activedescendant={\n addressOptions.length ? `addressOptions-${activeOption}` : \"\"\n }\n aria-owns=\"found_addresses\"\n aria-autocomplete=\"both\"\n aria-expanded={addressOptions.length ? \"true\" : \"false\"}\n autoComplete=\"off\"\n hasError={hasError || !!errorMessage}\n errorMessage={errorMessage}\n hintText={hintText ?? \"Start typing your address or postcode\"}\n isValid={isValid}\n isValidVisible={isValidVisible}\n isInvalidVisible={isInvalidVisible}\n label={label ?? \"Home address\"}\n ref={ref}\n required\n role=\"combobox\"\n type=\"search\"\n {...props}\n onKeyDown={handleKeyDown}\n onChange={handleChange}\n onBlur={handleBlur}\n />\n\n {!!addressOptions.length && (\n <>\n <ScreenReaderOnly role=\"status\" aria-live=\"assertive\">\n {!!addressOptions.length &&\n `We have found ${addressOptions.length} result${\n addressOptions.length !== 1 ? \"s\" : \"\"\n } matching your search. Use up and down arrow keys to navigate`}\n </ScreenReaderOnly>\n <ListWrapper ref={wrapperRef}>\n <List\n aria-label=\"found addresses\"\n id=\"found_addresses\"\n role=\"listbox\"\n theme={theme}\n >\n {addressOptions.map((address, index) => (\n <ListItem\n tabIndex={0}\n id={`addressOptions-${index}`}\n isActive={index === activeOption}\n key={address.Id}\n onClick={() => {\n selectAddress(address);\n }}\n onKeyDown={(e) => {\n if (e.key === \"Enter\") {\n selectAddress(address);\n }\n }}\n role=\"option\"\n data-hj-suppress\n theme={theme}\n >\n <Text as=\"span\" data-hj-suppress>\n {address.Text} {address.Description}\n </Text>\n {address.Type !== \"Address\" && (\n <>\n <ScreenReaderOnly>\n press enter for these addresses\n </ScreenReaderOnly>\n <IconFa faIcon={faChevronRight} />\n </>\n )}\n </ListItem>\n ))}\n </List>\n </ListWrapper>\n </>\n )}\n </>\n );\n },\n);\n\nexport default AddressLookup;\n"],"names":["AddressLookup","forwardRef","_a","ref","apiKey","countries","errorMessage","hasError","isValid","isValidVisible","isInvalidVisible","label","hintText","_b","onAddressError","error","console","log","onAddressSelected","onChange","onBlur","props","__rest","_c","useState","addressOptions","setAddressOptions","_d","activeOption","setActiveOption","wrapperRef","useRef","foundTheme","useTheme","theme","__assign","defaultTheme","clearOptions","searchDebounced","useCallback","debounce","query","search","id","length","searchUrl","concat","undefined","join","fetch","then","res","ok","Error","json","data","Items","catch","err","getAddress","selectedAddress","selectedAddressWithoutCommas","removeCommasFromObjectStringValues","selectAddress","address","Type","Id","Text","handleClickOutside","event","current","target","HTMLElement","contains","useEffect","document","addEventListener","removeEventListener","useKey","detectKeys","React","createElement","Fragment","TextField","autoComplete","required","role","type","onKeyDown","e","key","preventDefault","value","isOptionsOpen","ScreenReaderOnly","ListWrapper","List","map","index","ListItem","tabIndex","isActive","onClick","as","Description","IconFa","faIcon","faChevronRight"],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/components/AddressLookup/index.tsx"],"sourcesContent":["import React, {\n type InputHTMLAttributes,\n useCallback,\n useEffect,\n type Ref,\n useRef,\n forwardRef,\n type FocusEvent,\n type ChangeEvent,\n type KeyboardEvent,\n useState,\n type ReactNode,\n} from \"react\";\nimport { useTheme } from \"styled-components\";\nimport { faChevronRight } from \"@fortawesome/free-solid-svg-icons\";\n\nimport { type AddressDataType, type AddressOptionsType } from \"../../types\";\nimport { useKey } from \"../../hooks/useKey\";\n\nimport { debounce } from \"../../utils/debounce\";\nimport { removeCommasFromObjectStringValues } from \"../../utils/Helper\";\nimport { Text } from \"../Text\";\nimport { TextField } from \"../TextField\";\nimport { IconFa } from \"../IconFa\";\nimport { crukTheme as defaultTheme } from \"../../themes/cruk\";\n\nimport { ListWrapper, ListItem, ScreenReaderOnly, List } from \"./styles\";\n\nconst FIND_URL =\n \"https://api.addressy.com/Capture/Interactive/Find/v1.1/json3.ws\";\nconst RETRIEVE_URL =\n \"https://api.addressy.com/Capture/Interactive/Retrieve/v1/json3.ws\";\n\nexport type AddressLookupProps = InputHTMLAttributes<HTMLInputElement> & {\n /** api key for loqate */\n apiKey: string;\n /** list of countries codes you want the address look up to search within */\n countries?: string[];\n /** callback function which is passed the selected address data */\n onAddressSelected: (address: AddressDataType) => void;\n /** error message */\n errorMessage?: string;\n /** when true a input has a red border */\n hasError?: boolean;\n /** flag which effects the check or cross icons to the right of the input */\n isValid?: boolean;\n /** flag to hide or show the check icon when valid */\n isValidVisible?: boolean;\n /** flag to hide or show the cross icon when invalid */\n isInvalidVisible?: boolean;\n /** label text */\n label?: string;\n /** hint text text */\n hintText?: ReactNode;\n /** callback function which is passed the error */\n onAddressError?: (error: Error) => void;\n /** onBlur handler */\n onBlur?: (e: FocusEvent<HTMLInputElement>) => void;\n /** attach a DOM reference variable to your component */\n ref?: Ref<HTMLInputElement>;\n};\n\n/**\n * This component creates a combobox for a user to type in a post code or partial address and be presented with a of verified addresses.\n * We use Loqate (formerly Addressy and Postcode Anywhere) API v3, we have looked at v4 but it is more expensive without many benefits for our use case.\n * You will need a Loqate api key, the examples below use \"MG17-ZD93-FF33-KF13\" our development key.\n * This component is generally only used for country codes including \"GBR\", \"GGY\", \"IMN\", \"JEY\". An example of this behavior is included bellow.\n */\nexport const AddressLookup = forwardRef(\n (\n {\n apiKey,\n countries,\n errorMessage,\n hasError,\n isValid,\n isValidVisible,\n isInvalidVisible,\n label,\n hintText,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n onAddressError = (error: Error) => {\n console.log(error);\n },\n onAddressSelected,\n onChange,\n onBlur,\n ...props\n }: AddressLookupProps,\n ref?: Ref<HTMLInputElement>,\n ) => {\n const [addressOptions, setAddressOptions] = useState<AddressOptionsType[]>(\n [],\n );\n const [activeOption, setActiveOption] = useState(-1);\n const wrapperRef = useRef<HTMLDivElement>(null);\n const foundTheme = useTheme();\n const theme = {\n ...defaultTheme,\n ...foundTheme,\n };\n\n const clearOptions = () => {\n setActiveOption(-1);\n setAddressOptions([]);\n };\n\n const searchDebounced = useCallback(\n debounce(500, (query: string) => search(query)),\n [],\n );\n\n const search = (query: string, id = \"\") => {\n if (query.length === 0) return setAddressOptions([]);\n let searchUrl = `${FIND_URL}?Key=${apiKey}&Text=${query}&Container=${id}`;\n if (countries !== undefined) {\n searchUrl = `${searchUrl}&Countries=${countries.join(\",\")}`;\n }\n fetch(searchUrl)\n .then((res: Response) => {\n if (!res.ok) throw new Error(\"Something went wrong please try again\");\n return res.json();\n })\n .then((data: { Items: AddressOptionsType[] }) => {\n // Occasionally get the error \"The query didn't respond fast enough, it may be too complex.\"\n // returned with a 200 response. Example query \"n17 6t\"\n if (data.Items[0].Error)\n throw new Error(\"Something went wrong please try again\");\n setAddressOptions(data.Items || []);\n return null;\n })\n .catch((err) => onAddressError(err as Error));\n return null;\n };\n\n const getAddress = (id: string) => {\n fetch(`${RETRIEVE_URL}?Key=${apiKey}&Id=${id}`)\n .then((res: Response) => {\n if (!res.ok) throw new Error(\"Something went wrong please try again\");\n return res.json();\n })\n .then((data: { Items: AddressDataType[] }) => {\n const selectedAddress = data.Items[0];\n const selectedAddressWithoutCommas =\n removeCommasFromObjectStringValues<AddressDataType>(\n selectedAddress,\n );\n onAddressSelected(selectedAddressWithoutCommas);\n clearOptions();\n return null;\n })\n .catch((err) => onAddressError(err as Error));\n };\n\n const selectAddress = (address: AddressOptionsType) => {\n if (address.Type === \"Address\") return getAddress(address.Id);\n search(address.Text, address.Id);\n return null;\n };\n\n const handleKeyDown = (e: KeyboardEvent<HTMLInputElement>): void => {\n if (e.key === \"Enter\" && addressOptions[activeOption]) {\n e.preventDefault();\n if (addressOptions[activeOption].Type === \"Address\")\n getAddress(addressOptions[activeOption].Id);\n search(\n addressOptions[activeOption].Text,\n addressOptions[activeOption].Id,\n );\n setActiveOption(-1);\n } else if (e.key === \"ArrowUp\") {\n e.preventDefault();\n if (activeOption <= -1) setActiveOption(addressOptions.length - 1);\n setActiveOption(activeOption - 1);\n } else if (e.key === \"ArrowDown\") {\n e.preventDefault();\n if (activeOption + 1 >= addressOptions.length) setActiveOption(0);\n setActiveOption(activeOption + 1);\n } else {\n setActiveOption(-1);\n }\n };\n\n const handleChange = (e: ChangeEvent<HTMLInputElement>) => {\n searchDebounced(e.target.value);\n if (onChange) onChange(e);\n };\n\n const handleBlur = (e: FocusEvent<HTMLInputElement>) => {\n const isOptionsOpen = !!addressOptions.length;\n if (onBlur && !isOptionsOpen) onBlur(e);\n };\n\n const handleClickOutside = (event: MouseEvent) => {\n if (\n wrapperRef.current &&\n event.target instanceof HTMLElement &&\n !wrapperRef.current.contains(event.target)\n )\n clearOptions();\n };\n\n useEffect(() => {\n document.addEventListener(\"mousedown\", handleClickOutside);\n return () => {\n document.removeEventListener(\"mousedown\", handleClickOutside);\n };\n });\n\n useKey(\n () => {\n clearOptions();\n },\n {\n detectKeys: [\"Escape\", \"Tab\"],\n },\n [],\n );\n\n return (\n <>\n <TextField\n aria-activedescendant={\n addressOptions.length ? `addressOptions-${activeOption}` : \"\"\n }\n aria-owns=\"found_addresses\"\n aria-autocomplete=\"both\"\n aria-expanded={addressOptions.length ? \"true\" : \"false\"}\n autoComplete=\"off\"\n hasError={hasError || !!errorMessage}\n errorMessage={errorMessage}\n hintText={hintText ?? \"Start typing your address or postcode\"}\n isValid={isValid}\n isValidVisible={isValidVisible}\n isInvalidVisible={isInvalidVisible}\n label={label ?? \"Home address\"}\n ref={ref}\n required\n role=\"combobox\"\n type=\"search\"\n {...props}\n onKeyDown={handleKeyDown}\n onChange={handleChange}\n onBlur={handleBlur}\n />\n\n {!!addressOptions.length && (\n <>\n <ScreenReaderOnly role=\"status\" aria-live=\"assertive\">\n {!!addressOptions.length &&\n `We have found ${addressOptions.length} result${\n addressOptions.length !== 1 ? \"s\" : \"\"\n } matching your search. Use up and down arrow keys to navigate`}\n </ScreenReaderOnly>\n <ListWrapper ref={wrapperRef}>\n <List\n aria-label=\"found addresses\"\n id=\"found_addresses\"\n role=\"listbox\"\n theme={theme}\n >\n {addressOptions.map((address, index) => (\n <ListItem\n tabIndex={0}\n id={`addressOptions-${index}`}\n $isActive={index === activeOption}\n key={address.Id}\n onClick={() => {\n selectAddress(address);\n }}\n onKeyDown={(e) => {\n if (e.key === \"Enter\") {\n selectAddress(address);\n }\n }}\n role=\"option\"\n data-hj-suppress\n theme={theme}\n >\n <Text as=\"span\" data-hj-suppress>\n {address.Text} {address.Description}\n </Text>\n {address.Type !== \"Address\" && (\n <>\n <ScreenReaderOnly>\n press enter for these addresses\n </ScreenReaderOnly>\n <IconFa faIcon={faChevronRight} />\n </>\n )}\n </ListItem>\n ))}\n </List>\n </ListWrapper>\n </>\n )}\n </>\n );\n },\n);\n\nexport default AddressLookup;\n"],"names":["AddressLookup","forwardRef","_a","ref","apiKey","countries","errorMessage","hasError","isValid","isValidVisible","isInvalidVisible","label","hintText","_b","onAddressError","error","console","log","onAddressSelected","onChange","onBlur","props","__rest","_c","useState","addressOptions","setAddressOptions","_d","activeOption","setActiveOption","wrapperRef","useRef","foundTheme","useTheme","theme","__assign","defaultTheme","clearOptions","searchDebounced","useCallback","debounce","query","search","id","length","searchUrl","concat","undefined","join","fetch","then","res","ok","Error","json","data","Items","catch","err","getAddress","selectedAddress","selectedAddressWithoutCommas","removeCommasFromObjectStringValues","selectAddress","address","Type","Id","Text","handleClickOutside","event","current","target","HTMLElement","contains","useEffect","document","addEventListener","removeEventListener","useKey","detectKeys","React","createElement","Fragment","TextField","autoComplete","required","role","type","onKeyDown","e","key","preventDefault","value","isOptionsOpen","ScreenReaderOnly","ListWrapper","List","map","index","ListItem","tabIndex","onClick","as","Description","IconFa","faIcon","faChevronRight"],"mappings":"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"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__makeTemplateObject as n}from"../../../node_modules/tslib/tslib.es6.js";import o from"styled-components";var i,r,e,t,p=o.div(i||(i=n(["\n position: relative;\n"],["\n position: relative;\n"]))),d=o.ul(r||(r=n(["\n background-color: ",";\n border-radius: 3px;\n border: 2px solid #ccc;\n box-shadow: 0px 6px 12px rgba(0, 0, 0, 0.2);\n list-style: none;\n margin-top: 0;\n max-height: 400px;\n overflow-y: auto;\n padding: 0;\n position: absolute;\n width: 100%;\n z-index: 999;\n"],["\n background-color: ",";\n border-radius: 3px;\n border: 2px solid #ccc;\n box-shadow: 0px 6px 12px rgba(0, 0, 0, 0.2);\n list-style: none;\n margin-top: 0;\n max-height: 400px;\n overflow-y: auto;\n padding: 0;\n position: absolute;\n width: 100%;\n z-index: 999;\n"])),(function(n){return n.theme.colors.backgroundLight})),a=o.li(e||(e=n(["\n align-items: center;\n background-color: ",";\n cursor: pointer;\n display: flex;\n justify-content: space-between;\n padding: 5px;\n &:hover,\n &:focus {\n background-color: #ddd;\n }\n"],["\n align-items: center;\n background-color: ",";\n cursor: pointer;\n display: flex;\n justify-content: space-between;\n padding: 5px;\n &:hover,\n &:focus {\n background-color: #ddd;\n }\n"])),(function(n){var o=n.theme;return n
|
|
1
|
+
import{__makeTemplateObject as n}from"../../../node_modules/tslib/tslib.es6.js";import o from"styled-components";var i,r,e,t,p=o.div(i||(i=n(["\n position: relative;\n"],["\n position: relative;\n"]))),d=o.ul(r||(r=n(["\n background-color: ",";\n border-radius: 3px;\n border: 2px solid #ccc;\n box-shadow: 0px 6px 12px rgba(0, 0, 0, 0.2);\n list-style: none;\n margin-top: 0;\n max-height: 400px;\n overflow-y: auto;\n padding: 0;\n position: absolute;\n width: 100%;\n z-index: 999;\n"],["\n background-color: ",";\n border-radius: 3px;\n border: 2px solid #ccc;\n box-shadow: 0px 6px 12px rgba(0, 0, 0, 0.2);\n list-style: none;\n margin-top: 0;\n max-height: 400px;\n overflow-y: auto;\n padding: 0;\n position: absolute;\n width: 100%;\n z-index: 999;\n"])),(function(n){return n.theme.colors.backgroundLight})),a=o.li(e||(e=n(["\n align-items: center;\n background-color: ",";\n cursor: pointer;\n display: flex;\n justify-content: space-between;\n padding: 5px;\n &:hover,\n &:focus {\n background-color: #ddd;\n }\n"],["\n align-items: center;\n background-color: ",";\n cursor: pointer;\n display: flex;\n justify-content: space-between;\n padding: 5px;\n &:hover,\n &:focus {\n background-color: #ddd;\n }\n"])),(function(n){var o=n.theme;return n.$isActive?o.colors.backgroundMid:o.colors.backgroundLight})),s=o.div(t||(t=n(["\n border: 0px;\n clip: rect(0px, 0px, 0px, 0px);\n height: 1px;\n margin-bottom: -1px;\n margin-right: -1px;\n overflow: hidden;\n padding: 0px;\n position: absolute;\n white-space: nowrap;\n width: 1px;\n"],["\n border: 0px;\n clip: rect(0px, 0px, 0px, 0px);\n height: 1px;\n margin-bottom: -1px;\n margin-right: -1px;\n overflow: hidden;\n padding: 0px;\n position: absolute;\n white-space: nowrap;\n width: 1px;\n"])));export{d as List,a as ListItem,p as ListWrapper,s as ScreenReaderOnly};
|
|
2
2
|
//# sourceMappingURL=styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.js","sources":["../../../../src/components/AddressLookup/styles.ts"],"sourcesContent":["import styled from \"styled-components\";\nimport { type ThemeType } from \"../../types\";\n\ninterface ListWrapperProps extends React.HTMLProps<HTMLDivElement> {\n tabIndex?: number;\n}\n\ntype ListProps = {\n theme: ThemeType;\n isActive?: boolean;\n};\n\nexport const ListWrapper = styled.div<ListWrapperProps>`\n position: relative;\n`;\n\nexport const List = styled.ul<\n ListProps & { ref?: React.Ref<HTMLUListElement> }\n>`\n background-color: ${({ theme }) => theme.colors.backgroundLight};\n border-radius: 3px;\n border: 2px solid #ccc;\n box-shadow: 0px 6px 12px rgba(0, 0, 0, 0.2);\n list-style: none;\n margin-top: 0;\n max-height: 400px;\n overflow-y: auto;\n padding: 0;\n position: absolute;\n width: 100%;\n z-index: 999;\n`;\n\nexport const ListItem = styled.li<\n ListProps & {\n ref?: React.Ref<HTMLLIElement>;\n }\n>`\n align-items: center;\n background-color: ${({ theme, isActive }: ListProps) =>\n isActive ? theme.colors.backgroundMid : theme.colors.backgroundLight};\n cursor: pointer;\n display: flex;\n justify-content: space-between;\n padding: 5px;\n &:hover,\n &:focus {\n background-color: #ddd;\n }\n`;\n\n// TODO move to its own component\nexport const ScreenReaderOnly = styled.div`\n border: 0px;\n clip: rect(0px, 0px, 0px, 0px);\n height: 1px;\n margin-bottom: -1px;\n margin-right: -1px;\n overflow: hidden;\n padding: 0px;\n position: absolute;\n white-space: nowrap;\n width: 1px;\n`;\n"],"names":["ListWrapper","styled","div","templateObject_1","__makeTemplateObject","List","ul","templateObject_2","_a","theme","colors","backgroundLight","ListItem","li","templateObject_3","isActive","backgroundMid","ScreenReaderOnly","templateObject_4"],"mappings":"iHAYa,YAAAA,EAAcC,EAAOC,IAAGC,IAAAA,EAAAC,EAAA,CAAA,6BAAA,CAAkB,gCAI1CC,EAAOJ,EAAOK,GAAEC,IAAAA,EAAAH,EAAA,CAAA,yBAAA,kQAAA,CAE5B,yBACgE,qQAA3C,SAACI,GAAc,OAAPA,EAAAC,MAAaC,OAAOC,eAAb,IAcxBC,EAAWX,EAAOY,GAAEC,IAAAA,EAAAV,EAAA,CAAA,iDAAA,4JAAA,CAIhC,
|
|
1
|
+
{"version":3,"file":"styles.js","sources":["../../../../src/components/AddressLookup/styles.ts"],"sourcesContent":["import styled from \"styled-components\";\nimport { type ThemeType } from \"../../types\";\n\ninterface ListWrapperProps extends React.HTMLProps<HTMLDivElement> {\n tabIndex?: number;\n}\n\ntype ListProps = {\n theme: ThemeType;\n $isActive?: boolean;\n};\n\nexport const ListWrapper = styled.div<ListWrapperProps>`\n position: relative;\n`;\n\nexport const List = styled.ul<\n ListProps & { ref?: React.Ref<HTMLUListElement> }\n>`\n background-color: ${({ theme }) => theme.colors.backgroundLight};\n border-radius: 3px;\n border: 2px solid #ccc;\n box-shadow: 0px 6px 12px rgba(0, 0, 0, 0.2);\n list-style: none;\n margin-top: 0;\n max-height: 400px;\n overflow-y: auto;\n padding: 0;\n position: absolute;\n width: 100%;\n z-index: 999;\n`;\n\nexport const ListItem = styled.li<\n ListProps & {\n ref?: React.Ref<HTMLLIElement>;\n }\n>`\n align-items: center;\n background-color: ${({ theme, $isActive }: ListProps) =>\n $isActive ? theme.colors.backgroundMid : theme.colors.backgroundLight};\n cursor: pointer;\n display: flex;\n justify-content: space-between;\n padding: 5px;\n &:hover,\n &:focus {\n background-color: #ddd;\n }\n`;\n\n// TODO move to its own component\nexport const ScreenReaderOnly = styled.div`\n border: 0px;\n clip: rect(0px, 0px, 0px, 0px);\n height: 1px;\n margin-bottom: -1px;\n margin-right: -1px;\n overflow: hidden;\n padding: 0px;\n position: absolute;\n white-space: nowrap;\n width: 1px;\n`;\n"],"names":["ListWrapper","styled","div","templateObject_1","__makeTemplateObject","List","ul","templateObject_2","_a","theme","colors","backgroundLight","ListItem","li","templateObject_3","$isActive","backgroundMid","ScreenReaderOnly","templateObject_4"],"mappings":"iHAYa,YAAAA,EAAcC,EAAOC,IAAGC,IAAAA,EAAAC,EAAA,CAAA,6BAAA,CAAkB,gCAI1CC,EAAOJ,EAAOK,GAAEC,IAAAA,EAAAH,EAAA,CAAA,yBAAA,kQAAA,CAE5B,yBACgE,qQAA3C,SAACI,GAAc,OAAPA,EAAAC,MAAaC,OAAOC,eAAb,IAcxBC,EAAWX,EAAOY,GAAEC,IAAAA,EAAAV,EAAA,CAAA,iDAAA,4JAAA,CAIhC,iDAGwE,+JADnD,SAACI,OAAEC,EAAKD,EAAAC,MAC1B,OADqCD,EAAAO,UACzBN,EAAMC,OAAOM,cAAgBP,EAAMC,OAAOC,eAAtD,IAYSM,EAAmBhB,EAAOC,IAAGgB,IAAAA,EAAAd,EAAA,CAAA,4NAAA,CAAA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__rest as t,__assign as r}from"../../../node_modules/tslib/tslib.es6.js";import o from"react";import{useTheme as a}from"styled-components";import{crukTheme as e}from"../../themes/cruk.js";import{StyledAvatar as n}from"./styles.js";function m(m){var i=m.url,s=m.name,c=m.size,p=void 0===c?"m":c,l=m.alt,u=void 0===l?"":l,f=t(m,["url","name","size","alt"]),v=a(),d=r(r({},e),v);return o.createElement(n,r({},f,{size:d.avatar[p||"m"],src:function(){if(i)return i;var t=s&&"string"==typeof s&&"Anonymous"!==s&&/[a-z]/i.exec(s[0].trim())?"icon-avatar-".concat(s[0].trim().toUpperCase(),".png"):"icon-avatar-Anonymous.png";return"".concat(d.avatar.path).concat(t)}(),alt:u}))}export{m as Avatar,m as default};
|
|
1
|
+
import{__rest as t,__assign as r}from"../../../node_modules/tslib/tslib.es6.js";import o from"react";import{useTheme as a}from"styled-components";import{crukTheme as e}from"../../themes/cruk.js";import{StyledAvatar as n}from"./styles.js";function m(m){var i=m.url,s=m.name,c=m.size,p=void 0===c?"m":c,l=m.alt,u=void 0===l?"":l,f=t(m,["url","name","size","alt"]),v=a(),d=r(r({},e),v);return o.createElement(n,r({},f,{$size:d.avatar[p||"m"],src:function(){if(i)return i;var t=s&&"string"==typeof s&&"Anonymous"!==s&&/[a-z]/i.exec(s[0].trim())?"icon-avatar-".concat(s[0].trim().toUpperCase(),".png"):"icon-avatar-Anonymous.png";return"".concat(d.avatar.path).concat(t)}(),alt:u}))}export{m as Avatar,m as default};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../src/components/Avatar/index.tsx"],"sourcesContent":["import React, { type ImgHTMLAttributes } from \"react\";\nimport { useTheme } from \"styled-components\";\n\nimport { crukTheme as defaultTheme } from \"../../themes/cruk\";\n\nimport { StyledAvatar } from \"./styles\";\n\nexport type AvatarProps = ImgHTMLAttributes<HTMLElement> & {\n /** name of user/entity */\n name?: string;\n /** image url */\n url?: string;\n /** image size */\n size?: \"s\" | \"m\" | \"l\" | \"xl\";\n};\n\n/**\n *\n * You can use an avatar to display ownership of an item of content. If you pass a URL of an image that will be displayed otherwise the first letter of the name will be used to display a branded avatar.\n */\nexport function Avatar({\n url,\n name,\n size = \"m\",\n alt = \"\",\n ...rest\n}: AvatarProps) {\n const foundTheme = useTheme();\n const theme = {\n ...defaultTheme,\n ...foundTheme,\n };\n\n const avatarUrl = () => {\n if (url) return url;\n const fileName =\n name &&\n typeof name === \"string\" &&\n name !== \"Anonymous\" &&\n /[a-z]/i.exec(name[0].trim())\n ? `icon-avatar-${name[0].trim().toUpperCase()}.png`\n : \"icon-avatar-Anonymous.png\";\n\n return `${theme.avatar.path}${fileName}`;\n };\n\n return (\n <StyledAvatar\n {...rest}\n size={theme.avatar[size || \"m\"]}\n src={avatarUrl()}\n alt={alt}\n />\n );\n}\n\nexport default Avatar;\n"],"names":["Avatar","_a","url","name","_b","size","_c","alt","rest","__rest","foundTheme","useTheme","theme","__assign","defaultTheme","React","createElement","StyledAvatar","avatar","src","fileName","exec","trim","concat","toUpperCase","path","avatarUrl"],"mappings":"8OAoBM,SAAUA,EAAOC,GACrB,IAAAC,QACAC,SACAC,EAAAH,EAAAI,KAAAA,OAAO,IAAAD,EAAA,MACPE,EAAAL,EAAAM,IAAAA,OAAM,IAAAD,EAAA,KACHE,EALkBC,EAAAR,EAAA,CAAA,MAAA,OAAA,OAAA,QAOfS,EAAaC,IACbC,EACDC,EAAAA,EAAA,CAAA,EAAAC,GACAJ,GAgBL,OACEK,EAACC,cAAAC,EACKJ,EAAA,CAAA,EAAAL,
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/components/Avatar/index.tsx"],"sourcesContent":["import React, { type ImgHTMLAttributes } from \"react\";\nimport { useTheme } from \"styled-components\";\n\nimport { crukTheme as defaultTheme } from \"../../themes/cruk\";\n\nimport { StyledAvatar } from \"./styles\";\n\nexport type AvatarProps = ImgHTMLAttributes<HTMLElement> & {\n /** name of user/entity */\n name?: string;\n /** image url */\n url?: string;\n /** image size */\n size?: \"s\" | \"m\" | \"l\" | \"xl\";\n};\n\n/**\n *\n * You can use an avatar to display ownership of an item of content. If you pass a URL of an image that will be displayed otherwise the first letter of the name will be used to display a branded avatar.\n */\nexport function Avatar({\n url,\n name,\n size = \"m\",\n alt = \"\",\n ...rest\n}: AvatarProps) {\n const foundTheme = useTheme();\n const theme = {\n ...defaultTheme,\n ...foundTheme,\n };\n\n const avatarUrl = () => {\n if (url) return url;\n const fileName =\n name &&\n typeof name === \"string\" &&\n name !== \"Anonymous\" &&\n /[a-z]/i.exec(name[0].trim())\n ? `icon-avatar-${name[0].trim().toUpperCase()}.png`\n : \"icon-avatar-Anonymous.png\";\n\n return `${theme.avatar.path}${fileName}`;\n };\n\n return (\n <StyledAvatar\n {...rest}\n $size={theme.avatar[size || \"m\"]}\n src={avatarUrl()}\n alt={alt}\n />\n );\n}\n\nexport default Avatar;\n"],"names":["Avatar","_a","url","name","_b","size","_c","alt","rest","__rest","foundTheme","useTheme","theme","__assign","defaultTheme","React","createElement","StyledAvatar","avatar","src","fileName","exec","trim","concat","toUpperCase","path","avatarUrl"],"mappings":"8OAoBM,SAAUA,EAAOC,GACrB,IAAAC,QACAC,SACAC,EAAAH,EAAAI,KAAAA,OAAO,IAAAD,EAAA,MACPE,EAAAL,EAAAM,IAAAA,OAAM,IAAAD,EAAA,KACHE,EALkBC,EAAAR,EAAA,CAAA,MAAA,OAAA,OAAA,QAOfS,EAAaC,IACbC,EACDC,EAAAA,EAAA,CAAA,EAAAC,GACAJ,GAgBL,OACEK,EAACC,cAAAC,EACKJ,EAAA,CAAA,EAAAL,SACGI,EAAMM,OAAOb,GAAQ,KAC5Bc,IAjBc,WAChB,GAAIjB,EAAK,OAAOA,EAChB,IAAMkB,EACJjB,GACgB,iBAATA,GACE,cAATA,GACA,SAASkB,KAAKlB,EAAK,GAAGmB,QAClB,eAAAC,OAAepB,EAAK,GAAGmB,OAAOE,cAAmB,QACjD,4BAEN,MAAO,GAAAD,OAAGX,EAAMM,OAAOO,MAAIF,OAAGH,EAChC,CAMSM,GACLnB,IAAKA,IAGX"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__makeTemplateObject as r}from"../../../node_modules/tslib/tslib.es6.js";import o from"styled-components";var e,n=o.img(e||(e=r(["\n box-sizing: border-box;\n border-radius: 50%;\n height: ",";\n object-fit: cover;\n width: ",";\n border-style: solid;\n border-width: 2px;\n border-color: ",";\n"],["\n box-sizing: border-box;\n border-radius: 50%;\n height: ",";\n object-fit: cover;\n width: ",";\n border-style: solid;\n border-width: 2px;\n border-color: ",";\n"])),(function(r){return r
|
|
1
|
+
import{__makeTemplateObject as r}from"../../../node_modules/tslib/tslib.es6.js";import o from"styled-components";var e,n=o.img(e||(e=r(["\n box-sizing: border-box;\n border-radius: 50%;\n height: ",";\n object-fit: cover;\n width: ",";\n border-style: solid;\n border-width: 2px;\n border-color: ",";\n"],["\n box-sizing: border-box;\n border-radius: 50%;\n height: ",";\n object-fit: cover;\n width: ",";\n border-style: solid;\n border-width: 2px;\n border-color: ",";\n"])),(function(r){return r.$size}),(function(r){return r.$size}),(function(r){return r.theme.colors.avatarBorder}));export{n as StyledAvatar,n as default};
|
|
2
2
|
//# sourceMappingURL=styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.js","sources":["../../../../src/components/Avatar/styles.ts"],"sourcesContent":["import styled from \"styled-components\";\nimport { type ThemeType } from \"../../types\";\n\ntype AvatarStyledProps = {\n size?: string;\n theme: ThemeType;\n};\n\nexport const StyledAvatar = styled.img<AvatarStyledProps>`\n box-sizing: border-box;\n border-radius: 50%;\n height: ${({ size }) => size};\n object-fit: cover;\n width: ${({ size }) => size};\n border-style: solid;\n border-width: 2px;\n border-color: ${({ theme }: AvatarStyledProps) => theme.colors.avatarBorder};\n`;\n\nexport default StyledAvatar;\n"],"names":["StyledAvatar","styled","img","templateObject_1","__makeTemplateObject","_a","size","theme","colors","avatarBorder"],"mappings":"iHAQa,MAAAA,EAAeC,EAAOC,IAAGC,IAAAA,EAAAC,EAAA,CAAA,iEAAA,qCAAA,oEAAA,OAAA,CAAmB,
|
|
1
|
+
{"version":3,"file":"styles.js","sources":["../../../../src/components/Avatar/styles.ts"],"sourcesContent":["import styled from \"styled-components\";\nimport { type ThemeType } from \"../../types\";\n\ntype AvatarStyledProps = {\n $size?: string;\n theme: ThemeType;\n};\n\nexport const StyledAvatar = styled.img<AvatarStyledProps>`\n box-sizing: border-box;\n border-radius: 50%;\n height: ${({ $size }) => $size};\n object-fit: cover;\n width: ${({ $size }) => $size};\n border-style: solid;\n border-width: 2px;\n border-color: ${({ theme }: AvatarStyledProps) => theme.colors.avatarBorder};\n`;\n\nexport default StyledAvatar;\n"],"names":["StyledAvatar","styled","img","templateObject_1","__makeTemplateObject","_a","$size","theme","colors","avatarBorder"],"mappings":"iHAQa,MAAAA,EAAeC,EAAOC,IAAGC,IAAAA,EAAAC,EAAA,CAAA,iEAAA,qCAAA,oEAAA,OAAA,CAAmB,iEAGzB,qCAED,oEAG8C,UALjE,SAACC,GAAc,OAAPA,EAAAC,KAAO,IAEhB,SAACD,GAAc,OAAPA,EAAAC,KAAO,IAGR,SAACD,GAAiC,OAA1BA,EAAAE,MAAgCC,OAAOC,YAAb"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__rest as
|
|
1
|
+
import{__rest as o,__assign as r}from"../../../node_modules/tslib/tslib.es6.js";import e from"react";import{useTheme as t}from"styled-components";import{crukTheme as s}from"../../themes/cruk.js";import{StyledBadge as l}from"./styles.js";function i(i){var m=i.children,d=i.size,n=void 0===d?"xs":d,c=i.backgroundColor,C=i.borderColor,a=i.textColor,b=o(i,["children","size","backgroundColor","borderColor","textColor"]),f=t(),p=r(r({},s),f);return e.createElement(l,r({theme:p,$isText:"string"==typeof m,$size:n,$backgroundColor:c,$borderColor:C,$textColor:a},b),m)}export{i as Badge,i as default};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../src/components/Badge/index.tsx"],"sourcesContent":["import React, { type ReactNode } from \"react\";\nimport { useTheme } from \"styled-components\";\n\nimport { type SpaceType } from \"../../types\";\nimport { crukTheme as defaultTheme } from \"../../themes/cruk\";\n\nimport { StyledBadge } from \"./styles\";\n\nexport type BadgeProps = {\n /** background colour of badge */\n backgroundColor?: string;\n /** border colour of badge */\n borderColor?: string;\n /** text colour of badge */\n textColor?: string;\n /** size of badge */\n size?: SpaceType;\n /** contents of badge */\n children?: ReactNode;\n};\n\n/**\n * Displays a numeric or icon indicator. You can use the icon prop to\nindicate the importance of the badge to the user.\n\nNote that depending on how they are used, badges may be confusing for users\nof screen readers and similar assistive technologies. While the styling of\nbadges provides a visual cue as to their purpose, these users will simply\nbe presented with the content of the badge. Depending on the specific\nsituation, these badges may seem like random additional words or numbers\nat the end of a sentence, link, or button. Unless the context is clear,\nconsider including additional context with a visually hidden piece of\nadditional text.\n */\nexport function Badge({
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/components/Badge/index.tsx"],"sourcesContent":["import React, { type HTMLAttributes, type ReactNode } from \"react\";\nimport { useTheme } from \"styled-components\";\n\nimport { type SpaceType } from \"../../types\";\nimport { crukTheme as defaultTheme } from \"../../themes/cruk\";\n\nimport { StyledBadge } from \"./styles\";\n\nexport type BadgeProps = HTMLAttributes<HTMLSpanElement> & {\n /** background colour of badge */\n backgroundColor?: string;\n /** border colour of badge */\n borderColor?: string;\n /** text colour of badge */\n textColor?: string;\n /** size of badge */\n size?: SpaceType;\n /** contents of badge */\n children?: ReactNode;\n};\n\n/**\n * Displays a numeric or icon indicator. You can use the icon prop to\nindicate the importance of the badge to the user.\n\nNote that depending on how they are used, badges may be confusing for users\nof screen readers and similar assistive technologies. While the styling of\nbadges provides a visual cue as to their purpose, these users will simply\nbe presented with the content of the badge. Depending on the specific\nsituation, these badges may seem like random additional words or numbers\nat the end of a sentence, link, or button. Unless the context is clear,\nconsider including additional context with a visually hidden piece of\nadditional text.\n */\nexport function Badge({\n children,\n size = \"xs\",\n backgroundColor,\n borderColor,\n textColor,\n ...rest\n}: BadgeProps) {\n const foundTheme = useTheme();\n const theme = {\n ...defaultTheme,\n ...foundTheme,\n };\n return (\n <StyledBadge\n theme={theme}\n $isText={typeof children === \"string\"}\n $size={size}\n $backgroundColor={backgroundColor}\n $borderColor={borderColor}\n $textColor={textColor}\n {...rest}\n >\n {children}\n </StyledBadge>\n );\n}\n\nexport default Badge;\n"],"names":["Badge","_a","children","_b","size","backgroundColor","borderColor","textColor","rest","__rest","foundTheme","useTheme","theme","__assign","defaultTheme","React","createElement","StyledBadge","$isText","$size","$backgroundColor","$borderColor","$textColor"],"mappings":"6OAkCM,SAAUA,EAAMC,GACpB,IAAAC,aACAC,EAAAF,EAAAG,KAAAA,OAAI,IAAAD,EAAG,KAAIA,EACXE,oBACAC,gBACAC,cACGC,EANiBC,EAAAR,EAAA,CAAA,WAAA,OAAA,kBAAA,cAAA,cAQdS,EAAaC,IACbC,EACDC,EAAAA,EAAA,CAAA,EAAAC,GACAJ,GAEL,OACEK,EAACC,cAAAC,EACCJ,EAAA,CAAAD,MAAOA,EACEM,QAAoB,iBAAbhB,EAAqBiB,MAC9Bf,EACWgB,iBAAAf,EACJgB,aAAAf,EACFgB,WAAAf,GACRC,GAEHN,EAGP"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__makeTemplateObject as n}from"../../../node_modules/tslib/tslib.es6.js";import r,{css as o}from"styled-components";var e,i,t=r.span(i||(i=n(["\n border-width: 1px;\n border-style: solid;\n background-color: ",";\n color: ",";\n border-color: ",";\n text-align: center;\n border-radius: 1.5rem;\n font-size: ",";\n line-height: 1rem;\n padding: ",";\n display: inline-block;\n min-width: ",";\n\n ","\n"],["\n border-width: 1px;\n border-style: solid;\n background-color: ",";\n color: ",";\n border-color: ",";\n text-align: center;\n border-radius: 1.5rem;\n font-size: ",";\n line-height: 1rem;\n padding: ",";\n display: inline-block;\n min-width: ",";\n\n ","\n"])),(function(n){var r=n.theme.colors,o=n
|
|
1
|
+
import{__makeTemplateObject as n}from"../../../node_modules/tslib/tslib.es6.js";import r,{css as o}from"styled-components";var e,i,t=r.span(i||(i=n(["\n border-width: 1px;\n border-style: solid;\n background-color: ",";\n color: ",";\n border-color: ",";\n text-align: center;\n border-radius: 1.5rem;\n font-size: ",";\n line-height: 1rem;\n padding: ",";\n display: inline-block;\n min-width: ",";\n\n ","\n"],["\n border-width: 1px;\n border-style: solid;\n background-color: ",";\n color: ",";\n border-color: ",";\n text-align: center;\n border-radius: 1.5rem;\n font-size: ",";\n line-height: 1rem;\n padding: ",";\n display: inline-block;\n min-width: ",";\n\n ","\n"])),(function(n){var r=n.theme.colors,o=n.$backgroundColor;return o&&void 0!==r[o]?r[o]:o||r.primary}),(function(n){var r=n.theme.colors,o=n.$textColor;return o&&void 0!==r[o]?r[o]:o||r.textOnPrimary}),(function(n){var r=n.theme.colors,o=n.$borderColor,e=n.$backgroundColor;return o&&void 0!==r[o]?r[o]:o||(e&&void 0!==r[e]?r[e]:e||r.primary)}),(function(n){return n.theme.fontSizes.m}),(function(n){return n.theme.spacing.xxs}),(function(n){var r=n.$size,o=n.theme,e=o.spacing,i=o.spacing.xs;return"calc(".concat(e[r]," + ").concat(i,")")}),(function(r){var i=r.$isText,t=r.theme,c=r.$size;return!i&&o(e||(e=n(["\n padding: 0;\n border-radius: 50%;\n height: ",";\n width: ",";\n line-height: ",";\n svg {\n height: ",";\n }\n "],["\n padding: 0;\n border-radius: 50%;\n height: ",";\n width: ",";\n line-height: ",";\n svg {\n height: ",";\n }\n "])),"calc(".concat(t.spacing[c]," + ").concat(t.spacing.xs,")"),"calc(".concat(t.spacing[c]," + ").concat(t.spacing.xs,")"),"calc(".concat(t.spacing[c]," + ").concat(t.spacing.xs,")"),"calc(".concat(t.spacing[c]))}));export{t as StyledBadge,t as default};
|
|
2
2
|
//# sourceMappingURL=styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.js","sources":["../../../../src/components/Badge/styles.ts"],"sourcesContent":["import styled, { css } from \"styled-components\";\n\nimport { type ColorKeyType, type SpaceType, type ThemeType } from \"../../types\";\n\ntype StyleBadgeProps = {\n backgroundColor?: string;\n borderColor?: string;\n textColor?: string;\n isText?: boolean;\n size: SpaceType;\n theme: ThemeType;\n};\n\nexport const StyledBadge = styled.span<StyleBadgeProps>`\n border-width: 1px;\n border-style: solid;\n background-color: ${({\n theme: { colors },\n backgroundColor,\n }: StyleBadgeProps) =>\n backgroundColor &&\n typeof colors[backgroundColor as ColorKeyType] !== \"undefined\"\n ? colors[backgroundColor as ColorKeyType]\n : backgroundColor || colors.primary};\n color: ${({ theme: { colors }, textColor }: StyleBadgeProps) =>\n textColor && typeof colors[textColor as ColorKeyType] !== \"undefined\"\n ? colors[textColor as ColorKeyType]\n : textColor || colors.textOnPrimary};\n border-color: ${({\n theme: { colors },\n borderColor,\n backgroundColor,\n }: StyleBadgeProps) =>\n borderColor && typeof colors[borderColor as ColorKeyType] !== \"undefined\"\n ? colors[borderColor as ColorKeyType]\n : borderColor ||\n (backgroundColor &&\n typeof colors[backgroundColor as ColorKeyType] !== \"undefined\"\n ? colors[backgroundColor as ColorKeyType]\n : backgroundColor || colors.primary)};\n text-align: center;\n border-radius: 1.5rem;\n font-size: ${({ theme }: StyleBadgeProps) => theme.fontSizes.m};\n line-height: 1rem;\n padding: ${({\n theme: {\n spacing: { xxs },\n },\n }: StyleBadgeProps) => xxs};\n display: inline-block;\n min-width: ${({\n size,\n theme: {\n spacing,\n spacing: { xs },\n },\n }: StyleBadgeProps) => `calc(${spacing[size]} + ${xs})`};\n\n ${({ isText, theme, size }: StyleBadgeProps) =>\n
|
|
1
|
+
{"version":3,"file":"styles.js","sources":["../../../../src/components/Badge/styles.ts"],"sourcesContent":["import styled, { css } from \"styled-components\";\n\nimport { type ColorKeyType, type SpaceType, type ThemeType } from \"../../types\";\n\ntype StyleBadgeProps = {\n $backgroundColor?: string;\n $borderColor?: string;\n $textColor?: string;\n $isText?: boolean;\n $size: SpaceType;\n theme: ThemeType;\n};\n\nexport const StyledBadge = styled.span<StyleBadgeProps>`\n border-width: 1px;\n border-style: solid;\n background-color: ${({\n theme: { colors },\n $backgroundColor,\n }: StyleBadgeProps) =>\n $backgroundColor &&\n typeof colors[$backgroundColor as ColorKeyType] !== \"undefined\"\n ? colors[$backgroundColor as ColorKeyType]\n : $backgroundColor || colors.primary};\n color: ${({ theme: { colors }, $textColor }: StyleBadgeProps) =>\n $textColor && typeof colors[$textColor as ColorKeyType] !== \"undefined\"\n ? colors[$textColor as ColorKeyType]\n : $textColor || colors.textOnPrimary};\n border-color: ${({\n theme: { colors },\n $borderColor,\n $backgroundColor,\n }: StyleBadgeProps) =>\n $borderColor && typeof colors[$borderColor as ColorKeyType] !== \"undefined\"\n ? colors[$borderColor as ColorKeyType]\n : $borderColor ||\n ($backgroundColor &&\n typeof colors[$backgroundColor as ColorKeyType] !== \"undefined\"\n ? colors[$backgroundColor as ColorKeyType]\n : $backgroundColor || colors.primary)};\n text-align: center;\n border-radius: 1.5rem;\n font-size: ${({ theme }: StyleBadgeProps) => theme.fontSizes.m};\n line-height: 1rem;\n padding: ${({\n theme: {\n spacing: { xxs },\n },\n }: StyleBadgeProps) => xxs};\n display: inline-block;\n min-width: ${({\n $size,\n theme: {\n spacing,\n spacing: { xs },\n },\n }: StyleBadgeProps) => `calc(${spacing[$size]} + ${xs})`};\n\n ${({ $isText, theme, $size }: StyleBadgeProps) =>\n !$isText &&\n css`\n padding: 0;\n border-radius: 50%;\n height: ${`calc(${theme.spacing[$size]} + ${theme.spacing.xs})`};\n width: ${`calc(${theme.spacing[$size]} + ${theme.spacing.xs})`};\n line-height: ${`calc(${theme.spacing[$size]} + ${theme.spacing.xs})`};\n svg {\n height: ${`calc(${theme.spacing[$size]}`};\n }\n `}\n`;\n\nexport default StyledBadge;\n"],"names":["StyledBadge","styled","span","templateObject_2","__makeTemplateObject","_a","colors","theme","$backgroundColor","primary","$textColor","textOnPrimary","$borderColor","fontSizes","m","spacing","xxs","$size","_b","xs","concat","$isText","css"],"mappings":"2HAaa,QAAAA,EAAcC,EAAOC,KAAIC,IAAAA,EAAAC,EAAA,CAAA,uEAAA,eAAA,sBAAA,oEAAA,uCAAA,6CAAA,UAAA,MAAA,CAAiB,uEAUb,eAIA,sBAYK,oEAGiB,uCAMpC,6CAQ8B,UAarD,SArDiB,SAACC,OACVC,EAAMD,EAAAE,MAAAD,OACfE,EAAgBH,EAAAG,iBAEhB,OAAAA,QACoD,IAA7CF,EAAOE,GACVF,EAAOE,GACPA,GAAoBF,EAAOG,OAH/B,IAIO,SAACJ,OAAWC,EAAMD,EAAAE,MAAAD,OAAII,EAAUL,EAAAK,WACvC,OAAAA,QAA4D,IAAvCJ,EAAOI,GACxBJ,EAAOI,GACPA,GAAcJ,EAAOK,aAFzB,IAGc,SAACN,GACN,IAAAC,iBACTM,EAAYP,EAAAO,aACZJ,EAAgBH,EAAAG,iBAEhB,OAAAI,QAAgE,IAAzCN,EAAOM,GAC1BN,EAAOM,GACPA,IACCJ,QACmD,IAA7CF,EAAOE,GACVF,EAAOE,GACPA,GAAoBF,EAAOG,QANnC,IASW,SAACJ,GAA+B,OAAxBA,EAAAE,MAA8BM,UAAUC,CAAhB,IAElC,SAACT,GAIW,OAFLA,EAAAE,MAAAQ,QAAAC,GAEK,IAEV,SAACX,OACZY,EAAKZ,EAAAY,MACLC,EAGCb,EAAAE,MAFCQ,EAAOG,EAAAH,QACII,EAAED,EAAAH,QAAAI,GAEM,MAAA,eAAQJ,EAAQE,GAAM,OAAAG,OAAMD,EAAK,IAAjC,IAErB,SAACd,GAAE,IAAAgB,YAASd,EAAKF,EAAAE,MAAEU,EAAKZ,EAAAY,MACxB,OAACI,GACDC,gLAAG,iEAG8D,mBACD,yBACM,mCAE1B,sBAJhC,QAAAF,OAAQb,EAAMQ,QAAQE,iBAAYV,EAAMQ,QAAQI,GAAE,KACnD,QAAAC,OAAQb,EAAMQ,QAAQE,GAAM,OAAAG,OAAMb,EAAMQ,QAAQI,GAAK,KAC/C,QAAQC,OAAAb,EAAMQ,QAAQE,GAAY,OAAAG,OAAAb,EAAMQ,QAAQI,QAEnD,QAAAC,OAAQb,EAAMQ,QAAQE,IARpC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__rest as
|
|
1
|
+
import{__rest as r,__assign as o}from"../../../node_modules/tslib/tslib.es6.js";import e,{forwardRef as s}from"react";import{useTheme as t}from"styled-components";import{crukTheme as m}from"../../themes/cruk.js";import{spacingPropsToSpacingPropsInternal as c}from"../Spacing/index.js";import{StyledBox as n}from"./styles.js";var i=s((function(s,i){var l=r(s,[]),a=l.children,d=l.backgroundColor,f=l.css,p=r(l,["children","backgroundColor","css"]),u=t(),b=o(o({},m),u),g=c(p);return e.createElement(n,o({theme:b,$css:f,$backgroundColor:d},g,{ref:i}),a)}));export{i as Box,i as default};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../src/components/Box/index.tsx"],"sourcesContent":["import React, {\n type HTMLAttributes,\n type Ref,\n forwardRef,\n type ReactNode,\n type ElementType,\n} from \"react\";\nimport { useTheme } from \"styled-components\";\n\nimport { crukTheme as defaultTheme } from \"../../themes/cruk\";\n\nimport {
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/components/Box/index.tsx"],"sourcesContent":["import React, {\n type HTMLAttributes,\n type Ref,\n forwardRef,\n type ReactNode,\n type ElementType,\n} from \"react\";\nimport { useTheme } from \"styled-components\";\n\nimport { crukTheme as defaultTheme } from \"../../themes/cruk\";\n\nimport {\n spacingPropsToSpacingPropsInternal,\n type SpacingProps,\n} from \"../Spacing\";\nimport { StyledBox } from \"./styles\";\n\nexport type BoxProps = SpacingProps &\n HTMLAttributes<HTMLElement> & {\n /** background color of box, this will add default padding */\n backgroundColor?: string;\n css?: string;\n ref?: Ref<HTMLDivElement>;\n children?: ReactNode;\n /** styled-component polymorphic feature so you take the styling of a box and cast the component to be a \"span\" for example */\n as?: ElementType;\n };\n\n/**\n * Box is used to wrap other components to add margin and padding.\n * The values will be in the t-shirt sizes specified in the theme sizes.\n * The more specific the the target the higher priority the css will have.\n * For example `margin` will be overridden by the `marginVertical` or `marginHorizontal` props. `marginTop`, `marginBottom`, `marginLeft`, `marginRight` will override the the `marginVertical` and `marginHorizontal` props.\n */\nexport const Box = forwardRef(\n ({ ...props }: BoxProps, ref?: Ref<HTMLDivElement>) => {\n const { children, backgroundColor, css, ...rest } = props;\n const foundTheme = useTheme();\n const theme = {\n ...defaultTheme,\n ...foundTheme,\n };\n const restWithInternalSpacingProps =\n spacingPropsToSpacingPropsInternal(rest);\n\n return (\n <StyledBox\n theme={theme}\n $css={css}\n $backgroundColor={backgroundColor}\n {...restWithInternalSpacingProps}\n ref={ref}\n >\n {children}\n </StyledBox>\n );\n },\n);\n\nexport default Box;\n"],"names":["Box","forwardRef","_a","ref","props","__rest","children","backgroundColor","css","rest","foundTheme","useTheme","theme","__assign","defaultTheme","restWithInternalSpacingProps","spacingPropsToSpacingPropsInternal","React","StyledBox","$backgroundColor"],"mappings":"yUAkCaA,EAAMC,GACjB,SAACC,EAAwBC,OAAnBC,EAAKC,EAAAH,EAAV,IACSI,EAA4CF,EAAKE,SAAvCC,EAAkCH,EAAnBG,gBAAEC,EAAiBJ,MAATK,IAASL,EAA9C,CAA2C,WAAA,kBAAA,QAC3CM,EAAaC,IACbC,EACDC,EAAAA,EAAA,CAAA,EAAAC,GACAJ,GAECK,EACJC,EAAmCP,GAErC,OACEQ,gBAACC,EAASL,EAAA,CACRD,MAAOA,OACDJ,EAAGW,iBACSZ,GACdQ,GACJZ,IAAKA,IAEJG,EAGP"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__makeTemplateObject as n}from"../../../node_modules/tslib/tslib.es6.js";import o,{css as r}from"styled-components";import{
|
|
1
|
+
import{__makeTemplateObject as n}from"../../../node_modules/tslib/tslib.es6.js";import o,{css as r}from"styled-components";import{spacing as t}from"../Spacing/index.js";var c,i,a=o.div(i||(i=n(["\n background-color: ",";\n padding: ",";\n margin: 0 0 "," 0;\n\n &:last-child {\n margin-bottom: 0;\n }\n\n background-color: ",";\n\n ","\n ","\n"],["\n background-color: ",";\n padding: ",";\n margin: 0 0 "," 0;\n\n &:last-child {\n margin-bottom: 0;\n }\n\n background-color: ",";\n\n ","\n ","\n"])),(function(n){return n.theme.colors.backgroundLight}),(function(n){var o=n.theme;return n.$backgroundColor?o.spacing.s:0}),(function(n){return n.theme.spacing.m}),(function(n){var o=n.theme.colors,r=n.$backgroundColor;return r&&void 0!==o[r]?o[r]:r||"transparent"}),(function(o){return o.$css&&r(c||(c=n(["\n ","\n "],["\n ","\n "])),o.$css)}),(function(n){return t(n,n.theme)}));export{a as StyledBox,a as default};
|
|
2
2
|
//# sourceMappingURL=styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.js","sources":["../../../../src/components/Box/styles.ts"],"sourcesContent":["import styled, { css } from \"styled-components\";\n\nimport
|
|
1
|
+
{"version":3,"file":"styles.js","sources":["../../../../src/components/Box/styles.ts"],"sourcesContent":["import styled, { css } from \"styled-components\";\n\nimport { spacing, type SpacingPropsInternal } from \"../Spacing\";\nimport { type ColorKeyType, type ThemeType } from \"../../types\";\n\ntype StyledBoxProps = SpacingPropsInternal & {\n $backgroundColor?: string;\n $css?: string;\n theme: ThemeType;\n};\n\nexport const StyledBox = styled.div<StyledBoxProps>`\n background-color: ${({ theme }) => theme.colors.backgroundLight};\n padding: ${({ theme, $backgroundColor }) =>\n $backgroundColor ? theme.spacing.s : 0};\n margin: 0 0 ${({ theme }) => theme.spacing.m} 0;\n\n &:last-child {\n margin-bottom: 0;\n }\n\n background-color: ${({ theme: { colors }, $backgroundColor }) =>\n $backgroundColor &&\n typeof colors[$backgroundColor as ColorKeyType] !== \"undefined\"\n ? colors[$backgroundColor as ColorKeyType]\n : $backgroundColor || \"transparent\"};\n\n ${(props: StyledBoxProps) =>\n props.$css &&\n css`\n ${props.$css}\n `}\n ${(props) => spacing(props, props.theme as ThemeType)}\n`;\n\nexport default StyledBox;\n"],"names":["StyledBox","styled","div","templateObject_2","__makeTemplateObject","_a","theme","colors","backgroundLight","$backgroundColor","spacing","s","m","props","$css","css","templateObject_1"],"mappings":"iLAWaA,EAAYC,EAAOC,IAAmBC,IAAAA,EAAAC,EAAA,CAAA,yBAAA,iBAAA,oBAAA,8EAAA,UAAA,OAAA,MAAA,CAAA,yBACc,iBAEvB,oBACI,8EAUL,UAMpC,OACkD,SApBjC,SAACC,GAAc,OAAPA,EAAAC,MAAaC,OAAOC,eAAb,IACxB,SAACH,OAAEC,EAAKD,EAAAC,MACjB,OADmCD,EAAAI,iBAChBH,EAAMI,QAAQC,EAAI,CAArC,IACY,SAACN,GAAc,OAAPA,EAAAC,MAAaI,QAAQE,CAAd,IAMT,SAACP,OAAWE,EAAMF,EAAAC,MAAAC,OAAIE,EAAgBJ,EAAAI,iBACxD,OAAAA,QACoD,IAA7CF,EAAOE,GACVF,EAAOE,GACPA,GAAoB,aAHxB,IAKA,SAACI,GACD,OAAAA,EAAMC,MACNC,EAAGC,IAAAA,EAAAZ,EAAA,CAAA,WAAA,UAAA,CAAA,WACW,YAAVS,EAAMC,KAFV,IAIA,SAACD,GAAU,OAAAH,EAAQG,EAAOA,EAAMP"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__assign as e}from"../../../node_modules/tslib/tslib.es6.js";import
|
|
1
|
+
import{__assign as e,__rest as r}from"../../../node_modules/tslib/tslib.es6.js";import t,{forwardRef as o}from"react";import{useTheme as n}from"styled-components";import{crukTheme as i}from"../../themes/cruk.js";import{IconFa as l}from"../IconFa/index.js";import{StyledButton as a,Spacer as m}from"./styles.js";var s=o((function(o,s){var c=n(),p=e(e({},i),c),u=o.appearance,d=void 0===u?"primary":u,f=o.isIconButton,h=void 0!==f&&f,v=o.full,y=void 0!==v&&v,b=o.size,j=void 0===b?"m":b,I=o.children,$=r(o,["appearance","isIconButton","full","size","children"]),g=t.Children.toArray(I),z="string"==typeof g[0],B=g[0],k=!(!h&&(1===g.length&&!z&&(null==B?void 0:B.type))!==l);return t.createElement(a,e({as:o.href?"a":"button"},o.href?{role:"button"}:{},{$full:!!y,$size:j,$appearance:d,$isIconButton:k},$,{theme:p,ref:s}),o.children&&g.length?t.Children.map(o.children,(function(e,r){return t.createElement(m,{theme:p,key:r},e)})):null)}));export{s as Button,s as default};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../src/components/Button/index.tsx"],"sourcesContent":["import React, {\n type ReactNode,\n type ButtonHTMLAttributes,\n type Ref,\n forwardRef,\n type ReactElement,\n type ElementType,\n} from \"react\";\nimport { useTheme } from \"styled-components\";\n\nimport { crukTheme as defaultTheme } from \"../../themes/cruk\";\nimport { IconFa } from \"../IconFa\";\n\nimport { Spacer, StyledButton } from \"./styles\";\nimport { type ButtonAppearanceType } from \"../../types\";\n\nexport type ButtonProps = ButtonHTMLAttributes<HTMLElement> & {\n /** the look and feel of the button */\n appearance?: ButtonAppearanceType;\n /** flag to stretch but to 100% width */\n full?: boolean;\n /** this is a url which will convert the button to an anchor tag */\n href?: string;\n /** the height of the button, this will add padding not increase text size */\n size?: \"m\" | \"l\";\n css?: unknown;\n /** styled-components polymorphism where you can use the styling of a button but convert to another element like an anchor tag */\n as?: ElementType;\n /** flag to force button into an icon button shape which is square or round */\n isIconButton?: boolean;\n /** Element reference */\n ref?: Ref<HTMLElement>;\n /** Component reference */\n children?: ReactNode;\n};\n\n/**\n * Design system documentation CRUK https://zeroheight.com/23de8a59a/p/180ef6-buttons/b/32e1a2\n *\n * Design system documentation SU2C https://zeroheight.com/79db39f7e/p/22ff0e-button/b/32e1a2\n */\nexport const Button = forwardRef(\n (props: ButtonProps, ref?: Ref<HTMLElement>) => {\n const foundTheme = useTheme();\n
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/components/Button/index.tsx"],"sourcesContent":["import React, {\n type ReactNode,\n type ButtonHTMLAttributes,\n type Ref,\n forwardRef,\n type ReactElement,\n type ElementType,\n} from \"react\";\nimport { useTheme } from \"styled-components\";\n\nimport { crukTheme as defaultTheme } from \"../../themes/cruk\";\nimport { IconFa } from \"../IconFa\";\n\nimport { Spacer, StyledButton } from \"./styles\";\nimport { type ButtonAppearanceType } from \"../../types\";\n\nexport type ButtonProps = ButtonHTMLAttributes<HTMLElement> & {\n /** the look and feel of the button */\n appearance?: ButtonAppearanceType;\n /** flag to stretch but to 100% width */\n full?: boolean;\n /** this is a url which will convert the button to an anchor tag */\n href?: string;\n /** the height of the button, this will add padding not increase text size */\n size?: \"m\" | \"l\";\n css?: unknown;\n /** styled-components polymorphism where you can use the styling of a button but convert to another element like an anchor tag */\n as?: ElementType;\n /** flag to force button into an icon button shape which is square or round */\n isIconButton?: boolean;\n /** Element reference */\n ref?: Ref<HTMLElement>;\n /** Component reference */\n children?: ReactNode;\n};\n\n/**\n * Design system documentation CRUK https://zeroheight.com/23de8a59a/p/180ef6-buttons/b/32e1a2\n *\n * Design system documentation SU2C https://zeroheight.com/79db39f7e/p/22ff0e-button/b/32e1a2\n */\nexport const Button = forwardRef(\n (props: ButtonProps, ref?: Ref<HTMLElement>) => {\n const foundTheme = useTheme();\n const theme = {\n ...defaultTheme,\n ...foundTheme,\n };\n const {\n appearance = \"primary\",\n isIconButton = false,\n full = false,\n size = \"m\",\n children,\n ...rest\n } = props;\n\n const childArray = React.Children.toArray(children);\n const isChildString = typeof childArray[0] === \"string\";\n const firstElement = childArray[0] as ReactElement;\n\n // button has a fixed width if there is a single icon\n const setIconButton = !!(\n isIconButton ||\n (childArray.length === 1 && !isChildString && firstElement?.type) ===\n IconFa\n );\n\n return (\n <StyledButton\n as={props.href ? \"a\" : \"button\"}\n {...(props.href ? { role: \"button\" } : {})}\n $full={!!full}\n $size={size}\n $appearance={appearance}\n $isIconButton={setIconButton}\n {...rest}\n theme={theme}\n ref={ref}\n >\n {props.children && childArray.length\n ? React.Children.map(\n props.children,\n (child: ReactNode, index: number) => (\n <Spacer theme={theme} key={index}>\n {child}\n </Spacer>\n ),\n )\n : null}\n </StyledButton>\n );\n },\n);\n\nexport default Button;\n"],"names":["Button","forwardRef","props","ref","foundTheme","useTheme","theme","__assign","defaultTheme","_a","appearance","_b","isIconButton","_c","full","_d","size","children","rest","childArray","React","Children","toArray","isChildString","firstElement","setIconButton","length","type","IconFa","createElement","StyledButton","as","href","role","$full","$size","$appearance","$isIconButton","map","child","index","Spacer","key"],"mappings":"2TAyCaA,EAASC,GACpB,SAACC,EAAoBC,GACnB,IAAMC,EAAaC,IACbC,EACDC,EAAAA,EAAA,CAAA,EAAAC,GACAJ,GAGHK,EAMEP,EANoBQ,WAAtBA,OAAa,IAAAD,EAAA,YACbE,EAKET,EALkBU,aAApBA,OAAe,IAAAD,KACfE,EAIEX,EAAKY,KAJPA,cAAYD,EACZE,EAGEb,OAHFc,OAAO,IAAAD,EAAA,IAAGA,EACVE,EAEEf,WADCgB,IACDhB,EAPE,CAOL,aAAA,eAAA,OAAA,OAAA,aAEKiB,EAAaC,EAAMC,SAASC,QAAQL,GACpCM,EAAyC,iBAAlBJ,EAAW,GAClCK,EAAeL,EAAW,GAG1BM,KACJb,IACuB,IAAtBO,EAAWO,SAAiBH,IAAiBC,aAAY,EAAZA,EAAcG,SAC1DC,GAGJ,OACER,EAAAS,cAACC,EAAYvB,EAAA,CACXwB,GAAI7B,EAAM8B,KAAO,IAAM,UAClB9B,EAAM8B,KAAO,CAAEC,KAAM,UAAa,CAAE,EAClC,CAAAC,QAAEpB,EACFqB,MAAAnB,EACMoB,YAAA1B,EACE2B,cAAAZ,GACXP,EACJ,CAAAZ,MAAOA,EACPH,IAAKA,IAEJD,EAAMe,UAAYE,EAAWO,OAC1BN,EAAMC,SAASiB,IACbpC,EAAMe,UACN,SAACsB,EAAkBC,GAAkB,OACnCpB,EAAAS,cAACY,EAAM,CAACnC,MAAOA,EAAOoC,IAAKF,GACxBD,MAIP,KAGV"}
|