@coopdigital/react 0.22.0 → 0.23.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/AlertBanner/AlertBanner.js +7 -5
- package/dist/components/Author/Author.js +13 -9
- package/dist/components/Button/Button.js +17 -8
- package/dist/components/Card/Card.js +13 -6
- package/dist/components/Expandable/Expandable.js +6 -5
- package/dist/components/Icon/AddIcon.js +11 -5
- package/dist/components/Icon/ArrowDownIcon.js +11 -5
- package/dist/components/Icon/ArrowLeftIcon.js +11 -5
- package/dist/components/Icon/ArrowRightIcon.js +11 -5
- package/dist/components/Icon/ArrowUpIcon.js +11 -5
- package/dist/components/Icon/AvatarAltIcon.js +11 -5
- package/dist/components/Icon/AvatarIcon.js +11 -5
- package/dist/components/Icon/BasketIcon.js +11 -5
- package/dist/components/Icon/CalendarIcon.js +11 -5
- package/dist/components/Icon/ChevronDownIcon.js +11 -5
- package/dist/components/Icon/ChevronLeftIcon.js +11 -5
- package/dist/components/Icon/ChevronRightIcon.js +11 -5
- package/dist/components/Icon/ChevronUpIcon.js +11 -5
- package/dist/components/Icon/ClockIcon.js +11 -5
- package/dist/components/Icon/CloseAltIcon.js +11 -5
- package/dist/components/Icon/CloseIcon.js +11 -5
- package/dist/components/Icon/CoopCardIcon.js +11 -5
- package/dist/components/Icon/CoopIcon.js +11 -5
- package/dist/components/Icon/CoopLocationIcon.js +11 -5
- package/dist/components/Icon/DownloadIcon.js +11 -5
- package/dist/components/Icon/HomeIcon.js +11 -5
- package/dist/components/Icon/InformationIcon.js +11 -5
- package/dist/components/Icon/LoadingIcon.js +11 -5
- package/dist/components/Icon/LocationIcon.js +11 -5
- package/dist/components/Icon/MailIcon.js +11 -5
- package/dist/components/Icon/MenuIcon.js +11 -5
- package/dist/components/Icon/MessageIcon.js +11 -5
- package/dist/components/Icon/MinusIcon.js +11 -5
- package/dist/components/Icon/OpenNewIcon.js +11 -5
- package/dist/components/Icon/PencilIcon.js +11 -5
- package/dist/components/Icon/PhoneIcon.js +11 -5
- package/dist/components/Icon/QuestionIcon.js +11 -5
- package/dist/components/Icon/ScooterIcon.js +11 -5
- package/dist/components/Icon/SearchIcon.js +11 -5
- package/dist/components/Icon/SettingsIcon.js +11 -5
- package/dist/components/Icon/TickAltIcon.js +11 -5
- package/dist/components/Icon/TickIcon.js +11 -5
- package/dist/components/Icon/VanIcon.js +11 -5
- package/dist/components/Icon/WarningIcon.js +11 -5
- package/dist/components/Icon/WriteIcon.js +11 -5
- package/dist/components/Image/Image.js +2 -4
- package/dist/components/Pill/Pill.js +8 -5
- package/dist/components/SearchBox/SearchBox.js +14 -11
- package/dist/components/Signpost/Signpost.js +6 -5
- package/dist/components/SkipNav/SkipNav.js +8 -7
- package/dist/components/Squircle/Squircle.js +7 -5
- package/dist/components/Tag/Tag.js +7 -5
- package/package.json +3 -3
- package/dist/node_modules/tslib/tslib.es6.js +0 -45
|
@@ -1,13 +1,19 @@
|
|
|
1
|
-
import { __rest } from '../../node_modules/tslib/tslib.es6.js';
|
|
2
1
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
2
|
import { clsx } from '../../node_modules/clsx/dist/clsx.js';
|
|
4
3
|
import { useId } from 'react';
|
|
5
4
|
|
|
6
|
-
const TickIcon = (
|
|
7
|
-
var { alt, className, fill } = _a, props = __rest(_a, ["alt", "className", "fill"]);
|
|
5
|
+
const TickIcon = ({ alt, className, fill, ...props }) => {
|
|
8
6
|
const id = useId();
|
|
9
|
-
const componentProps =
|
|
10
|
-
|
|
7
|
+
const componentProps = {
|
|
8
|
+
"aria-labelledby": alt ? id : undefined,
|
|
9
|
+
className: clsx("coop-icon", className),
|
|
10
|
+
"data-icon": "tick",
|
|
11
|
+
fill: fill !== null && fill !== void 0 ? fill : "none",
|
|
12
|
+
role: alt ? "img" : undefined,
|
|
13
|
+
viewBox: "0 0 32 32",
|
|
14
|
+
...props,
|
|
15
|
+
};
|
|
16
|
+
return (jsxs("svg", { ...componentProps, children: [alt ? jsx("title", { id: id, children: alt }) : null, jsx("path", { d: "M10.41 26a1 1 0 0 1-.71-.3l-6.42-6.59a1 1 0 0 1 1.44-1.39l5.69 5.85L27.28 6.3a1 1 0 1 1 1.44 1.4l-17.59 18a1 1 0 0 1-.72.3", fill: fill !== null && fill !== void 0 ? fill : "currentColor" })] }));
|
|
11
17
|
};
|
|
12
18
|
|
|
13
19
|
export { TickIcon };
|
|
@@ -1,13 +1,19 @@
|
|
|
1
|
-
import { __rest } from '../../node_modules/tslib/tslib.es6.js';
|
|
2
1
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
2
|
import { clsx } from '../../node_modules/clsx/dist/clsx.js';
|
|
4
3
|
import { useId } from 'react';
|
|
5
4
|
|
|
6
|
-
const VanIcon = (
|
|
7
|
-
var { alt, className, fill } = _a, props = __rest(_a, ["alt", "className", "fill"]);
|
|
5
|
+
const VanIcon = ({ alt, className, fill, ...props }) => {
|
|
8
6
|
const id = useId();
|
|
9
|
-
const componentProps =
|
|
10
|
-
|
|
7
|
+
const componentProps = {
|
|
8
|
+
"aria-labelledby": alt ? id : undefined,
|
|
9
|
+
className: clsx("coop-icon", className),
|
|
10
|
+
"data-icon": "van",
|
|
11
|
+
fill: fill !== null && fill !== void 0 ? fill : "none",
|
|
12
|
+
role: alt ? "img" : undefined,
|
|
13
|
+
viewBox: "0 0 32 32",
|
|
14
|
+
...props,
|
|
15
|
+
};
|
|
16
|
+
return (jsxs("svg", { ...componentProps, children: [alt ? jsx("title", { id: id, children: alt }) : null, jsx("path", { d: "M31.05 3H9.8a1 1 0 0 0-1 1v.2H3.06a1 1 0 0 0-1 .86L.89 12.64a1 1 0 0 0-.89 1v10a1 1 0 0 0 1 1h3a5 5 0 0 0 9.9 0H18a5 5 0 0 0 9.89 0h3.21a1 1 0 0 0 .72-.3 1 1 0 0 0 .18-.72V4a1 1 0 0 0-.95-1M3.91 6.24H8.8v6.38H2.93ZM8.92 27A3 3 0 0 1 6 24.71a2.9 2.9 0 0 1-.12-.83 3.1 3.1 0 0 1 .25-1.22 3 3 0 0 1 5.53 0 3.3 3.3 0 0 1 .24 1.22 3.3 3.3 0 0 1-.11.83A3 3 0 0 1 8.92 27M23 27a3 3 0 0 1-2.89-2.24 2.9 2.9 0 0 1-.12-.83 3.1 3.1 0 0 1 .25-1.22 3 3 0 0 1 5.53 0 3.3 3.3 0 0 1 .23 1.17 3.3 3.3 0 0 1-.11.83A3 3 0 0 1 23 27m4.87-4.29a5 5 0 0 0-9.74 0H13.8a5 5 0 0 0-9.75 0H2v-8h7.8a1 1 0 0 0 1-1V5.05H30v17.61Z", fill: fill !== null && fill !== void 0 ? fill : "currentColor" })] }));
|
|
11
17
|
};
|
|
12
18
|
|
|
13
19
|
export { VanIcon };
|
|
@@ -1,13 +1,19 @@
|
|
|
1
|
-
import { __rest } from '../../node_modules/tslib/tslib.es6.js';
|
|
2
1
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
2
|
import { clsx } from '../../node_modules/clsx/dist/clsx.js';
|
|
4
3
|
import { useId } from 'react';
|
|
5
4
|
|
|
6
|
-
const WarningIcon = (
|
|
7
|
-
var { alt, className, fill } = _a, props = __rest(_a, ["alt", "className", "fill"]);
|
|
5
|
+
const WarningIcon = ({ alt, className, fill, ...props }) => {
|
|
8
6
|
const id = useId();
|
|
9
|
-
const componentProps =
|
|
10
|
-
|
|
7
|
+
const componentProps = {
|
|
8
|
+
"aria-labelledby": alt ? id : undefined,
|
|
9
|
+
className: clsx("coop-icon", className),
|
|
10
|
+
"data-icon": "warning",
|
|
11
|
+
fill: fill !== null && fill !== void 0 ? fill : "none",
|
|
12
|
+
role: alt ? "img" : undefined,
|
|
13
|
+
viewBox: "0 0 32 32",
|
|
14
|
+
...props,
|
|
15
|
+
};
|
|
16
|
+
return (jsxs("svg", { ...componentProps, children: [alt ? jsx("title", { id: id, children: alt }) : null, jsx("path", { d: "M2.35 28.08 16.06 4.46l13.71 23.62Zm29.32-.7L17.56 3.07A1.73 1.73 0 0 0 16.06 2a1.94 1.94 0 0 0-1.5 1.1L.35 27.38C-.45 28.77.15 30 1.85 30h28.32a1.6 1.6 0 0 0 1.5-2.62", fill: fill !== null && fill !== void 0 ? fill : "currentColor" }), jsx("path", { d: "M14.52 24.19A1.44 1.44 0 0 1 15 23.1a1.54 1.54 0 0 1 1.13-.46 1.63 1.63 0 0 1 1.12.44 1.39 1.39 0 0 1 .48 1.07 1.48 1.48 0 0 1-.47 1.1 1.62 1.62 0 0 1-1.74.34 1.6 1.6 0 0 1-.51-.32 1.3 1.3 0 0 1-.35-.48 1.3 1.3 0 0 1-.14-.6m2.8-3h-2.4v-9.71h2.4Z", fill: fill !== null && fill !== void 0 ? fill : "currentColor" })] }));
|
|
11
17
|
};
|
|
12
18
|
|
|
13
19
|
export { WarningIcon };
|
|
@@ -1,13 +1,19 @@
|
|
|
1
|
-
import { __rest } from '../../node_modules/tslib/tslib.es6.js';
|
|
2
1
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
2
|
import { clsx } from '../../node_modules/clsx/dist/clsx.js';
|
|
4
3
|
import { useId } from 'react';
|
|
5
4
|
|
|
6
|
-
const WriteIcon = (
|
|
7
|
-
var { alt, className, fill } = _a, props = __rest(_a, ["alt", "className", "fill"]);
|
|
5
|
+
const WriteIcon = ({ alt, className, fill, ...props }) => {
|
|
8
6
|
const id = useId();
|
|
9
|
-
const componentProps =
|
|
10
|
-
|
|
7
|
+
const componentProps = {
|
|
8
|
+
"aria-labelledby": alt ? id : undefined,
|
|
9
|
+
className: clsx("coop-icon", className),
|
|
10
|
+
"data-icon": "write",
|
|
11
|
+
fill: fill !== null && fill !== void 0 ? fill : "none",
|
|
12
|
+
role: alt ? "img" : undefined,
|
|
13
|
+
viewBox: "0 0 32 32",
|
|
14
|
+
...props,
|
|
15
|
+
};
|
|
16
|
+
return (jsxs("svg", { ...componentProps, children: [alt ? jsx("title", { id: id, children: alt }) : null, jsx("path", { d: "M19.67 10.13 17.9 11.9H7a1 1 0 0 1 0-2h12a1 1 0 0 1 .67.23M14.9 14.9l-2 2H7a1 1 0 0 1 0-2ZM20 15.9a1 1 0 0 1-1 1h-1.87l2-2a1 1 0 0 1 .82.59.85.85 0 0 1 .05.41M19 21.9H7a1 1 0 0 1 0-2h12a1 1 0 1 1 0 2", fill: fill !== null && fill !== void 0 ? fill : "currentColor" }), jsx("path", { d: "M24.08 10v20h-22V6h21.73l1.54-1.54a1.9 1.9 0 0 0-1-.44H2.07a2 2 0 0 0-2 2V30a2 2 0 0 0 2 2h22a2 2 0 0 0 2-2V8Z", fill: fill !== null && fill !== void 0 ? fill : "currentColor" }), jsx("path", { d: "M30.62 3.41 28.5 1.29a1 1 0 0 0-1.42 0L22.38 6l-3.9 3.9-5 5-1.33 1.33a1 1 0 0 0-.27.48v.19l-.6 2.57a.8.8 0 0 0 0 .43 1 1 0 0 0 1.19.77l2.74-.67a.64.64 0 0 0 .29-.13.6.6 0 0 0 .19-.14l2.85-2.86 1.4-1.39L30.62 4.82a1 1 0 0 0 0-1.41M15 19.06l-2.75.63.62-2.75 6.82-6.81L23.81 6l1.54-1.54L27.79 2l2.13 2.12Z", fill: fill !== null && fill !== void 0 ? fill : "currentColor" }), jsx("path", { d: "M31.33 2.7 29.21.58a2.06 2.06 0 0 0-2.83 0L11.44 15.52a2.1 2.1 0 0 0-.54 1l-.09.41-.54 2.34a2.18 2.18 0 0 0 .54 1.87 2 2 0 0 0 1.4.58 1.8 1.8 0 0 0 .46-.05l2.75-.67a2.1 2.1 0 0 0 1-.54L31.33 5.53a2 2 0 0 0 0-2.83M15 19.06l-2.75.63.62-2.75 6.82-6.81L23.81 6l1.54-1.54L27.79 2l2.13 2.12Z", fill: fill !== null && fill !== void 0 ? fill : "currentColor" })] }));
|
|
11
17
|
};
|
|
12
18
|
|
|
13
19
|
export { WriteIcon };
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { __rest } from '../../node_modules/tslib/tslib.es6.js';
|
|
2
1
|
import { jsx } from 'react/jsx-runtime';
|
|
3
2
|
|
|
4
3
|
const getContentfulParams = (src, width, height) => {
|
|
@@ -21,8 +20,7 @@ const getContentfulParams = (src, width, height) => {
|
|
|
21
20
|
width: (_b = url.searchParams.get("w")) !== null && _b !== void 0 ? _b : width,
|
|
22
21
|
};
|
|
23
22
|
};
|
|
24
|
-
const Image = (
|
|
25
|
-
var { alt, crop, height, src, width = "640" } = _a, props = __rest(_a, ["alt", "crop", "height", "src", "width"]);
|
|
23
|
+
const Image = ({ alt, crop, height, src, width = "640", ...props }) => {
|
|
26
24
|
let params = { height, src, width };
|
|
27
25
|
if (src.includes("images.ctfassets.net")) {
|
|
28
26
|
params = getContentfulParams(src, width, height);
|
|
@@ -32,7 +30,7 @@ const Image = (_a) => {
|
|
|
32
30
|
height: params.height,
|
|
33
31
|
width: params.width,
|
|
34
32
|
};
|
|
35
|
-
return (jsx("picture", { children: jsx("img",
|
|
33
|
+
return (jsx("picture", { children: jsx("img", { alt: alt, loading: "lazy", src: params.src, ...dimensions, ...props }) }));
|
|
36
34
|
};
|
|
37
35
|
|
|
38
36
|
export { Image, Image as default };
|
|
@@ -1,18 +1,21 @@
|
|
|
1
|
-
import { __rest } from '../../node_modules/tslib/tslib.es6.js';
|
|
2
1
|
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
3
2
|
import { clsx } from '../../node_modules/clsx/dist/clsx.js';
|
|
4
3
|
import React from 'react';
|
|
5
4
|
import { bgPropToClass } from '../../utils/index.js';
|
|
6
5
|
|
|
7
|
-
const Pill = (
|
|
8
|
-
var { as, background = "tint-grey", badge, badgeBackground = "offer-red", children, className, href, size = "md" } = _a, props = __rest(_a, ["as", "background", "badge", "badgeBackground", "children", "className", "href", "size"]);
|
|
6
|
+
const Pill = ({ as, background = "tint-grey", badge, badgeBackground = "offer-red", children, className, href, size = "md", ...props }) => {
|
|
9
7
|
let element = href ? "a" : "span";
|
|
10
8
|
if (as) {
|
|
11
9
|
element = as;
|
|
12
10
|
}
|
|
13
|
-
const componentProps =
|
|
11
|
+
const componentProps = {
|
|
12
|
+
className: clsx("coop-pill", bgPropToClass(background, className), className),
|
|
13
|
+
"data-size": size.length && size !== "md" ? size : undefined,
|
|
14
|
+
href,
|
|
15
|
+
...props,
|
|
16
|
+
};
|
|
14
17
|
const finalChildren = badge ? (jsxs(Fragment, { children: [children, jsx("span", { className: clsx("coop-pill--badge", bgPropToClass(badgeBackground)), children: badge })] })) : (children);
|
|
15
|
-
return React.createElement(element,
|
|
18
|
+
return React.createElement(element, { ...componentProps }, finalChildren);
|
|
16
19
|
};
|
|
17
20
|
|
|
18
21
|
export { Pill, Pill as default };
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { __rest, __awaiter } from '../../node_modules/tslib/tslib.es6.js';
|
|
2
1
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
2
|
import { clsx } from '../../node_modules/clsx/dist/clsx.js';
|
|
4
3
|
import React, { useState, useCallback, useId } from 'react';
|
|
@@ -9,22 +8,21 @@ const defaultButtonProps = {
|
|
|
9
8
|
label: React.createElement(SearchIcon, { alt: "Search", stroke: "currentColor", strokeWidth: 2 }),
|
|
10
9
|
loadingText: "",
|
|
11
10
|
};
|
|
12
|
-
const SearchBox = (
|
|
13
|
-
var
|
|
14
|
-
var { action, "aria-placeholder": ariaPlaceholder, autoCapitalize = "off", autoComplete = "off", button = defaultButtonProps, className, label, labelVisible = false, name = "query", onSubmit, placeholder, size = "md", variant = "green" } = _a, props = __rest(_a, ["action", "aria-placeholder", "autoCapitalize", "autoComplete", "button", "className", "label", "labelVisible", "name", "onSubmit", "placeholder", "size", "variant"]);
|
|
11
|
+
const SearchBox = ({ action, "aria-placeholder": ariaPlaceholder, autoCapitalize = "off", autoComplete = "off", button = defaultButtonProps, className, label, labelVisible = false, name = "query", onSubmit, placeholder, size = "md", variant = "green", ...props }) => {
|
|
12
|
+
var _a, _b;
|
|
15
13
|
const [isPending, setIsPending] = useState(false);
|
|
16
|
-
const handleSubmit = useCallback((event) =>
|
|
14
|
+
const handleSubmit = useCallback(async (event) => {
|
|
17
15
|
event.preventDefault();
|
|
18
16
|
if (isPending || !onSubmit)
|
|
19
17
|
return;
|
|
20
18
|
setIsPending(true);
|
|
21
19
|
try {
|
|
22
|
-
|
|
20
|
+
await Promise.resolve(onSubmit(event));
|
|
23
21
|
}
|
|
24
22
|
finally {
|
|
25
23
|
setIsPending(false);
|
|
26
24
|
}
|
|
27
|
-
}
|
|
25
|
+
}, [onSubmit, isPending]);
|
|
28
26
|
const id = useId();
|
|
29
27
|
const formProps = {
|
|
30
28
|
action: action !== null && action !== void 0 ? action : undefined,
|
|
@@ -36,16 +34,21 @@ const SearchBox = (_a) => {
|
|
|
36
34
|
const buttonProps = {
|
|
37
35
|
className: button === null || button === void 0 ? void 0 : button.className,
|
|
38
36
|
isLoading: isPending,
|
|
39
|
-
loadingText: (
|
|
37
|
+
loadingText: (_a = button === null || button === void 0 ? void 0 : button.loadingText) !== null && _a !== void 0 ? _a : "",
|
|
40
38
|
size: size,
|
|
41
39
|
variant: variant,
|
|
42
40
|
};
|
|
43
|
-
const inputProps =
|
|
41
|
+
const inputProps = {
|
|
42
|
+
"aria-placeholder": (_b = placeholder !== null && placeholder !== void 0 ? placeholder : ariaPlaceholder) !== null && _b !== void 0 ? _b : undefined,
|
|
43
|
+
autoCapitalize,
|
|
44
44
|
autoComplete,
|
|
45
45
|
id,
|
|
46
46
|
name,
|
|
47
|
-
placeholder,
|
|
48
|
-
|
|
47
|
+
placeholder,
|
|
48
|
+
type: "search",
|
|
49
|
+
...props,
|
|
50
|
+
};
|
|
51
|
+
return (jsxs("form", { ...formProps, children: [jsx("label", { className: labelVisible ? "" : "sr-only", htmlFor: id, children: label }), jsxs("div", { className: "coop-search-box--inner", children: [jsx("input", { ...inputProps }), jsx(Button, { ...buttonProps, children: button.label })] })] }));
|
|
49
52
|
};
|
|
50
53
|
|
|
51
54
|
export { SearchBox, SearchBox as default };
|
|
@@ -1,18 +1,19 @@
|
|
|
1
|
-
import { __rest } from '../../node_modules/tslib/tslib.es6.js';
|
|
2
1
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
2
|
import { clsx } from '../../node_modules/clsx/dist/clsx.js';
|
|
4
3
|
import React from 'react';
|
|
5
4
|
import { ChevronRightIcon } from '../Icon/ChevronRightIcon.js';
|
|
6
5
|
import { Image } from '../Image/Image.js';
|
|
7
6
|
|
|
8
|
-
const Signpost = (
|
|
9
|
-
var { as, children, className, headingLevel = "h3", href, image } = _a, props = __rest(_a, ["as", "children", "className", "headingLevel", "href", "image"]);
|
|
7
|
+
const Signpost = ({ as, children, className, headingLevel = "h3", href, image, ...props }) => {
|
|
10
8
|
let element = "a";
|
|
11
9
|
if (as) {
|
|
12
10
|
element = as;
|
|
13
11
|
}
|
|
14
|
-
const componentProps =
|
|
15
|
-
|
|
12
|
+
const componentProps = {
|
|
13
|
+
className: clsx("coop-signpost", className),
|
|
14
|
+
...props,
|
|
15
|
+
};
|
|
16
|
+
return (jsxs("div", { ...componentProps, children: [image && jsx(Image, { crop: "wide", ...image }), React.createElement(element, { href }, jsxs("div", { className: "coop-signpost--content", children: [React.createElement(headingLevel, { className: "coop-signpost--heading" }, children), jsx("span", { "aria-hidden": "true", className: "coop-signpost--icon", role: "presentation", children: jsx(ChevronRightIcon, {}) })] }))] }));
|
|
16
17
|
};
|
|
17
18
|
|
|
18
19
|
export { Signpost, Signpost as default };
|
|
@@ -1,20 +1,21 @@
|
|
|
1
|
-
import { __rest } from '../../node_modules/tslib/tslib.es6.js';
|
|
2
1
|
import { jsx } from 'react/jsx-runtime';
|
|
3
2
|
import { clsx } from '../../node_modules/clsx/dist/clsx.js';
|
|
4
3
|
|
|
5
4
|
const defaultLinks = [{ href: "#main", label: "Skip to main content" }];
|
|
6
|
-
const SkipNav = (
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
const SkipNav = ({ className, isVisible = false, links = defaultLinks, ...props }) => {
|
|
6
|
+
const componentProps = {
|
|
7
|
+
className: clsx("coop-skip-nav", className),
|
|
8
|
+
...props,
|
|
9
|
+
};
|
|
9
10
|
const navLinks = links.length > 0 ? links : defaultLinks;
|
|
10
|
-
return (jsx("nav",
|
|
11
|
+
return (jsx("nav", { ...componentProps, children: jsx("ul", { children: navLinks.map((link) => {
|
|
11
12
|
const linkProps = {
|
|
12
13
|
"data-visible": isVisible,
|
|
13
14
|
href: link.href,
|
|
14
15
|
label: link.label,
|
|
15
16
|
};
|
|
16
|
-
return (jsx("li", { children: jsx("a",
|
|
17
|
-
}) }) }))
|
|
17
|
+
return (jsx("li", { children: jsx("a", { ...linkProps, children: link.label }) }, link.href));
|
|
18
|
+
}) }) }));
|
|
18
19
|
};
|
|
19
20
|
|
|
20
21
|
export { SkipNav, SkipNav as default };
|
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
import { __rest } from '../../node_modules/tslib/tslib.es6.js';
|
|
2
1
|
import { jsx } from 'react/jsx-runtime';
|
|
3
2
|
import { clsx } from '../../node_modules/clsx/dist/clsx.js';
|
|
4
3
|
import { bgPropToClass } from '../../utils/index.js';
|
|
5
4
|
|
|
6
|
-
const Squircle = (
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
const Squircle = ({ background = "offer-red", children, className, size = "lg", ...props }) => {
|
|
6
|
+
const componentProps = {
|
|
7
|
+
className: clsx("coop-squircle", bgPropToClass(background, className), className),
|
|
8
|
+
"data-size": size.length && size !== "lg" ? size : undefined,
|
|
9
|
+
...props,
|
|
10
|
+
};
|
|
11
|
+
return (jsx("figure", { ...componentProps, children: jsx("figcaption", { children: children }) }));
|
|
10
12
|
};
|
|
11
13
|
|
|
12
14
|
export { Squircle, Squircle as default };
|
|
@@ -1,16 +1,18 @@
|
|
|
1
|
-
import { __rest } from '../../node_modules/tslib/tslib.es6.js';
|
|
2
1
|
import { clsx } from '../../node_modules/clsx/dist/clsx.js';
|
|
3
2
|
import React from 'react';
|
|
4
3
|
import { bgPropToClass } from '../../utils/index.js';
|
|
5
4
|
|
|
6
|
-
const Tag = (
|
|
7
|
-
var { as, background = "tint-grey", children, className, href } = _a, props = __rest(_a, ["as", "background", "children", "className", "href"]);
|
|
5
|
+
const Tag = ({ as, background = "tint-grey", children, className, href, ...props }) => {
|
|
8
6
|
let element = href ? "a" : "span";
|
|
9
|
-
const componentProps =
|
|
7
|
+
const componentProps = {
|
|
8
|
+
className: clsx("coop-tag", bgPropToClass(background, className), className),
|
|
9
|
+
href,
|
|
10
|
+
...props,
|
|
11
|
+
};
|
|
10
12
|
if (as) {
|
|
11
13
|
element = as;
|
|
12
14
|
}
|
|
13
|
-
return React.createElement(element,
|
|
15
|
+
return React.createElement(element, { ...componentProps }, children);
|
|
14
16
|
};
|
|
15
17
|
|
|
16
18
|
export { Tag, Tag as default };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coopdigital/react",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.23.0",
|
|
5
5
|
"private": false,
|
|
6
6
|
"publishConfig": {
|
|
7
7
|
"access": "public"
|
|
@@ -78,7 +78,7 @@
|
|
|
78
78
|
"storybook": "$storybook"
|
|
79
79
|
},
|
|
80
80
|
"dependencies": {
|
|
81
|
-
"@coopdigital/styles": "^0.23.
|
|
81
|
+
"@coopdigital/styles": "^0.23.1"
|
|
82
82
|
},
|
|
83
|
-
"gitHead": "
|
|
83
|
+
"gitHead": "950ff3cadfa770aee2d7cde11aa8115e4720078e"
|
|
84
84
|
}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
/******************************************************************************
|
|
2
|
-
Copyright (c) Microsoft Corporation.
|
|
3
|
-
|
|
4
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
5
|
-
purpose with or without fee is hereby granted.
|
|
6
|
-
|
|
7
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
8
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
9
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
10
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
11
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
12
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
13
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
14
|
-
***************************************************************************** */
|
|
15
|
-
/* global Reflect, Promise, SuppressedError, Symbol, Iterator */
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
function __rest(s, e) {
|
|
19
|
-
var t = {};
|
|
20
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
21
|
-
t[p] = s[p];
|
|
22
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
23
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
24
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
25
|
-
t[p[i]] = s[p[i]];
|
|
26
|
-
}
|
|
27
|
-
return t;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
function __awaiter(thisArg, _arguments, P, generator) {
|
|
31
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
32
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
33
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
34
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
35
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
36
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
41
|
-
var e = new Error(message);
|
|
42
|
-
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
export { __awaiter, __rest };
|