@soul-refiner/design-system 0.2.2 → 0.2.3
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.
|
@@ -9,6 +9,7 @@ export interface ButtonProps extends NativeProps, React.PropsWithChildren {
|
|
|
9
9
|
as?: React.ElementType;
|
|
10
10
|
disabled?: boolean;
|
|
11
11
|
fluid?: boolean;
|
|
12
|
+
href?: string;
|
|
12
13
|
icon?: React.ReactElement | undefined;
|
|
13
14
|
isDropdownOpen?: boolean;
|
|
14
15
|
roundness?: ButtonShape;
|
|
@@ -16,5 +17,5 @@ export interface ButtonProps extends NativeProps, React.PropsWithChildren {
|
|
|
16
17
|
sx?: string;
|
|
17
18
|
type?: ButtonTypes;
|
|
18
19
|
}
|
|
19
|
-
export declare const Button: ({ as, children, disabled, fluid, icon, isDropdownOpen, roundness, size, sx, type, ...props }: ButtonProps) => React.JSX.Element;
|
|
20
|
+
export declare const Button: ({ as, children, disabled, fluid, href, icon, isDropdownOpen, roundness, size, sx, type, ...props }: ButtonProps) => React.JSX.Element;
|
|
20
21
|
export {};
|
|
@@ -14,7 +14,7 @@ const SM_ICON_SIZE = 16;
|
|
|
14
14
|
const SM_FONT_SIZE = 14;
|
|
15
15
|
const SM_PADDING = '5px 15px';
|
|
16
16
|
const SM_PADDING_WO_CHILDREN = '7px';
|
|
17
|
-
export const Button = ({ as = 'button', children, disabled, fluid = false, icon, isDropdownOpen, roundness = 'large', size = 'large', sx, type = 'primary', ...props }) => {
|
|
17
|
+
export const Button = ({ as = 'button', children, disabled, fluid = false, href, icon, isDropdownOpen, roundness = 'large', size = 'large', sx, type = 'primary', ...props }) => {
|
|
18
18
|
const Component = Components()[type];
|
|
19
19
|
const buttonIcon = React.Children.map(icon, (item) => {
|
|
20
20
|
if (React.isValidElement(item))
|
|
@@ -37,7 +37,7 @@ export const Button = ({ as = 'button', children, disabled, fluid = false, icon,
|
|
|
37
37
|
: size === 'large'
|
|
38
38
|
? LG_PADDING_WO_CHILDREN
|
|
39
39
|
: SM_PADDING_WO_CHILDREN;
|
|
40
|
-
return (React.createElement(Component, { as: as, disabled: disabled, "$align": "center", "$display": "flex", "$fluid": fluid, "$gap": size === 'large' ? 12 : 8, "$hasChildren": !!children, "$justify": "center", "$padding": padding, "$roundness": roundness, "$size": size, "$sx": sx, ...props },
|
|
40
|
+
return (React.createElement(Component, { as: as, disabled: disabled, href: href, "$align": "center", "$display": "flex", "$fluid": fluid, "$gap": size === 'large' ? 12 : 8, "$hasChildren": !!children, "$justify": "center", "$padding": padding, "$roundness": roundness, "$size": size, "$sx": sx, ...props },
|
|
41
41
|
buttonIcon,
|
|
42
42
|
children && (React.createElement(P, { as: "span", "$mediumBold": true, "$fontSize": size === 'large' ? LG_FONT_SIZE : SM_FONT_SIZE, "$color": "inherit" }, children)),
|
|
43
43
|
!!children && dropdownIcon));
|
|
@@ -2,10 +2,11 @@ import React from 'react';
|
|
|
2
2
|
export interface ActionCardProps {
|
|
3
3
|
actions: React.ReactElement | React.ReactElement[];
|
|
4
4
|
content: string;
|
|
5
|
+
href?: string;
|
|
5
6
|
image: string;
|
|
6
7
|
logo: React.ReactElement;
|
|
7
8
|
subtitle: string;
|
|
8
9
|
sx?: string;
|
|
9
10
|
title: string;
|
|
10
11
|
}
|
|
11
|
-
export declare const ActionCard: ({ actions, content, image, logo, subtitle, sx, title, }: ActionCardProps) => React.JSX.Element;
|
|
12
|
+
export declare const ActionCard: ({ actions, content, href, image, logo, subtitle, sx, title, }: ActionCardProps) => React.JSX.Element;
|
|
@@ -2,16 +2,19 @@
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import styled from 'styled-components';
|
|
4
4
|
import { Box, H, P } from '../../';
|
|
5
|
-
export const ActionCard = ({ actions, content, image, logo, subtitle, sx, title, }) => {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
React.createElement(
|
|
9
|
-
React.createElement(
|
|
10
|
-
React.createElement(
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
5
|
+
export const ActionCard = ({ actions, content, href, image, logo, subtitle, sx, title, }) => {
|
|
6
|
+
const isAnchor = !!href;
|
|
7
|
+
return (React.createElement(Wrapper, { as: isAnchor ? 'a' : 'div' },
|
|
8
|
+
React.createElement(Action, { "$backgroundImage": image, "$sx": sx },
|
|
9
|
+
React.createElement("img", { src: image, alt: "" }),
|
|
10
|
+
React.createElement(Figcaption, null,
|
|
11
|
+
React.createElement(LogoWrapper, null, logo),
|
|
12
|
+
React.createElement(H, { as: "span", "$mediumBold": true, "$color": "grey-2", "$fontSize": 18, "$lineHeight": 26 }, title),
|
|
13
|
+
React.createElement(P, { as: "span", "$color": "grey-4", "$fontSize": 12, "$lineHeight": 16 }, subtitle),
|
|
14
|
+
React.createElement(P, { as: "span", "$color": "grey-3", "$fontSize": 14, "$lineHeight": 20, "$textAlign": "center", sx: "margin-top: 12px;" }, content),
|
|
15
|
+
React.createElement(Box, { "$display": "flex", "$dir": "row", "$gap": 8, sx: "margin-top: 8px; width: 100%;" }, React.Children.toArray(actions))))));
|
|
14
16
|
};
|
|
17
|
+
const Wrapper = styled.div ``;
|
|
15
18
|
const Action = styled.figure `
|
|
16
19
|
position: relative;
|
|
17
20
|
aspect-ratio: 310 / 374;
|
|
@@ -29,6 +32,8 @@ const Action = styled.figure `
|
|
|
29
32
|
border-radius: 16px 16px 0px 0px;
|
|
30
33
|
}
|
|
31
34
|
|
|
35
|
+
${({ as }) => (as === 'a' ? 'cursor: pointer;' : '')}
|
|
36
|
+
|
|
32
37
|
${({ $sx }) => ($sx ? $sx : '')};
|
|
33
38
|
`;
|
|
34
39
|
const Figcaption = styled.figcaption `
|