@granto-umbrella/umbrella-components 3.0.27 → 3.0.28

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": "@granto-umbrella/umbrella-components",
3
- "version": "3.0.27",
3
+ "version": "3.0.28",
4
4
  "description": "Umbrella Components for React",
5
5
  "type": "module",
6
6
  "main": "src/index.js",
@@ -1,20 +1,20 @@
1
1
  import styled from "styled-components";
2
2
  import {
3
+ primitiveSizes,
3
4
  semanticColors,
4
5
  typographyTokens,
5
6
  } from "../../../styles/tokens";
6
7
 
7
- export const StyledText = styled.p<{
8
- $size: string;
9
- $weight: string;
10
- $color: string;
11
- }>`
12
- font-size: ${({ $size }) =>
13
- $size === "lg"
14
- ? typographyTokens.fontSizes.bodyL
15
- : $size === "md"
16
- ? typographyTokens.fontSizes.bodyM
17
- : typographyTokens.fontSizes.bodyL};
18
- font-weight: ${({ $weight }) => ($weight === "bold" ? "bold" : "normal")};
19
- color: ${({ $color }) => $color || semanticColors.base.text};
8
+
9
+ export const Container = styled.div<{ disabled?: boolean }>`
10
+ font-size: ${typographyTokens.fontSizes.labelS};
11
+ color: ${({ disabled }) =>
12
+ disabled
13
+ ? semanticColors.branding.text.accent.disabled
14
+ : semanticColors.branding.text.accent.enabled};
15
+ text-decoration: none;
16
+ margin-top: ${primitiveSizes.size.x12};
17
+ cursor: ${({ disabled }) => (disabled ? "not-allowed" : "pointer")};
18
+ opacity: ${({ disabled }) => (disabled ? 0.5 : 1)};
19
+ pointer-events: ${({ disabled }) => (disabled ? "none" : "auto")};
20
20
  `;
@@ -1,16 +1,21 @@
1
1
  import React from "react";
2
- import { StyledText } from "./ResendLink.styles";
2
+ import { Container } from "./ResendLink.styles";
3
3
  import { ResendLinkProps } from "./ResendLink.types";
4
4
 
5
- export const ResendLink: React.FC<ResendLinkProps> = ({
6
- children,
7
- size = "md",
8
- weight = "normal",
9
- color = "black",
5
+ export const ResendLink: React.FC<ResendLinkProps> = ({
6
+ children,
7
+ onClick,
8
+ disabled,
9
+ testId
10
10
  }) => {
11
11
  return (
12
- <StyledText $size={size} $weight={weight} $color={color}>
12
+ <Container
13
+ data-testid={testId}
14
+ id={testId}
15
+ onClick={!disabled ? onClick : undefined}
16
+ disabled={disabled}
17
+ >
13
18
  {children}
14
- </StyledText>
19
+ </Container>
15
20
  );
16
21
  };
@@ -1,9 +1,9 @@
1
1
  import React from "react";
2
2
 
3
- export interface ResendLinkProps{
4
- children: React.ReactNode;
5
- size?: "sm" | "md" | "lg";
6
- weight?: "normal" | "bold";
7
- color?: string;
3
+ export interface ResendLinkProps {
4
+ children: React.ReactNode;
5
+ onClick: () => void;
6
+ disabled?: boolean;
7
+ testId?: string;
8
8
  }
9
9