@coopdigital/react 1.19.1 → 1.21.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 +5 -2
- package/dist/components/Author/Author.js +5 -2
- package/dist/components/Card/Card.d.ts +96 -49
- package/dist/components/Card/Card.js +61 -60
- package/dist/components/Card/index.d.ts +2 -2
- package/dist/components/Card/index.js +2 -2
- package/dist/components/Checkbox/Checkbox.js +5 -2
- package/dist/components/DatePicker/DatePicker.js +5 -4
- package/dist/components/DatePicker/datepicker-utils.js +12 -11
- package/dist/components/Dialog/Dialog.js +5 -2
- package/dist/components/Expandable/Expandable.js +5 -2
- package/dist/components/FieldMarkers/Error.js +5 -2
- package/dist/components/FieldMarkers/Hint.js +5 -2
- package/dist/components/FieldMarkers/Label.js +5 -2
- package/dist/components/Fieldset/Fieldset.js +10 -4
- package/dist/components/Flourish/Flourish.js +6 -3
- package/dist/components/Form/Form.js +5 -2
- package/dist/components/Image/Image.d.ts +3 -5
- package/dist/components/Image/Image.js +10 -7
- package/dist/components/LoadingSpinner/LoadingSpinner.js +5 -2
- package/dist/components/Logo/Logo.js +5 -2
- package/dist/components/Picture/Picture.d.ts +15 -0
- package/dist/components/Picture/Picture.js +17 -0
- package/dist/components/Picture/index.d.ts +2 -0
- package/dist/components/Picture/index.js +5 -0
- package/dist/components/Prose/Prose.js +5 -2
- package/dist/components/Radio/Radio.js +5 -2
- package/dist/components/Searchbox/Searchbox.js +3 -2
- package/dist/components/Select/Select.js +5 -2
- package/dist/components/Signpost/Signpost.js +6 -6
- package/dist/components/SkipNav/SkipNav.js +5 -2
- package/dist/components/Squircle/Squircle.d.ts +8 -4
- package/dist/components/Squircle/Squircle.js +39 -6
- package/dist/components/Squircle/index.d.ts +2 -2
- package/dist/components/ValidationSummary/ValidationSummary.js +5 -2
- package/dist/components/icons/AccountCircleFilledIcon.js +5 -2
- package/dist/components/icons/AccountCircleIcon.js +5 -2
- package/dist/components/icons/AccountFilledIcon.js +5 -2
- package/dist/components/icons/AccountIcon.js +5 -2
- package/dist/components/icons/AddIcon.js +5 -2
- package/dist/components/icons/AppsFilledIcon.js +5 -2
- package/dist/components/icons/AppsIcon.js +5 -2
- package/dist/components/icons/ArrowDownIcon.js +5 -2
- package/dist/components/icons/ArrowLeftIcon.js +5 -2
- package/dist/components/icons/ArrowRightIcon.js +5 -2
- package/dist/components/icons/ArrowUpIcon.js +5 -2
- package/dist/components/icons/BackspaceFilledIcon.js +5 -2
- package/dist/components/icons/BackspaceIcon.js +5 -2
- package/dist/components/icons/BasketFilledIcon.js +5 -2
- package/dist/components/icons/BasketIcon.js +5 -2
- package/dist/components/icons/BellFilledIcon.js +5 -2
- package/dist/components/icons/BellIcon.js +5 -2
- package/dist/components/icons/BroomIcon.js +5 -2
- package/dist/components/icons/CalendarFilledIcon.js +5 -2
- package/dist/components/icons/CalendarIcon.js +5 -2
- package/dist/components/icons/CashFilledIcon.js +5 -2
- package/dist/components/icons/CashIcon.js +5 -2
- package/dist/components/icons/ChevronDownIcon.js +5 -2
- package/dist/components/icons/ChevronLeftIcon.js +5 -2
- package/dist/components/icons/ChevronRightIcon.js +5 -2
- package/dist/components/icons/ChevronUpIcon.js +5 -2
- package/dist/components/icons/CircleBurgerFilledIcon.js +5 -2
- package/dist/components/icons/CircleBurgerIcon.js +5 -2
- package/dist/components/icons/ClipboardFilledIcon.js +5 -2
- package/dist/components/icons/ClipboardIcon.js +5 -2
- package/dist/components/icons/ClockFilledIcon.js +5 -2
- package/dist/components/icons/ClockIcon.js +5 -2
- package/dist/components/icons/CloseAltFilledIcon.js +5 -2
- package/dist/components/icons/CloseAltIcon.js +5 -2
- package/dist/components/icons/CogIcon.js +5 -2
- package/dist/components/icons/CommunityFilledIcon.js +5 -2
- package/dist/components/icons/CommunityIcon.js +5 -2
- package/dist/components/icons/ComputerIcon.js +5 -2
- package/dist/components/icons/ContactFilledIcon.js +5 -2
- package/dist/components/icons/ContactIcon.js +5 -2
- package/dist/components/icons/ContactlessFilledIcon.js +5 -2
- package/dist/components/icons/ContactlessIcon.js +5 -2
- package/dist/components/icons/CoopLiveIcon.js +5 -2
- package/dist/components/icons/CoopLocationFilledIcon.js +5 -2
- package/dist/components/icons/CoopLogoIcon.js +5 -2
- package/dist/components/icons/CoopMembershipCardFilledIcon.js +5 -2
- package/dist/components/icons/CreditCardFilledIcon.js +5 -2
- package/dist/components/icons/CreditCardIcon.js +5 -2
- package/dist/components/icons/CrossIcon.js +5 -2
- package/dist/components/icons/DocumentIcon.js +5 -2
- package/dist/components/icons/DownloadIcon.js +5 -2
- package/dist/components/icons/EnterStoreIcon.js +5 -2
- package/dist/components/icons/ExitStoreIcon.js +5 -2
- package/dist/components/icons/EyeFilledIcon.js +5 -2
- package/dist/components/icons/EyeIcon.js +5 -2
- package/dist/components/icons/EyeStrikeFilledIcon.js +5 -2
- package/dist/components/icons/EyeStrikeIcon.js +5 -2
- package/dist/components/icons/FeedbackFilledIcon.js +5 -2
- package/dist/components/icons/FeedbackIcon.js +5 -2
- package/dist/components/icons/FilterIcon.js +5 -2
- package/dist/components/icons/GiftCardFilledIcon.js +5 -2
- package/dist/components/icons/GiftCardIcon.js +5 -2
- package/dist/components/icons/GiftFilledIcon.js +5 -2
- package/dist/components/icons/GiftIcon.js +5 -2
- package/dist/components/icons/HelpFilledIcon.js +5 -2
- package/dist/components/icons/HelpIcon.js +5 -2
- package/dist/components/icons/HomeFilledIcon.js +5 -2
- package/dist/components/icons/HomeIcon.js +5 -2
- package/dist/components/icons/HowDoIAssistantIcon.js +5 -2
- package/dist/components/icons/InfoIcon.js +5 -2
- package/dist/components/icons/KebabIcon.js +5 -2
- package/dist/components/icons/LoadingIcon.js +5 -2
- package/dist/components/icons/LocationFilledIcon.js +5 -2
- package/dist/components/icons/LocationIcon.js +5 -2
- package/dist/components/icons/LogoutIcon.js +5 -2
- package/dist/components/icons/MailIcon.js +5 -2
- package/dist/components/icons/MenuIcon.js +5 -2
- package/dist/components/icons/MessageIcon.js +5 -2
- package/dist/components/icons/MinusIcon.js +5 -2
- package/dist/components/icons/NotesFilledIcon.js +5 -2
- package/dist/components/icons/NotesIcon.js +5 -2
- package/dist/components/icons/OpenNewIcon.js +5 -2
- package/dist/components/icons/OwnBagIcon.js +5 -2
- package/dist/components/icons/PadlockIcon.js +5 -2
- package/dist/components/icons/PencilIcon.js +5 -2
- package/dist/components/icons/PhoneIcon.js +5 -2
- package/dist/components/icons/PowerIcon.js +5 -2
- package/dist/components/icons/SaveFilledIcon.js +5 -2
- package/dist/components/icons/SaveIcon.js +5 -2
- package/dist/components/icons/ScooterIcon.js +5 -2
- package/dist/components/icons/SearchFilledIcon.js +5 -2
- package/dist/components/icons/SearchIcon.js +5 -2
- package/dist/components/icons/SendIcon.js +5 -2
- package/dist/components/icons/SpannerIcon.js +5 -2
- package/dist/components/icons/StarFilledIcon.js +5 -2
- package/dist/components/icons/StarIcon.js +5 -2
- package/dist/components/icons/TickAltFilledIcon.js +5 -2
- package/dist/components/icons/TickAltIcon.js +5 -2
- package/dist/components/icons/TickIcon.js +5 -2
- package/dist/components/icons/TruckIcon.js +5 -2
- package/dist/components/icons/UserWipeIcon.js +5 -2
- package/dist/components/icons/VoucherFilledIcon.js +5 -2
- package/dist/components/icons/VoucherIcon.js +5 -2
- package/dist/components/icons/WarningCircleFilledIcon.js +5 -2
- package/dist/components/icons/WarningCircleIcon.js +5 -2
- package/dist/components/icons/WarningFilledIcon.js +5 -2
- package/dist/components/icons/WarningIcon.js +5 -2
- package/dist/components/icons/WifiIcon.js +5 -2
- package/dist/components/icons/WriteIcon.js +5 -2
- package/dist/hooks/useSlots.js +4 -3
- package/dist/index.d.ts +5 -3
- package/dist/index.js +3 -2
- package/package.json +10 -10
- package/src/components/Card/Card.tsx +146 -100
- package/src/components/Image/Image.tsx +15 -22
- package/src/components/Picture/Picture.tsx +36 -0
- package/src/components/Picture/index.ts +5 -0
- package/src/components/Signpost/Signpost.tsx +1 -1
- package/src/components/Squircle/Squircle.tsx +50 -13
- package/src/index.ts +1 -0
|
@@ -2,10 +2,13 @@ import clsx from "clsx";
|
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
3
|
//#region src/components/AlertBanner/AlertBanner.tsx
|
|
4
4
|
const AlertBanner = ({ children, className, ref, variant = "default", ...props }) => {
|
|
5
|
-
|
|
5
|
+
const componentProps = {
|
|
6
6
|
className: clsx("coop-alert-banner", className),
|
|
7
7
|
"data-variant": variant,
|
|
8
|
-
...props
|
|
8
|
+
...props
|
|
9
|
+
};
|
|
10
|
+
return /* @__PURE__ */ jsx("aside", {
|
|
11
|
+
...componentProps,
|
|
9
12
|
ref,
|
|
10
13
|
children
|
|
11
14
|
});
|
|
@@ -10,10 +10,13 @@ const Author = ({ author = "Co-op team", className, date, datePrefix = "", image
|
|
|
10
10
|
width: "56px",
|
|
11
11
|
...image
|
|
12
12
|
};
|
|
13
|
-
|
|
13
|
+
const componentProps = {
|
|
14
14
|
className: clsx("coop-author", className),
|
|
15
15
|
"data-size": size?.length ? size : void 0,
|
|
16
|
-
...props
|
|
16
|
+
...props
|
|
17
|
+
};
|
|
18
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
19
|
+
...componentProps,
|
|
17
20
|
ref,
|
|
18
21
|
children: [image && /* @__PURE__ */ jsx(Image, { ...imageProps }), /* @__PURE__ */ jsxs("div", {
|
|
19
22
|
className: "coop-author--content",
|
|
@@ -1,76 +1,99 @@
|
|
|
1
1
|
import { ImageProps } from "../Image/Image.js";
|
|
2
2
|
import "../Image/index.js";
|
|
3
|
-
import
|
|
3
|
+
import { PictureProps } from "../Picture/Picture.js";
|
|
4
|
+
import "../Picture/index.js";
|
|
5
|
+
import { StandardSizes } from "../../types/index.js";
|
|
6
|
+
import React, { AnchorHTMLAttributes, ForwardRefExoticComponent, HTMLAttributes, JSX, Ref } from "react";
|
|
4
7
|
//#region src/components/Card/Card.d.ts
|
|
5
8
|
interface CardProps extends HTMLAttributes<HTMLDivElement> {
|
|
6
|
-
/** **(Optional)** Specify how the
|
|
9
|
+
/** **(Optional)** Specify how the Card behaves across screen sizes.
|
|
7
10
|
*
|
|
8
|
-
*
|
|
11
|
+
* For finer control, use utility classes or custom CSS to control flex-direction. */
|
|
12
|
+
adaptive?: "sm" | "md";
|
|
13
|
+
/** **(Optional)** Specify an element to use for the container.
|
|
9
14
|
*
|
|
10
|
-
* Default:
|
|
15
|
+
* Default: `article`
|
|
11
16
|
*/
|
|
12
|
-
|
|
13
|
-
/** **(Optional)**
|
|
14
|
-
chevron?: boolean;
|
|
15
|
-
/** **(Optional)** Content inside the component. Children that are not assigned to a slot will be grouped together and rendered under the main Card content. */
|
|
17
|
+
as?: "article" | "section" | "figure" | "div";
|
|
18
|
+
/** **(Optional)** Content inside the component. */
|
|
16
19
|
children?: React.ReactNode;
|
|
17
|
-
/** **(Optional)** Specify additional CSS classes
|
|
20
|
+
/** **(Optional)** Specify additional CSS classes. */
|
|
18
21
|
className?: string;
|
|
19
|
-
/** **(Optional)** Specify the
|
|
20
|
-
href?: string;
|
|
21
|
-
/** **(Optional)** Specify a custom element to use instead of `a`. */
|
|
22
|
-
hrefAs?: React.FC<any> | ForwardRefExoticComponent<any> | string;
|
|
23
|
-
/** **(Optional)** Specify the orientation of the Card.
|
|
24
|
-
*
|
|
25
|
-
* Default: vertical
|
|
26
|
-
*/
|
|
22
|
+
/** **(Optional)** Specify the Card orientation. */
|
|
27
23
|
orientation?: "vertical" | "horizontal";
|
|
24
|
+
/** **(Optional)** Specify the Card padding. */
|
|
25
|
+
padding?: StandardSizes;
|
|
26
|
+
/** **(Optional)** Specify the Card border radius. */
|
|
27
|
+
radius?: StandardSizes;
|
|
28
28
|
/** **(Optional)** Specify a custom React ref for this component. */
|
|
29
29
|
ref?: Ref<HTMLDivElement>;
|
|
30
30
|
/** **(Optional)** Enable additional styles to use the Card as a signpost.
|
|
31
31
|
*
|
|
32
|
-
* Text is vertically aligned centrally and the
|
|
32
|
+
* Text is vertically aligned centrally and the Icon is enlarged. */
|
|
33
33
|
signpost?: boolean;
|
|
34
34
|
}
|
|
35
|
-
interface
|
|
36
|
-
/** **(Optional)**
|
|
35
|
+
interface CardHeadingProps extends HTMLAttributes<HTMLDivElement> {
|
|
36
|
+
/** **(Optional)** Specify an element to use for the heading.
|
|
37
|
+
*
|
|
38
|
+
* Default: `h3`
|
|
39
|
+
*/
|
|
40
|
+
as?: "h2" | "h3" | "h4" | "h5" | "h6" | "p" | "span" | "div" | "strong" | "figcaption";
|
|
41
|
+
/** **(Optional)** Content inside the component. */
|
|
37
42
|
children?: React.ReactNode;
|
|
38
|
-
/** **(Optional)** Specify additional CSS classes
|
|
43
|
+
/** **(Optional)** Specify additional CSS classes. */
|
|
39
44
|
className?: string;
|
|
40
45
|
}
|
|
41
|
-
interface
|
|
42
|
-
/** **(Optional)**
|
|
43
|
-
as?: "h2" | "h3" | "h4" | "h5" | "h6" | "p" | "span" | "div";
|
|
44
|
-
/** **(Optional)** Content inside the Heading. */
|
|
46
|
+
interface CardIconProps extends HTMLAttributes<HTMLDivElement> {
|
|
47
|
+
/** **(Optional)** Content inside the component. */
|
|
45
48
|
children?: React.ReactNode;
|
|
46
|
-
/** **(Optional)** Specify additional CSS classes
|
|
49
|
+
/** **(Optional)** Specify additional CSS classes. */
|
|
47
50
|
className?: string;
|
|
48
51
|
}
|
|
49
|
-
interface
|
|
50
|
-
/** **(Optional)** Content inside the
|
|
52
|
+
interface CardContentProps extends HTMLAttributes<HTMLDivElement> {
|
|
53
|
+
/** **(Optional)** Content inside the component. */
|
|
51
54
|
children?: React.ReactNode;
|
|
55
|
+
/** **(Optional)** Specify additional CSS classes. */
|
|
56
|
+
className?: string;
|
|
57
|
+
}
|
|
58
|
+
interface CardLinkProps extends AnchorHTMLAttributes<HTMLAnchorElement> {
|
|
59
|
+
/** **(Optional)** Specify an element to use instead of native `a`. */
|
|
60
|
+
as?: React.FC<any> | ForwardRefExoticComponent<any> | string;
|
|
61
|
+
/** **(Optional)** Content inside the component. */
|
|
62
|
+
children?: React.ReactNode;
|
|
63
|
+
/** **(Optional)** Specify additional CSS classes. */
|
|
64
|
+
className?: string;
|
|
52
65
|
}
|
|
53
66
|
interface CardBadgeProps extends HTMLAttributes<HTMLDivElement> {
|
|
54
|
-
/** **(Optional)** Specify
|
|
67
|
+
/** **(Optional)** Specify alignment relative to container.
|
|
68
|
+
*
|
|
69
|
+
* Default: `right`
|
|
70
|
+
*/
|
|
55
71
|
align?: "left" | "right";
|
|
56
|
-
/** **(Optional)** Content inside the
|
|
72
|
+
/** **(Optional)** Content inside the component. */
|
|
57
73
|
children?: React.ReactNode;
|
|
58
|
-
/** **(Optional)** Specify additional CSS classes
|
|
74
|
+
/** **(Optional)** Specify additional CSS classes. */
|
|
59
75
|
className?: string;
|
|
60
|
-
/** **(Optional)** Specify
|
|
76
|
+
/** **(Optional)** Specify position relative to top corner.
|
|
77
|
+
*
|
|
78
|
+
* Default: `popout`
|
|
79
|
+
*/
|
|
61
80
|
position?: "inset" | "popout";
|
|
62
81
|
}
|
|
63
|
-
|
|
64
|
-
/** **(Optional)** Specify on which side the
|
|
82
|
+
interface CardPictureProps extends PictureProps {
|
|
83
|
+
/** **(Optional)** Specify on which side the Picture should appear. */
|
|
65
84
|
align?: "left" | "right";
|
|
66
|
-
|
|
85
|
+
/** **(Optional)** Content inside the component. */
|
|
86
|
+
children?: React.ReactNode;
|
|
87
|
+
/** **(Optional)** Specify additional CSS classes. */
|
|
88
|
+
className?: string;
|
|
89
|
+
}
|
|
67
90
|
declare const Card: {
|
|
68
|
-
({ adaptive,
|
|
91
|
+
({ adaptive, as, children, className, orientation, padding, radius, ref, signpost, ...props }: CardProps): JSX.Element;
|
|
69
92
|
slot: {
|
|
70
93
|
name: string;
|
|
71
94
|
};
|
|
72
|
-
|
|
73
|
-
({ children, className, ...props }:
|
|
95
|
+
Link: {
|
|
96
|
+
({ as, children, className, href, ...props }: CardLinkProps): JSX.Element;
|
|
74
97
|
slot: {
|
|
75
98
|
name: string;
|
|
76
99
|
};
|
|
@@ -82,19 +105,31 @@ declare const Card: {
|
|
|
82
105
|
};
|
|
83
106
|
};
|
|
84
107
|
Badge: {
|
|
85
|
-
({ align, children, position, ...props }: CardBadgeProps): JSX.Element;
|
|
108
|
+
({ align, children, className, position, ...props }: CardBadgeProps): JSX.Element;
|
|
109
|
+
slot: {
|
|
110
|
+
name: string;
|
|
111
|
+
};
|
|
112
|
+
};
|
|
113
|
+
Content: {
|
|
114
|
+
({ children, className, ...props }: CardContentProps): JSX.Element;
|
|
86
115
|
slot: {
|
|
87
116
|
name: string;
|
|
88
117
|
};
|
|
89
118
|
};
|
|
90
|
-
|
|
91
|
-
({ children }:
|
|
119
|
+
Icon: {
|
|
120
|
+
({ children, className, ...props }: CardIconProps): JSX.Element;
|
|
92
121
|
slot: {
|
|
93
122
|
name: string;
|
|
94
123
|
};
|
|
95
124
|
};
|
|
96
125
|
Image: {
|
|
97
|
-
(
|
|
126
|
+
(props: ImageProps): JSX.Element;
|
|
127
|
+
slot: {
|
|
128
|
+
name: string;
|
|
129
|
+
};
|
|
130
|
+
};
|
|
131
|
+
Picture: {
|
|
132
|
+
({ align, children, className, crop, ...props }: CardPictureProps): JSX.Element;
|
|
98
133
|
slot: {
|
|
99
134
|
name: string;
|
|
100
135
|
};
|
|
@@ -106,29 +141,41 @@ declare const CardHeading: {
|
|
|
106
141
|
name: string;
|
|
107
142
|
};
|
|
108
143
|
};
|
|
109
|
-
declare const
|
|
110
|
-
({ children, className, ...props }:
|
|
144
|
+
declare const CardIcon: {
|
|
145
|
+
({ children, className, ...props }: CardIconProps): JSX.Element;
|
|
111
146
|
slot: {
|
|
112
147
|
name: string;
|
|
113
148
|
};
|
|
114
149
|
};
|
|
115
150
|
declare const CardBadge: {
|
|
116
|
-
({ align, children, position, ...props }: CardBadgeProps): JSX.Element;
|
|
151
|
+
({ align, children, className, position, ...props }: CardBadgeProps): JSX.Element;
|
|
117
152
|
slot: {
|
|
118
153
|
name: string;
|
|
119
154
|
};
|
|
120
155
|
};
|
|
121
|
-
declare const
|
|
122
|
-
({ children }:
|
|
156
|
+
declare const CardPicture: {
|
|
157
|
+
({ align, children, className, crop, ...props }: CardPictureProps): JSX.Element;
|
|
123
158
|
slot: {
|
|
124
159
|
name: string;
|
|
125
160
|
};
|
|
126
161
|
};
|
|
127
162
|
declare const CardImage: {
|
|
128
|
-
(
|
|
163
|
+
(props: ImageProps): JSX.Element;
|
|
164
|
+
slot: {
|
|
165
|
+
name: string;
|
|
166
|
+
};
|
|
167
|
+
};
|
|
168
|
+
declare const CardContent: {
|
|
169
|
+
({ children, className, ...props }: CardContentProps): JSX.Element;
|
|
170
|
+
slot: {
|
|
171
|
+
name: string;
|
|
172
|
+
};
|
|
173
|
+
};
|
|
174
|
+
declare const CardLink: {
|
|
175
|
+
({ as, children, className, href, ...props }: CardLinkProps): JSX.Element;
|
|
129
176
|
slot: {
|
|
130
177
|
name: string;
|
|
131
178
|
};
|
|
132
179
|
};
|
|
133
180
|
//#endregion
|
|
134
|
-
export { Card, Card as default, CardBadge,
|
|
181
|
+
export { Card, Card as default, CardBadge, CardContent, CardHeading, CardIcon, CardImage, CardLink, CardPicture, CardProps };
|
|
@@ -1,63 +1,34 @@
|
|
|
1
1
|
import { Image } from "../Image/Image.js";
|
|
2
|
-
import { ChevronRightIcon } from "../icons/ChevronRightIcon.js";
|
|
3
2
|
import { hasUserBg } from "../../utils/index.js";
|
|
3
|
+
import Picture_default from "../Picture/index.js";
|
|
4
4
|
import { useSlots } from "../../hooks/useSlots.js";
|
|
5
5
|
import clsx from "clsx";
|
|
6
|
-
import {
|
|
6
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
7
|
import React from "react";
|
|
8
8
|
//#region src/components/Card/Card.tsx
|
|
9
9
|
const componentSlots = {
|
|
10
10
|
CardBadge: null,
|
|
11
|
-
CardBody: null,
|
|
12
|
-
CardHeading: null,
|
|
13
|
-
CardImage: null,
|
|
14
|
-
CardLabel: null,
|
|
15
11
|
Children: null
|
|
16
12
|
};
|
|
17
|
-
|
|
18
|
-
return {
|
|
19
|
-
element: as ?? "a",
|
|
20
|
-
props: {
|
|
21
|
-
className: "coop-card--link",
|
|
22
|
-
href
|
|
23
|
-
}
|
|
24
|
-
};
|
|
25
|
-
}
|
|
26
|
-
const Card = ({ adaptive, chevron = false, children, className, href, hrefAs, orientation, ref, signpost, ...props }) => {
|
|
27
|
-
const { element: linkElement, props: linkProps } = getCardLinkElement(hrefAs, href);
|
|
13
|
+
const Card = ({ adaptive, as = "article", children, className, orientation, padding, radius, ref, signpost, ...props }) => {
|
|
28
14
|
const slots = { ...useSlots(componentSlots, children) };
|
|
29
|
-
const hasLinkWrapper = href && !slots.CardHeading;
|
|
30
15
|
const componentProps = {
|
|
31
16
|
className: clsx("coop-card", !hasUserBg(className) && "bg-white", className),
|
|
32
17
|
"data-adaptive": adaptive ?? void 0,
|
|
33
18
|
"data-orientation": orientation ?? void 0,
|
|
19
|
+
"data-padding": padding ?? void 0,
|
|
20
|
+
"data-radius": radius ?? void 0,
|
|
34
21
|
"data-signpost": signpost ?? void 0,
|
|
35
22
|
...props
|
|
36
23
|
};
|
|
37
|
-
|
|
38
|
-
return /* @__PURE__ */ jsxs("article", {
|
|
24
|
+
const cardContent = React.createElement(as, {
|
|
39
25
|
ref,
|
|
40
|
-
...componentProps
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
href
|
|
47
|
-
} : { className: "coop-card--content" }, /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
48
|
-
slots.CardLabel,
|
|
49
|
-
slots.CardHeading,
|
|
50
|
-
slots.CardBody,
|
|
51
|
-
slots.Children
|
|
52
|
-
] })),
|
|
53
|
-
(chevron || signpost) && /* @__PURE__ */ jsx("span", {
|
|
54
|
-
"aria-hidden": "true",
|
|
55
|
-
className: "coop-card--icon",
|
|
56
|
-
role: "presentation",
|
|
57
|
-
children: /* @__PURE__ */ jsx(ChevronRightIcon, {})
|
|
58
|
-
})
|
|
59
|
-
]
|
|
60
|
-
});
|
|
26
|
+
...componentProps
|
|
27
|
+
}, slots.Children);
|
|
28
|
+
return slots.CardBadge ? /* @__PURE__ */ jsxs("div", {
|
|
29
|
+
className: "coop-card-wrapper",
|
|
30
|
+
children: [cardContent, slots.CardBadge]
|
|
31
|
+
}) : cardContent;
|
|
61
32
|
};
|
|
62
33
|
const CardHeading = ({ as = "h3", children, className, ...props }) => {
|
|
63
34
|
return React.createElement(as, {
|
|
@@ -65,42 +36,72 @@ const CardHeading = ({ as = "h3", children, className, ...props }) => {
|
|
|
65
36
|
...props
|
|
66
37
|
}, children);
|
|
67
38
|
};
|
|
68
|
-
const
|
|
39
|
+
const CardIcon = ({ children, className, ...props }) => {
|
|
40
|
+
const componentProps = {
|
|
41
|
+
className: clsx("coop-card--icon", className),
|
|
42
|
+
...props
|
|
43
|
+
};
|
|
69
44
|
return /* @__PURE__ */ jsx("span", {
|
|
70
|
-
|
|
71
|
-
...props,
|
|
45
|
+
...componentProps,
|
|
72
46
|
children
|
|
73
47
|
});
|
|
74
48
|
};
|
|
75
|
-
const CardBadge = ({ align = "right", children, position = "popout", ...props }) => {
|
|
76
|
-
|
|
77
|
-
className: "coop-card--badge",
|
|
49
|
+
const CardBadge = ({ align = "right", children, className, position = "popout", ...props }) => {
|
|
50
|
+
const componentProps = {
|
|
51
|
+
className: clsx("coop-card--badge", className),
|
|
78
52
|
"data-align": align,
|
|
79
53
|
"data-position": position,
|
|
80
|
-
...props
|
|
54
|
+
...props
|
|
55
|
+
};
|
|
56
|
+
return /* @__PURE__ */ jsx("div", {
|
|
57
|
+
...componentProps,
|
|
81
58
|
children
|
|
82
59
|
});
|
|
83
60
|
};
|
|
84
|
-
const
|
|
85
|
-
|
|
61
|
+
const CardPicture = ({ align, children, className, crop, ...props }) => {
|
|
62
|
+
const componentProps = {
|
|
63
|
+
className: clsx("coop-card--picture", className),
|
|
64
|
+
"data-align": align ?? void 0,
|
|
65
|
+
"data-crop": crop ?? "wide",
|
|
66
|
+
...props
|
|
67
|
+
};
|
|
68
|
+
return /* @__PURE__ */ jsx(Picture_default, {
|
|
69
|
+
...componentProps,
|
|
70
|
+
children
|
|
71
|
+
});
|
|
86
72
|
};
|
|
87
|
-
const CardImage = (
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
73
|
+
const CardImage = (props) => /* @__PURE__ */ jsx(Image, { ...props });
|
|
74
|
+
const CardContent = ({ children, className, ...props }) => {
|
|
75
|
+
const componentProps = {
|
|
76
|
+
className: clsx("coop-card--content", className),
|
|
77
|
+
...props
|
|
78
|
+
};
|
|
79
|
+
return /* @__PURE__ */ jsx("div", {
|
|
80
|
+
...componentProps,
|
|
81
|
+
children
|
|
92
82
|
});
|
|
93
83
|
};
|
|
84
|
+
const CardLink = ({ as = "a", children, className, href, ...props }) => {
|
|
85
|
+
return React.createElement(as, {
|
|
86
|
+
className: clsx("coop-card--link", className),
|
|
87
|
+
href,
|
|
88
|
+
...props
|
|
89
|
+
}, children);
|
|
90
|
+
};
|
|
94
91
|
Card.slot = { name: "Card" };
|
|
95
|
-
CardLabel.slot = { name: "CardLabel" };
|
|
96
92
|
CardHeading.slot = { name: "CardHeading" };
|
|
97
93
|
CardBadge.slot = { name: "CardBadge" };
|
|
98
|
-
|
|
94
|
+
CardIcon.slot = { name: "CardIcon" };
|
|
95
|
+
CardContent.slot = { name: "CardContent" };
|
|
99
96
|
CardImage.slot = { name: "CardImage" };
|
|
100
|
-
|
|
97
|
+
CardLink.slot = { name: "CardLink" };
|
|
98
|
+
CardPicture.slot = { name: "CardPicture" };
|
|
99
|
+
Card.Link = CardLink;
|
|
101
100
|
Card.Heading = CardHeading;
|
|
102
101
|
Card.Badge = CardBadge;
|
|
103
|
-
Card.
|
|
102
|
+
Card.Content = CardContent;
|
|
103
|
+
Card.Icon = CardIcon;
|
|
104
104
|
Card.Image = CardImage;
|
|
105
|
+
Card.Picture = CardPicture;
|
|
105
106
|
//#endregion
|
|
106
|
-
export { Card, Card as default, CardBadge,
|
|
107
|
+
export { Card, Card as default, CardBadge, CardContent, CardHeading, CardIcon, CardImage, CardLink, CardPicture };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Card, CardBadge,
|
|
2
|
-
export { Card, Card as default, CardBadge,
|
|
1
|
+
import { Card, CardBadge, CardContent, CardHeading, CardIcon, CardImage, CardLink, CardPicture, CardProps } from "./Card.js";
|
|
2
|
+
export { Card, Card as default, CardBadge, CardContent, CardHeading, CardIcon, CardImage, CardLink, CardPicture, CardProps };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Card, CardBadge,
|
|
1
|
+
import { Card, CardBadge, CardContent, CardHeading, CardIcon, CardImage, CardLink, CardPicture } from "./Card.js";
|
|
2
2
|
//#region src/components/Card/index.ts
|
|
3
3
|
var Card_default = Card;
|
|
4
4
|
//#endregion
|
|
5
|
-
export { Card, CardBadge,
|
|
5
|
+
export { Card, CardBadge, CardContent, CardHeading, CardIcon, CardImage, CardLink, CardPicture, Card_default as default };
|
|
@@ -5,7 +5,7 @@ import { jsx } from "react/jsx-runtime";
|
|
|
5
5
|
//#region src/components/Checkbox/Checkbox.tsx
|
|
6
6
|
const Checkbox = ({ className, disabled, error = false, id, name, ref, size, ...props }) => {
|
|
7
7
|
const field = useField();
|
|
8
|
-
|
|
8
|
+
const componentProps = {
|
|
9
9
|
className: clsx("coop-checkbox", className),
|
|
10
10
|
"data-error": error || void 0,
|
|
11
11
|
"data-size": size ?? void 0,
|
|
@@ -13,7 +13,10 @@ const Checkbox = ({ className, disabled, error = false, id, name, ref, size, ...
|
|
|
13
13
|
id: id ?? field?.id,
|
|
14
14
|
name,
|
|
15
15
|
type: "checkbox",
|
|
16
|
-
...props
|
|
16
|
+
...props
|
|
17
|
+
};
|
|
18
|
+
return /* @__PURE__ */ jsx("input", {
|
|
19
|
+
...componentProps,
|
|
17
20
|
ref
|
|
18
21
|
});
|
|
19
22
|
};
|
|
@@ -28,15 +28,16 @@ const initialState = {
|
|
|
28
28
|
};
|
|
29
29
|
const defaultFormatters = { formatWeekdayName: (d) => d.toLocaleDateString("default", { weekday: "short" }).slice(0, 2) };
|
|
30
30
|
const Calendar = ({ captionLayout = "label", className, disabled, endMonth, formatters, showOutsideDays = true, startMonth, ...props }) => {
|
|
31
|
+
const combinedFormatters = useMemo(() => ({
|
|
32
|
+
...defaultFormatters,
|
|
33
|
+
...formatters
|
|
34
|
+
}), [formatters]);
|
|
31
35
|
return /* @__PURE__ */ jsx(DayPicker, {
|
|
32
36
|
captionLayout,
|
|
33
37
|
className,
|
|
34
38
|
disabled,
|
|
35
39
|
endMonth,
|
|
36
|
-
formatters:
|
|
37
|
-
...defaultFormatters,
|
|
38
|
-
...formatters
|
|
39
|
-
}), [formatters]),
|
|
40
|
+
formatters: combinedFormatters,
|
|
40
41
|
navLayout: "around",
|
|
41
42
|
showOutsideDays,
|
|
42
43
|
startMonth,
|
|
@@ -136,17 +136,18 @@ function getRangeDate(date, df, now) {
|
|
|
136
136
|
};
|
|
137
137
|
const formatted = {};
|
|
138
138
|
let input = "";
|
|
139
|
-
if (typeof date === "string")
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
139
|
+
if (typeof date === "string") {
|
|
140
|
+
if (date.includes("-")) {
|
|
141
|
+
const { from, to } = getRangeFromString(date);
|
|
142
|
+
if (from && to) {
|
|
143
|
+
parsed.from = parse(from, df, now);
|
|
144
|
+
parsed.to = parse(to, df, now);
|
|
145
|
+
formatted.from = from;
|
|
146
|
+
formatted.to = to;
|
|
147
|
+
}
|
|
148
|
+
input = `${from} - ${to}`;
|
|
149
|
+
} else input = date;
|
|
150
|
+
} else if (date?.from && date?.to && isValid(date.from) && isValid(date.to)) {
|
|
150
151
|
parsed.from = date.from;
|
|
151
152
|
parsed.to = date.to;
|
|
152
153
|
formatted.from = format(parsed.from, df);
|
|
@@ -98,9 +98,12 @@ const DialogHeader = ({ children, className, closeButton = true, ...props }) =>
|
|
|
98
98
|
});
|
|
99
99
|
};
|
|
100
100
|
const DialogBody = ({ children, className, ...props }) => {
|
|
101
|
-
|
|
101
|
+
const componentProps = {
|
|
102
102
|
className: clsx("coop-dialog--body", className),
|
|
103
|
-
...props
|
|
103
|
+
...props
|
|
104
|
+
};
|
|
105
|
+
return /* @__PURE__ */ jsx("div", {
|
|
106
|
+
...componentProps,
|
|
104
107
|
children
|
|
105
108
|
});
|
|
106
109
|
};
|
|
@@ -10,9 +10,12 @@ const componentSlots = {
|
|
|
10
10
|
};
|
|
11
11
|
const Expandable = ({ children, className, ref, ...props }) => {
|
|
12
12
|
const slots = useSlots(componentSlots, children);
|
|
13
|
-
|
|
13
|
+
const componentProps = {
|
|
14
14
|
className: clsx("coop-expandable", !hasUserBg(className) && "bg-tint-grey", className),
|
|
15
|
-
...props
|
|
15
|
+
...props
|
|
16
|
+
};
|
|
17
|
+
return /* @__PURE__ */ jsxs("details", {
|
|
18
|
+
...componentProps,
|
|
16
19
|
ref,
|
|
17
20
|
children: [slots.ExpandableSummary, slots.ExpandableContent]
|
|
18
21
|
});
|
|
@@ -2,9 +2,12 @@ import clsx from "clsx";
|
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
3
|
//#region src/components/FieldMarkers/Error.tsx
|
|
4
4
|
const Error = ({ children, className, ref, ...props }) => {
|
|
5
|
-
|
|
5
|
+
const componentProps = {
|
|
6
6
|
className: clsx("coop-field-error ", className),
|
|
7
|
-
...props
|
|
7
|
+
...props
|
|
8
|
+
};
|
|
9
|
+
return /* @__PURE__ */ jsx("span", {
|
|
10
|
+
...componentProps,
|
|
8
11
|
ref,
|
|
9
12
|
children
|
|
10
13
|
});
|
|
@@ -2,9 +2,12 @@ import clsx from "clsx";
|
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
3
|
//#region src/components/FieldMarkers/Hint.tsx
|
|
4
4
|
const Hint = ({ children, className, ref, ...props }) => {
|
|
5
|
-
|
|
5
|
+
const componentProps = {
|
|
6
6
|
className: clsx("coop-field-hint ", className),
|
|
7
|
-
...props
|
|
7
|
+
...props
|
|
8
|
+
};
|
|
9
|
+
return /* @__PURE__ */ jsx("div", {
|
|
10
|
+
...componentProps,
|
|
8
11
|
ref,
|
|
9
12
|
children
|
|
10
13
|
});
|
|
@@ -4,10 +4,13 @@ import { jsx } from "react/jsx-runtime";
|
|
|
4
4
|
//#region src/components/FieldMarkers/Label.tsx
|
|
5
5
|
const Label = ({ children, className, isVisible = true, ref, ...props }) => {
|
|
6
6
|
const field = useField();
|
|
7
|
-
|
|
7
|
+
const componentProps = {
|
|
8
8
|
className: clsx("coop-field-label", !isVisible && "sr-only", className),
|
|
9
9
|
htmlFor: props.htmlFor ?? (field?.id ? field.id + (field?.suffix ?? "") : void 0),
|
|
10
|
-
...props
|
|
10
|
+
...props
|
|
11
|
+
};
|
|
12
|
+
return /* @__PURE__ */ jsx("label", {
|
|
13
|
+
...componentProps,
|
|
11
14
|
ref,
|
|
12
15
|
children: /* @__PURE__ */ jsx("span", { children })
|
|
13
16
|
});
|
|
@@ -5,24 +5,30 @@ import clsx from "clsx";
|
|
|
5
5
|
import { jsx } from "react/jsx-runtime";
|
|
6
6
|
//#region src/components/Fieldset/Fieldset.tsx
|
|
7
7
|
const Fieldset = ({ children, className, disabled, error = false, hideErrorBar = false, ref, size, ...props }) => {
|
|
8
|
-
|
|
8
|
+
const componentProps = {
|
|
9
9
|
"aria-disabled": disabled,
|
|
10
10
|
className: clsx("coop-fieldset", className),
|
|
11
11
|
"data-error": error || void 0,
|
|
12
12
|
"data-hide-error": hideErrorBar || void 0,
|
|
13
13
|
"data-size": size ?? void 0,
|
|
14
14
|
disabled,
|
|
15
|
-
...props
|
|
15
|
+
...props
|
|
16
|
+
};
|
|
17
|
+
return /* @__PURE__ */ jsx("fieldset", {
|
|
18
|
+
...componentProps,
|
|
16
19
|
ref,
|
|
17
20
|
children
|
|
18
21
|
});
|
|
19
22
|
};
|
|
20
23
|
const FieldsetFields = ({ boxed = false, children, className, orientation = "vertical", ...props }) => {
|
|
21
|
-
|
|
24
|
+
const componentProps = {
|
|
22
25
|
className: clsx("coop-fieldset-fields", className),
|
|
23
26
|
"data-boxed": boxed || void 0,
|
|
24
27
|
"data-orientation": orientation !== "vertical" ? orientation : void 0,
|
|
25
|
-
...props
|
|
28
|
+
...props
|
|
29
|
+
};
|
|
30
|
+
return /* @__PURE__ */ jsx("div", {
|
|
31
|
+
...componentProps,
|
|
26
32
|
children
|
|
27
33
|
});
|
|
28
34
|
};
|
|
@@ -2,12 +2,15 @@ import clsx from "clsx";
|
|
|
2
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
3
|
//#region src/components/Flourish/Flourish.tsx
|
|
4
4
|
const Flourish = ({ children, className, fill = "brand-blue", ref, ...props }) => {
|
|
5
|
+
const componentProps = {
|
|
6
|
+
className: clsx("coop-flourish ", className),
|
|
7
|
+
fill: `var(--color-${fill})`,
|
|
8
|
+
...props
|
|
9
|
+
};
|
|
5
10
|
return /* @__PURE__ */ jsxs("span", {
|
|
6
11
|
style: { position: "relative" },
|
|
7
12
|
children: [children, /* @__PURE__ */ jsx("svg", {
|
|
8
|
-
|
|
9
|
-
fill: `var(--color-${fill})`,
|
|
10
|
-
...props,
|
|
13
|
+
...componentProps,
|
|
11
14
|
ref,
|
|
12
15
|
viewBox: "0 0 276 10",
|
|
13
16
|
children: /* @__PURE__ */ jsx("path", { d: "M275.9 8.6c.1-1.6.2-1.8-.4-2.9.3-1-.3-1.2-1.8-1.1v-.3c.6-.4.2-.2 1.4-.1-.9-2.3-5.6-1.8-8.5-2.3C259 .5 246.3.7 237.4.5L185 .4l-33-.2-26.1-.2-67.4 1.2-44.3.5C10.7 2.1 1.5.4 0 3.3l1 .2L0 4v.5C8.2 7.9 26.6 7.2 35.6 7c5 0 13.5 1.6 16.5-.6C53.4 8 59.5 8 62 7.7l45 .1 42.8.3 30.7.3 44.2.6 27.8-.5 23 .8c.1-.8-.3-.5.5-.7ZM219 2.8v-.2l.8-.2h.4l.3.4H219Zm30-.1h1.2c-.8.4-.5.3-1.2 0Zm6.2.6.2-.4h.3l-.5.4Z" })
|