@lets-events/react 12.6.0 → 12.6.2
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/.turbo/turbo-build.log +8 -13
- package/CHANGELOG.md +12 -0
- package/dist/index.d.mts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +195 -167
- package/dist/index.mjs +269 -241
- package/package.json +1 -1
- package/src/components/Button/index.tsx +24 -7
- package/src/components/Button/styledComponents.ts +7 -0
- package/src/components/FormFields/RadioGroupFormField.tsx +8 -6
- package/src/components/FormFields/subComponents/FormLabel.tsx +16 -9
package/package.json
CHANGED
|
@@ -3,6 +3,7 @@ import { ButtonStyled, SpinningDiv } from "./styledComponents";
|
|
|
3
3
|
import { Button as ButtonRadix } from "@radix-ui/themes";
|
|
4
4
|
import type { VariantProps } from "@stitches/react";
|
|
5
5
|
import Icon, { IconProps } from "../Icon";
|
|
6
|
+
import { Flex } from "../Flex";
|
|
6
7
|
|
|
7
8
|
type ButtonVariantProps = VariantProps<typeof ButtonStyled>;
|
|
8
9
|
export interface ButtonProps
|
|
@@ -33,13 +34,29 @@ export function Button({ asChild, children, loading, ...props }: ButtonProps) {
|
|
|
33
34
|
|
|
34
35
|
return (
|
|
35
36
|
<ButtonStyled as={Component} {...props} disabled={disabled || loading}>
|
|
36
|
-
{
|
|
37
|
-
<
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
37
|
+
<div style={{ position: "relative" }}>
|
|
38
|
+
<Flex
|
|
39
|
+
justify={"center"}
|
|
40
|
+
align={"center"}
|
|
41
|
+
css={{ visibility: loading ? "hidden" : undefined }}
|
|
42
|
+
>
|
|
43
|
+
{children}
|
|
44
|
+
</Flex>
|
|
45
|
+
{loading && (
|
|
46
|
+
<div
|
|
47
|
+
style={{
|
|
48
|
+
position: "absolute",
|
|
49
|
+
top: "50%",
|
|
50
|
+
left: "50%",
|
|
51
|
+
transform: "translate(-50%, -50%)",
|
|
52
|
+
}}
|
|
53
|
+
>
|
|
54
|
+
<SpinningDiv>
|
|
55
|
+
<Icon name="circle-notch" size={spinnerSize} />
|
|
56
|
+
</SpinningDiv>
|
|
57
|
+
</div>
|
|
58
|
+
)}
|
|
59
|
+
</div>
|
|
43
60
|
</ButtonStyled>
|
|
44
61
|
);
|
|
45
62
|
}
|
|
@@ -4,6 +4,7 @@ import { FormLabel } from "./subComponents/FormLabel";
|
|
|
4
4
|
import { ErrorFormMessage } from "./subComponents/ErrorFormMessage";
|
|
5
5
|
import { RadioGroup, RadioItem } from "../RadioGroup";
|
|
6
6
|
import { getNestedValue } from "../../utils/getNestedValue";
|
|
7
|
+
import { Text } from "../Text";
|
|
7
8
|
|
|
8
9
|
type Option = {
|
|
9
10
|
label: string;
|
|
@@ -68,12 +69,13 @@ export const RadioGroupFormField = ({
|
|
|
68
69
|
fontWeight={fontWeight}
|
|
69
70
|
disabled={disabled}
|
|
70
71
|
>
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
<RadioItem value={option.value}
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
72
|
+
<Flex direction="column">
|
|
73
|
+
{options.map((option) => (
|
|
74
|
+
<RadioItem key={option.value} value={option.value}>
|
|
75
|
+
<Text typography={"labelSmall"}>{option.label}</Text>
|
|
76
|
+
</RadioItem>
|
|
77
|
+
))}
|
|
78
|
+
</Flex>
|
|
77
79
|
</RadioGroup>
|
|
78
80
|
)}
|
|
79
81
|
/>
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
+
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
|
1
2
|
import { Text } from "../../Text";
|
|
3
|
+
import { faAsterisk } from "@fortawesome/free-solid-svg-icons";
|
|
4
|
+
import { Flex } from "../../Flex";
|
|
2
5
|
|
|
3
6
|
export type FormLabelProps = {
|
|
4
7
|
name: string;
|
|
@@ -16,14 +19,18 @@ export const FormLabel = ({
|
|
|
16
19
|
if (!label) return null;
|
|
17
20
|
|
|
18
21
|
return (
|
|
19
|
-
<
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
22
|
+
<Flex align={"start"} gap={6}>
|
|
23
|
+
<Text
|
|
24
|
+
typography={"labelMedium"}
|
|
25
|
+
fontWeight={"medium"}
|
|
26
|
+
color={haveError ? "error600" : "dark700"}
|
|
27
|
+
id={`${name}-label`}
|
|
28
|
+
>
|
|
29
|
+
{label}
|
|
30
|
+
</Text>
|
|
31
|
+
{required && (
|
|
32
|
+
<FontAwesomeIcon icon={faAsterisk} fontSize={"8px"} color="#AD1F2B" />
|
|
33
|
+
)}
|
|
34
|
+
</Flex>
|
|
28
35
|
);
|
|
29
36
|
};
|