Skip to content

Commit ad789d4

Browse files
authored
Merge pull request #49 from buildo/3171079-add_feedback
#3171079: Add Feedback
2 parents 58998c2 + d50beb1 commit ad789d4

10 files changed

+379
-2
lines changed

src/Button/createButton.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { AriaButtonProps } from "@react-types/button";
66
import { useButton } from "@react-aria/button";
77
import { Label } from "../Typography/Label/Label";
88
import { BentoSprinkles, Column, Columns } from "../internal";
9-
import { IconProps } from "src";
9+
import { IconProps } from "../";
1010

1111
type Size = "small" | "medium" | "large";
1212
export type ButtonProps = {

src/Feedback/Feedback.css.ts

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import { style } from "@vanilla-extract/css";
2+
3+
export const feedbackStyle = style({
4+
width: "440px",
5+
});

src/Feedback/createFeedback.tsx

+134
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
import { FunctionComponent } from "react";
2+
import { Body, ButtonProps, Children, Display, LocalizedString } from "..";
3+
import { Box, Stack } from "../internal";
4+
import { feedbackStyle } from "./Feedback.css";
5+
import { IllustrationProps } from "../Illustrations/IllustrationProps";
6+
import { IllustrationNegative, IllustrationPositive } from "../Illustrations";
7+
8+
type Status = "positive" | "negative";
9+
10+
type Props = {
11+
title: LocalizedString;
12+
description?: LocalizedString;
13+
action?: Pick<ButtonProps, "label" | "onPress">;
14+
background?: boolean;
15+
size: "medium" | "large";
16+
} & (
17+
| {
18+
/** Use as:
19+
* ```tsx
20+
* <Feedback
21+
* illustration={IllustrationIdea}
22+
* // ...
23+
* />
24+
* ```
25+
*/
26+
illustration: (props: IllustrationProps) => Children;
27+
status?: never;
28+
}
29+
| {
30+
status: Status;
31+
illustration?: never;
32+
}
33+
);
34+
35+
type FeedbackConfig = {
36+
background: JSX.Element | null;
37+
positiveIllustration: (props: IllustrationProps) => Children;
38+
negativeIllustration: (props: IllustrationProps) => Children;
39+
};
40+
41+
/**
42+
* Feedback can render a predefined feedback status (when using the `status` prop) or render a custom illustration
43+
* (when using the `illustration` prop).
44+
*/
45+
export function createFeedback(
46+
Button: FunctionComponent<ButtonProps>,
47+
config: FeedbackConfig = {
48+
background: null,
49+
positiveIllustration: IllustrationPositive,
50+
negativeIllustration: IllustrationNegative,
51+
}
52+
) {
53+
return function Feedback({
54+
title,
55+
description,
56+
action,
57+
background,
58+
status,
59+
illustration,
60+
size,
61+
}: Props) {
62+
return (
63+
<Box className={feedbackStyle}>
64+
<Stack space={size === "large" ? 24 : 16} align="center">
65+
{renderIllustration(size, illustrationElement(status, illustration), background)}
66+
<Stack space={size === "large" ? 8 : 4}>
67+
<Display size="small" align="center">
68+
{title}
69+
</Display>
70+
{description && (
71+
<Body size="medium" align="center">
72+
{description}
73+
</Body>
74+
)}
75+
</Stack>
76+
{action && (
77+
<Button
78+
label={action.label}
79+
kind={size === "large" ? "solid" : "transparent"}
80+
hierarchy="primary"
81+
onPress={action.onPress}
82+
/>
83+
)}
84+
</Stack>
85+
</Box>
86+
);
87+
};
88+
89+
function illustrationElement(
90+
status: Props["status"],
91+
illustration: Props["illustration"]
92+
): ((props: IllustrationProps) => Children) | undefined {
93+
if (illustration) {
94+
return illustration;
95+
} else if (status) {
96+
return illustrationForStatus(status!);
97+
}
98+
return undefined;
99+
}
100+
101+
function illustrationForStatus(status: Status) {
102+
switch (status) {
103+
case "positive":
104+
return config.positiveIllustration;
105+
case "negative":
106+
return config.negativeIllustration;
107+
}
108+
}
109+
110+
function renderIllustration(
111+
size: "medium" | "large",
112+
illustration: ((props: IllustrationProps) => Children) | undefined,
113+
background: boolean | undefined
114+
): Children {
115+
const illustrationProps: IllustrationProps = {
116+
size: size === "large" ? 160 : 80,
117+
style: "color",
118+
};
119+
if (background) {
120+
// NOTE(gabro): when we have a background, the overall size of the illustration is the one of
121+
// the background so the background has position relative and the illustration has position absolute.
122+
return (
123+
<Box position="relative" width="full">
124+
<Box position="relative">{config.background}</Box>
125+
<Box position="absolute" top={40} width="full" display="flex" justifyContent="center">
126+
{illustration && illustration(illustrationProps)}
127+
</Box>
128+
</Box>
129+
);
130+
} else {
131+
return illustration && illustration(illustrationProps);
132+
}
133+
}
134+
}
+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
import { IllustrationProps } from "./IllustrationProps";
2+
import { svgIllustrationProps } from "./svgIllustrationProps";
3+
4+
export function IllustrationIdea(props: IllustrationProps) {
5+
const variants = {
6+
color: (
7+
<>
8+
<path
9+
d="M61.65 27.938a21.875 21.875 0 1 0-43.75-.363c-.063 7.675 4.625 14.637 10.6 20.363v2.312a5 5 0 0 0 5 5H46a5 5 0 0 0 5-5v-2.388c5.938-5.575 10.587-12.412 10.65-19.925Z"
10+
fill="#F9E3AE"
11+
/>
12+
<path
13+
d="M22.475 17.813a3.086 3.086 0 0 0 4.587-.2 16.25 16.25 0 0 1 25.288-.1 3.087 3.087 0 0 0 4.575.187 3.137 3.137 0 0 0 .188-4.212 22.5 22.5 0 0 0-34.863.125 3.138 3.138 0 0 0 .2 4.2h.025Z"
14+
fill="#FAEFDE"
15+
/>
16+
<path d="M42.25 74h-5v-3.75h5V74Z" fill="#ACB7D0" />
17+
<path
18+
d="M42.25 70.25h-5a7.5 7.5 0 0 1-7.5-7.5v-7.5h20v7.5a7.5 7.5 0 0 1-7.5 7.5Z"
19+
fill="#C2CDE7"
20+
/>
21+
<path
22+
d="M11 27.75a1.25 1.25 0 0 0-1.25-1.25h-7.5a1.25 1.25 0 0 0 0 2.5h7.5A1.25 1.25 0 0 0 11 27.75Zm66.25-1.25h-7.5a1.25 1.25 0 0 0 0 2.5h7.5a1.25 1.25 0 0 0 0-2.5ZM11.463 37.825 6.825 39.7a1.25 1.25 0 1 0 .938 2.313l4.637-1.875a1.25 1.25 0 0 0-.938-2.313Zm56.1-20.075c.158 0 .315-.03.462-.087l4.637-1.876a1.25 1.25 0 0 0-.937-2.312l-4.637 1.875a1.25 1.25 0 0 0 .475 2.4ZM12.4 15.35l-4.638-1.875a1.25 1.25 0 1 0-.937 2.313l4.638 1.875a1.25 1.25 0 0 0 .937-2.313ZM72.675 39.7l-4.638-1.875a1.25 1.25 0 1 0-.937 2.313l4.638 1.875a1.25 1.25 0 0 0 .937-2.313Zm-28.813-7.838-5 5a1.25 1.25 0 0 0-.362.888v7.5a1.25 1.25 0 0 0 2.5 0v-6.987l4.638-4.638a1.25 1.25 0 0 0-1.763-1.762h-.013Z"
23+
fill="#8D6C9F"
24+
/>
25+
<path
26+
d="M39.75 4A23.75 23.75 0 0 0 16 27.75c0 6.25 3.475 10.862 6.837 15.35 2.688 3.6 5.226 7.012 5.663 10.9v8.75A8.75 8.75 0 0 0 36 71.4v1.35a2.5 2.5 0 0 0 2.5 2.5H41a2.5 2.5 0 0 0 2.5-2.5V71.4a8.75 8.75 0 0 0 7.5-8.65v-7.625c0-4.375 2.775-8.087 5.712-12.025C60.05 38.612 63.5 34 63.5 27.75A23.75 23.75 0 0 0 39.75 4ZM31 56.5h17.5v1.4L31 60.088V56.5Zm10 16.25h-2.5V71.5H41v1.25ZM42.25 69h-5A6.25 6.25 0 0 1 31 62.75v-.15l17.5-2.188V62.9l-12.712 1.587a1.252 1.252 0 0 0 .15 2.5h.162l11.737-1.462A6.25 6.25 0 0 1 42.25 69Zm12.5-27.388c-2.8 3.75-5.7 7.663-6.15 12.313H41V50.25a1.25 1.25 0 0 0-2.5 0v3.675H31c-.45-4.662-3.363-8.55-6.25-12.325-3.025-4.163-6.25-8.462-6.25-13.85a21.25 21.25 0 1 1 42.5 0c0 5.388-3.2 9.7-6.25 13.862Z"
27+
fill="#8D6C9F"
28+
/>
29+
<path
30+
d="m38.138 34.362-2.5-2.5a1.25 1.25 0 0 0-1.763 1.763l2.5 2.5a1.25 1.25 0 0 0 1.763-1.763Zm10.65-21.612a1.25 1.25 0 0 0-1.25 2.137 14.998 14.998 0 0 1 2.85 2.238 1.25 1.25 0 0 0 1.737-1.75 17.501 17.501 0 0 0-3.337-2.625Zm-6.313.25a1.27 1.27 0 1 0 .45-2.5 17.425 17.425 0 0 0-12.787 2.625 1.267 1.267 0 0 0 .422 2.3 1.265 1.265 0 0 0 .953-.175A15 15 0 0 1 42.474 13Z"
31+
fill="#8D6C9F"
32+
/>
33+
</>
34+
),
35+
outline: (
36+
<path d="M39.75 4C26.654 4 16 14.654 16 27.75c0 6.216 3.477 10.86 6.84 15.352C25.527 46.69 28.057 50.108 28.5 54v8.75c0 4.4 3.267 8.042 7.5 8.652v1.348c0 1.377 1.123 2.5 2.5 2.5H41c1.377 0 2.5-1.123 2.5-2.5v-1.348c4.233-.61 7.5-4.253 7.5-8.652v-7.627c.02-4.37 2.778-8.086 5.703-12.021 3.345-4.493 6.797-9.136 6.797-15.352C63.5 14.654 52.846 4 39.75 4Zm0 2.5C51.469 6.5 61 16.031 61 27.75c0 5.39-3.203 9.697-6.299 13.862-2.803 3.77-5.693 7.652-6.142 12.31H41V50.25c0-.688-.562-1.25-1.25-1.25s-1.25.562-1.25 1.25v3.677h-7.466c-.454-4.658-3.369-8.55-6.191-12.325-3.12-4.164-6.343-8.466-6.343-13.852 0-11.719 9.531-21.25 21.25-21.25Zm-.17 3.745c-3.34.03-6.602 1.01-9.44 2.876a1.244 1.244 0 0 0-.35 1.729c.238.366.634.561 1.04.561.238 0 .473-.063.688-.205 3.237-2.129 7.129-2.91 10.962-2.207a1.25 1.25 0 0 0 .454-2.456 17.316 17.316 0 0 0-3.355-.298Zm8.744 2.349a1.264 1.264 0 0 0-1.25.59 1.25 1.25 0 0 0 .43 1.72 14.986 14.986 0 0 1 2.852 2.24 1.253 1.253 0 0 0 1.772 0 1.25 1.25 0 0 0 0-1.767 17.683 17.683 0 0 0-3.335-2.612 1.296 1.296 0 0 0-.469-.171ZM7.28 13.39a1.26 1.26 0 0 0-1.142.78c-.254.64.053 1.373.693 1.627l4.639 1.875c.151.063.307.093.464.093.493 0 .966-.298 1.162-.782a1.254 1.254 0 0 0-.694-1.63l-4.633-1.876a1.235 1.235 0 0 0-.489-.087Zm64.942 0a1.235 1.235 0 0 0-.489.087L67.1 15.352c-.64.26-.953.987-.694 1.631.196.484.67.782 1.162.782.157 0 .313-.03.464-.093l4.639-1.875c.64-.254.947-.987.693-1.626a1.26 1.26 0 0 0-1.142-.781ZM2.25 26.5c-.688 0-1.25.561-1.25 1.25S1.562 29 2.25 29h7.5c.688 0 1.25-.561 1.25-1.25s-.562-1.25-1.25-1.25h-7.5Zm67.5 0c-.689 0-1.25.561-1.25 1.25S69.061 29 69.75 29h7.5c.689 0 1.25-.561 1.25-1.25s-.561-1.25-1.25-1.25h-7.5Zm-35 5a1.25 1.25 0 0 0-.884 2.134l2.5 2.5c.244.244.562.366.884.366a1.25 1.25 0 0 0 .884-2.134l-2.5-2.5a1.25 1.25 0 0 0-.884-.366Zm10 0c-.317 0-.64.122-.884.366l-5 5a1.25 1.25 0 0 0-.366.884v7.5c0 .688.562 1.25 1.25 1.25S41 45.938 41 45.25v-6.982l4.634-4.634a1.25 1.25 0 0 0-.884-2.134Zm-32.793 6.235c-.166 0-.332.03-.488.093L6.83 39.703c-.64.254-.947.986-.693 1.626a1.256 1.256 0 0 0 1.63.694l4.634-1.876c.64-.258.953-.986.694-1.63a1.258 1.258 0 0 0-1.138-.782Zm55.586.005c-.483.01-.942.303-1.138.782-.258.64.054 1.372.694 1.63l4.633 1.87c.152.064.313.088.47.088.492 0 .961-.293 1.161-.78a1.254 1.254 0 0 0-.693-1.627l-4.639-1.875a1.202 1.202 0 0 0-.488-.088ZM31 56.5h17.5v1.397L31 60.084V56.5Zm17.5 3.916v2.334c0 .049-.015.098-.015.151L35.79 64.488a1.24 1.24 0 0 0-1.08 1.392 1.244 1.244 0 0 0 1.236 1.094c.054 0 .103 0 .157-.01l11.733-1.465C46.816 67.565 44.706 69 42.25 69h-5A6.256 6.256 0 0 1 31 62.75v-.147l17.5-2.187ZM38.5 71.5H41v1.25h-2.5V71.5Z" />
37+
),
38+
};
39+
return <svg {...svgIllustrationProps(props)}>{variants[props.style]}</svg>;
40+
}
+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
import { IllustrationProps } from "./IllustrationProps";
2+
import { svgIllustrationProps } from "./svgIllustrationProps";
3+
4+
export function IllustrationNegative(props: IllustrationProps) {
5+
const variants = {
6+
color: (
7+
<>
8+
<path d="M40.25 6.5a35 35 0 1 0 0 70 35 35 0 0 0 0-70Z" fill="#ED7899" />
9+
<path
10+
d="M40.25 5.25c-19.33 0-35 15.67-35 35s15.67 35 35 35 35-15.67 35-35-15.67-35-35-35Zm0 62.5c-15.188 0-27.5-12.313-27.5-27.5 0-15.188 12.313-27.5 27.5-27.5a27.409 27.409 0 0 1 19.814 8.43 27.392 27.392 0 0 1 7.686 19.07c0 15.188-12.313 27.5-27.5 27.5Z"
11+
fill="#F9E3AE"
12+
/>
13+
<path
14+
d="M40.25 67.75c-15.188 0-27.5-12.313-27.5-27.5h-2.076c-3.114 0-5.451 2.813-4.931 5.883C8.539 62.66 22.925 75.25 40.25 75.25s31.711-12.589 34.507-29.117c.52-3.07-1.817-5.883-4.93-5.883H67.75c0 15.188-12.313 27.5-27.5 27.5Z"
15+
fill="#F6D397"
16+
/>
17+
<path
18+
d="M40.25 4C20.262 4 4 20.261 4 40.25S20.262 76.5 40.25 76.5c19.987 0 36.25-16.261 36.25-36.25S60.237 4 40.25 4Zm0 70C21.64 74 6.5 58.86 6.5 40.25S21.64 6.5 40.25 6.5 74 21.64 74 40.25 58.86 74 40.25 74Z"
19+
fill="#8D6C9F"
20+
/>
21+
<path
22+
d="M40.25 64c-.691 0-1.25.56-1.25 1.25v2.5a1.25 1.25 0 1 0 2.5 0v-2.5c0-.69-.559-1.25-1.25-1.25Zm7.516.096a1.25 1.25 0 0 0-2.415.647L46 67.16a1.25 1.25 0 1 0 2.415-.648l-.648-2.415Zm-19.078-3.195a1.252 1.252 0 0 0-1.708.458l-1.25 2.165a1.25 1.25 0 0 0 2.165 1.25l1.25-2.165a1.249 1.249 0 0 0-.457-1.708Zm24.832.459a1.25 1.25 0 0 0-2.165 1.25l1.25 2.165a1.25 1.25 0 1 0 2.165-1.25l-1.25-2.165Zm-19.255 1.852a1.25 1.25 0 0 0-1.531.884l-.648 2.415a1.25 1.25 0 0 0 2.415.648l.648-2.415a1.25 1.25 0 0 0-.884-1.532Z"
23+
fill="#8D6C9F"
24+
/>
25+
<path
26+
d="m51.74 49.972-9.723-9.722 9.723-9.723a1.249 1.249 0 1 0-1.768-1.767l-9.722 9.723-9.723-9.723a1.249 1.249 0 1 0-1.767 1.767l9.723 9.723-9.723 9.722a1.249 1.249 0 0 0 .884 2.134c.32 0 .64-.122.884-.366l9.722-9.723 9.722 9.723a1.246 1.246 0 0 0 1.768 0 1.249 1.249 0 0 0 0-1.768Z"
27+
fill="#FAEFDE"
28+
/>
29+
<path
30+
d="M49.439 15.652c.891.334 1.775.72 2.625 1.15a1.252 1.252 0 0 0 1.679-.553 1.25 1.25 0 0 0-.553-1.679c-.93-.47-1.899-.894-2.876-1.259a1.249 1.249 0 1 0-.875 2.341ZM21.687 21.69c5.935-5.935 14.436-8.687 22.735-7.358a1.25 1.25 0 1 0 .397-2.468A28.85 28.85 0 0 0 19.92 19.92c-11.209 11.209-11.209 29.449 0 40.657a1.247 1.247 0 0 0 1.768 0 1.249 1.249 0 0 0 0-1.767c-10.235-10.234-10.235-26.886-.002-37.121ZM60.58 19.92a28.944 28.944 0 0 0-2.617-2.32 1.25 1.25 0 0 0-1.543 1.968c.835.654 1.64 1.367 2.392 2.12 10.236 10.235 10.236 26.887 0 37.122a1.249 1.249 0 1 0 1.768 1.768c11.207-11.209 11.207-29.449 0-40.658Z"
31+
fill="#8D6C9F"
32+
/>
33+
</>
34+
),
35+
outline: (
36+
<path d="M40.25 4C20.265 4 4 20.26 4 40.25S20.265 76.5 40.25 76.5 76.5 60.24 76.5 40.25 60.235 4 40.25 4Zm0 2.5C58.858 6.5 74 21.642 74 40.25S58.858 74 40.25 74 6.5 58.858 6.5 40.25 21.642 6.5 40.25 6.5Zm-.547 5.01c-7.363.146-14.502 3.13-19.785 8.408-11.206 11.21-11.206 29.448 0 40.66.244.243.566.365.884.365a1.25 1.25 0 0 0 .889-2.134c-10.24-10.234-10.235-26.884 0-37.119 5.932-5.937 14.433-8.686 22.734-7.358a1.248 1.248 0 0 0 1.43-1.035 1.25 1.25 0 0 0-1.035-1.436 28.188 28.188 0 0 0-5.117-.351Zm10.117 1.723c-.483.02-.932.327-1.113.81-.244.65.083 1.368.733 1.612a27.17 27.17 0 0 1 2.626 1.143c.181.093.371.137.562.137.454 0 .894-.25 1.118-.689a1.257 1.257 0 0 0-.556-1.68c-.928-.468-1.9-.888-2.877-1.255a1.321 1.321 0 0 0-.493-.078Zm7.222 4.112a1.248 1.248 0 0 0-.62 2.221 25.876 25.876 0 0 1 2.388 2.124c10.239 10.235 10.239 26.885 0 37.12a1.255 1.255 0 0 0 0 1.772c.244.24.566.366.888.366.318 0 .64-.127.884-.366 11.206-11.21 11.206-29.453 0-40.664a30.219 30.219 0 0 0-2.617-2.32 1.266 1.266 0 0 0-.923-.253Zm-27.398 11.05a1.25 1.25 0 0 0-.883 2.133l9.721 9.722-9.721 9.722a1.25 1.25 0 1 0 1.767 1.767l9.722-9.721 9.722 9.721c.244.244.561.367.883.367a1.25 1.25 0 0 0 .884-2.134l-9.721-9.722 9.721-9.722a1.25 1.25 0 1 0-1.767-1.767l-9.722 9.721-9.722-9.721a1.25 1.25 0 0 0-.883-.366ZM28.22 60.742a1.24 1.24 0 0 0-1.236.615l-1.25 2.168a1.246 1.246 0 0 0 .454 1.705 1.244 1.244 0 0 0 1.704-.454l1.25-2.169a1.248 1.248 0 0 0-.922-1.865Zm24.062 0c-.16.02-.322.073-.468.156-.601.347-.801 1.114-.455 1.714l1.25 2.163a1.244 1.244 0 0 0 1.705.455c.6-.342.8-1.109.454-1.705l-1.25-2.163a1.252 1.252 0 0 0-1.236-.62Zm-18.51 2.437a1.259 1.259 0 0 0-1.04.918l-.645 2.417a1.25 1.25 0 0 0 2.417.644l.65-2.417a1.252 1.252 0 0 0-.884-1.528 1.16 1.16 0 0 0-.498-.034Zm12.963 0a1.182 1.182 0 0 0-.503.034 1.252 1.252 0 0 0-.883 1.528l.65 2.417a1.254 1.254 0 0 0 1.532.884 1.25 1.25 0 0 0 .884-1.528l-.645-2.417a1.26 1.26 0 0 0-1.035-.918ZM40.25 64A1.25 1.25 0 0 0 39 65.25v2.5a1.25 1.25 0 1 0 2.5 0v-2.5A1.25 1.25 0 0 0 40.25 64Z" />
37+
),
38+
};
39+
return <svg {...svgIllustrationProps(props)}>{variants[props.style]}</svg>;
40+
}
+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
import { IllustrationProps } from "./IllustrationProps";
2+
import { svgIllustrationProps } from "./svgIllustrationProps";
3+
4+
export function IllustrationPositive(props: IllustrationProps) {
5+
const variants = {
6+
color: (
7+
<>
8+
<path d="M40.25 5.25a35 35 0 1 0 0 70 35 35 0 0 0 0-70Z" fill="#72CAAF" />
9+
<path
10+
d="M40.25 5.25a35 35 0 1 0 0 70 35 35 0 0 0 0-70Zm0 62.5a27.5 27.5 0 1 1 18.962-47.413l.85.838c.326.333.638.675.938 1.025a27.5 27.5 0 0 1-20.75 45.55Z"
11+
fill="#F9E3AE"
12+
/>
13+
<path
14+
d="M40.25 67.75a27.5 27.5 0 0 1-27.5-27.5h-2.075a5 5 0 0 0-4.938 5.888 35 35 0 0 0 69.013 0 5 5 0 0 0-4.925-5.888H67.75a27.5 27.5 0 0 1-27.5 27.5Z"
15+
fill="#F6D397"
16+
/>
17+
<path
18+
d="M40.25 4a36.25 36.25 0 1 0 0 72.5 36.25 36.25 0 0 0 0-72.5Zm0 70a33.75 33.75 0 1 1 0-67.5 33.75 33.75 0 0 1 0 67.5Z"
19+
fill="#8D6C9F"
20+
/>
21+
<path
22+
d="M40.25 64A1.25 1.25 0 0 0 39 65.25v2.5a1.25 1.25 0 0 0 2.5 0v-2.5A1.25 1.25 0 0 0 40.25 64Zm7.5.1a1.25 1.25 0 0 0-2.413.65l.65 2.412a1.256 1.256 0 1 0 2.425-.662l-.662-2.4Zm-19.063-3.2a1.25 1.25 0 0 0-1.712.462l-1.25 2.163a1.25 1.25 0 0 0 2.162 1.25l1.25-2.163a1.251 1.251 0 0 0-.45-1.712Zm24.838.462a1.25 1.25 0 0 0-2.163 1.25l1.25 2.163a1.25 1.25 0 1 0 2.163-1.25l-1.25-2.163Zm-19.262 1.85a1.25 1.25 0 0 0-1.526.888l-.65 2.4a1.25 1.25 0 1 0 2.413.65l.65-2.413a1.25 1.25 0 0 0-.887-1.524Z"
23+
fill="#8D6C9F"
24+
/>
25+
<path
26+
d="M54.362 29.363 36.5 47.236l-9.113-9.112a1.25 1.25 0 0 0-1.762 1.763l10 10a1.25 1.25 0 0 0 1.763 0l18.75-18.75a1.25 1.25 0 0 0-1.763-1.763l-.013-.012Z"
27+
fill="#FAEFDE"
28+
/>
29+
<path
30+
d="M49.438 15.65c.895.335 1.771.72 2.624 1.15.175.09.367.136.563.137a1.25 1.25 0 0 0 .563-2.362 28.396 28.396 0 0 0-2.876-1.25 1.25 1.25 0 0 0-.874 2.338v-.013Zm-27.75 6.037a26.338 26.338 0 0 1 22.737-7.35 1.266 1.266 0 0 0 .4-2.5 28.75 28.75 0 0 0-24.9 48.75 1.25 1.25 0 0 0 1.762-1.762 26.25 26.25 0 0 1 0-37.138Zm38.887-1.762a28.95 28.95 0 0 0-2.613-2.325 1.248 1.248 0 0 0-2.052.61 1.25 1.25 0 0 0 .515 1.352c.838.66 1.635 1.37 2.388 2.125a26.252 26.252 0 0 1 0 37.126 1.252 1.252 0 0 0 .357 2.113 1.252 1.252 0 0 0 1.405-.351 28.75 28.75 0 0 0 0-40.65Z"
31+
fill="#8D6C9F"
32+
/>
33+
</>
34+
),
35+
outline: (
36+
<path d="M40.25 4C20.265 4 4 20.265 4 40.25S20.265 76.5 40.25 76.5 76.5 60.235 76.5 40.25 60.235 4 40.25 4Zm0 2.5C58.858 6.5 74 21.642 74 40.25S58.858 74 40.25 74 6.5 58.858 6.5 40.25 21.642 6.5 40.25 6.5Zm-.547 5.01c-7.363.151-14.502 3.125-19.785 8.408-11.206 11.21-11.206 29.448 0 40.66.244.243.566.365.884.365a1.25 1.25 0 0 0 .889-2.134c-10.24-10.234-10.235-26.884 0-37.119 5.932-5.937 14.433-8.691 22.734-7.358a1.25 1.25 0 0 0 .395-2.47 28.697 28.697 0 0 0-5.117-.352Zm10.122 1.723c-.488.02-.937.327-1.118.81-.244.65.083 1.368.733 1.612.888.332 1.767.713 2.626 1.143.181.093.371.137.562.137.454 0 .894-.25 1.118-.689a1.258 1.258 0 0 0-.556-1.68 30.046 30.046 0 0 0-2.877-1.26 1.306 1.306 0 0 0-.488-.073Zm7.217 4.112a1.245 1.245 0 0 0-.62 2.222c.835.654 1.64 1.372 2.388 2.123 10.239 10.235 10.239 26.885 0 37.12a1.255 1.255 0 0 0 0 1.772c.244.24.566.366.888.366.318 0 .64-.127.884-.366 11.206-11.21 11.206-29.453 0-40.664a30.219 30.219 0 0 0-2.617-2.32 1.266 1.266 0 0 0-.923-.253ZM55.25 29c-.317 0-.64.122-.884.366L36.5 47.232l-9.116-9.116a1.25 1.25 0 1 0-1.768 1.768l10 10c.244.244.562.366.884.366.322 0 .64-.122.884-.366l18.75-18.75A1.25 1.25 0 0 0 55.25 29ZM28.219 60.743a1.24 1.24 0 0 0-1.236.615l-1.25 2.164a1.25 1.25 0 0 0 .454 1.709 1.249 1.249 0 0 0 1.705-.46l1.25-2.163a1.248 1.248 0 0 0-.923-1.865Zm24.062 0c-.16.02-.322.073-.468.156-.601.347-.801 1.114-.455 1.714l1.25 2.163a1.244 1.244 0 0 0 1.705.455c.6-.347.8-1.109.454-1.705l-1.25-2.163a1.252 1.252 0 0 0-1.236-.62Zm-18.51 2.437a1.259 1.259 0 0 0-1.04.918l-.645 2.417a1.25 1.25 0 0 0 .884 1.528c.107.03.215.039.327.039.547 0 1.055-.366 1.206-.923l.65-2.417a1.252 1.252 0 0 0-.884-1.528 1.236 1.236 0 0 0-.498-.034Zm12.963 0a1.266 1.266 0 0 0-.503.034 1.252 1.252 0 0 0-.883 1.528l.65 2.417a1.25 1.25 0 0 0 1.205.923c.112 0 .22-.01.327-.039a1.25 1.25 0 0 0 .884-1.528l-.645-2.417a1.26 1.26 0 0 0-1.035-.918ZM40.25 64c-.693 0-1.25.557-1.25 1.25v2.5c0 .693.557 1.25 1.25 1.25s1.25-.557 1.25-1.25v-2.5c0-.693-.557-1.25-1.25-1.25Z" />
37+
),
38+
};
39+
return <svg {...svgIllustrationProps(props)}>{variants[props.style]}</svg>;
40+
}

src/Illustrations/index.ts

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
export * from "./IllustrationIdea";
2+
export * from "./IllustrationNegative";
3+
export * from "./IllustrationPositive";
4+
export * from "./IllustrationProps";

0 commit comments

Comments
 (0)