@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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lets-events/react",
3
- "version": "12.6.0",
3
+ "version": "12.6.2",
4
4
  "description": "",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",
@@ -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
- {loading ? (
37
- <SpinningDiv>
38
- <Icon name="circle-notch" size={spinnerSize} />
39
- </SpinningDiv>
40
- ) : (
41
- children
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
  }
@@ -278,6 +278,13 @@ export const ButtonStyled = styled(ButtonRadix, {
278
278
  borderRadius: "$full",
279
279
  },
280
280
  },
281
+ isCircle: {
282
+ true: {
283
+ borderRadius: "$full",
284
+ padding: 0,
285
+ aspectRatio: "1",
286
+ },
287
+ },
281
288
  },
282
289
 
283
290
  compoundVariants: [
@@ -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
- {options.map((option) => (
72
- <label key={option.value}>
73
- <RadioItem value={option.value} />
74
- {option.label}
75
- </label>
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
- <Text
20
- typography={"labelMedium"}
21
- fontWeight={"medium"}
22
- color={haveError ? "error600" : "dark700"}
23
- id={`${name}-label`}
24
- >
25
- {label}
26
- {!required && <Text color="dark500"> (opcional)</Text>}
27
- </Text>
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
  };