@soul-refiner/design-system 0.2.4 → 0.2.6
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.
|
@@ -4,7 +4,7 @@ import styled from 'styled-components';
|
|
|
4
4
|
import { Box, H, P } from '../../';
|
|
5
5
|
export const ActionCard = ({ actions, content, href, image, logo, subtitle, sx, title, }) => {
|
|
6
6
|
const isAnchor = !!href;
|
|
7
|
-
return (React.createElement(Wrapper, { as: isAnchor ? 'a' : 'div' },
|
|
7
|
+
return (React.createElement(Wrapper, { as: isAnchor ? 'a' : 'div', href: href },
|
|
8
8
|
React.createElement(Action, { "$backgroundImage": image, "$sx": sx },
|
|
9
9
|
React.createElement("img", { src: image, alt: "" }),
|
|
10
10
|
React.createElement(Figcaption, null,
|
|
@@ -14,7 +14,10 @@ export const ActionCard = ({ actions, content, href, image, logo, subtitle, sx,
|
|
|
14
14
|
React.createElement(P, { as: "span", "$color": "grey-3", "$fontSize": 14, "$lineHeight": 20, "$textAlign": "center", sx: "margin-top: 12px;" }, content),
|
|
15
15
|
React.createElement(Box, { "$display": "flex", "$dir": "row", "$gap": 8, sx: "margin-top: 8px; width: 100%;" }, React.Children.toArray(actions))))));
|
|
16
16
|
};
|
|
17
|
-
const Wrapper = styled.div
|
|
17
|
+
const Wrapper = styled.div `
|
|
18
|
+
text-decoration: none;
|
|
19
|
+
${({ as }) => (as === 'a' ? 'cursor: pointer;' : '')}
|
|
20
|
+
`;
|
|
18
21
|
const Action = styled.figure `
|
|
19
22
|
position: relative;
|
|
20
23
|
aspect-ratio: 310 / 374;
|
|
@@ -32,8 +35,6 @@ const Action = styled.figure `
|
|
|
32
35
|
border-radius: 16px 16px 0px 0px;
|
|
33
36
|
}
|
|
34
37
|
|
|
35
|
-
${({ as }) => (as === 'a' ? 'cursor: pointer;' : '')}
|
|
36
|
-
|
|
37
38
|
${({ $sx }) => ($sx ? $sx : '')};
|
|
38
39
|
`;
|
|
39
40
|
const Figcaption = styled.figcaption `
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import styled from 'styled-components';
|
|
3
|
-
import { Button
|
|
3
|
+
import { Button } from '../../../components/actions/button';
|
|
4
|
+
import { Drawer } from '../../../components/surfaces/drawer';
|
|
4
5
|
import { ChevronDown, ChevronLeft, ChevronUp, Plus } from '../../../icons';
|
|
5
6
|
const INNER_NAV_CHILD_TYPES = [
|
|
6
7
|
'Item',
|
|
@@ -6,17 +6,18 @@ export interface TabProps {
|
|
|
6
6
|
items: {
|
|
7
7
|
color?: TabColors;
|
|
8
8
|
disabled?: boolean;
|
|
9
|
+
href?: string;
|
|
9
10
|
icon?: React.ReactElement;
|
|
10
11
|
label: string;
|
|
11
12
|
}[];
|
|
12
|
-
onChange
|
|
13
|
+
onChange?: (index: number) => void;
|
|
13
14
|
size?: TabSizes;
|
|
14
15
|
sx?: string;
|
|
15
16
|
}
|
|
16
17
|
declare const Tabs: {
|
|
17
18
|
({ activeIndex, items, onChange, size, sx, }: TabProps): React.JSX.Element;
|
|
18
19
|
Item: {
|
|
19
|
-
({ active, color, disabled, icon, label, onClick, size, }: TabsItemProps): React.JSX.Element;
|
|
20
|
+
({ active, color, disabled, href, icon, label, onClick, size, }: TabsItemProps): React.JSX.Element;
|
|
20
21
|
displayName: string;
|
|
21
22
|
};
|
|
22
23
|
};
|
|
@@ -24,9 +25,10 @@ export interface TabsItemProps {
|
|
|
24
25
|
active: boolean;
|
|
25
26
|
color?: TabColors;
|
|
26
27
|
disabled?: boolean;
|
|
28
|
+
href?: string;
|
|
27
29
|
icon?: React.ReactElement;
|
|
28
30
|
label: string;
|
|
29
|
-
onClick
|
|
31
|
+
onClick?: () => void;
|
|
30
32
|
size: TabSizes;
|
|
31
33
|
}
|
|
32
34
|
export { Tabs };
|
|
@@ -46,9 +46,9 @@ const colorLookup = {
|
|
|
46
46
|
};
|
|
47
47
|
const Tabs = ({ activeIndex, items, onChange, size = 'large', sx, }) => {
|
|
48
48
|
const id = React.useId();
|
|
49
|
-
return (React.createElement(Wrapper, { "$sx": sx }, items.map((item, index) => (React.createElement(Item, { active: activeIndex === index, color: item?.color, disabled: item?.disabled, key: id + index.toString(36), icon: item?.icon, label: item.label, onClick: () => onChange(index), size: size })))));
|
|
49
|
+
return (React.createElement(Wrapper, { "$sx": sx }, items.map((item, index) => (React.createElement(Item, { active: activeIndex === index, color: item?.color, disabled: item?.disabled, key: id + index.toString(36), icon: item?.icon, label: item.label, onClick: () => onChange && onChange(index), size: size })))));
|
|
50
50
|
};
|
|
51
|
-
const Wrapper = styled.
|
|
51
|
+
const Wrapper = styled.div `
|
|
52
52
|
display: flex;
|
|
53
53
|
flex-flow: row nowrap;
|
|
54
54
|
align-items: flex-end;
|
|
@@ -59,17 +59,18 @@ const Wrapper = styled.ul `
|
|
|
59
59
|
|
|
60
60
|
${({ $sx }) => ($sx ? $sx : '')}
|
|
61
61
|
`;
|
|
62
|
-
const Item = ({ active, color, disabled, icon, label, onClick, size = 'large', }) => {
|
|
62
|
+
const Item = ({ active, color, disabled, href, icon, label, onClick, size = 'large', }) => {
|
|
63
|
+
const isAnchor = !!href;
|
|
63
64
|
const inputColor = disabled ? 'grey' : color ? color : 'blue';
|
|
64
65
|
const iconColor = colorLookup[inputColor].icon;
|
|
65
66
|
const bgColor = colorLookup[inputColor].bg;
|
|
66
67
|
const fontSize = size === 'large' ? 16 : size === 'medium' ? 14 : 12;
|
|
67
68
|
const lineHeight = size === 'large' ? 24 : size === 'medium' ? 20 : 16;
|
|
68
|
-
return (React.createElement(
|
|
69
|
+
return (React.createElement(Element, { as: isAnchor ? 'a' : 'div', href: href, onClick: !disabled && onClick ? onClick : undefined, "$active": active, "$color": iconColor, "$disabled": disabled, "$hasIcon": !!icon, "$size": size },
|
|
69
70
|
icon && React.createElement(IconWrapper, { "$bg": bgColor }, icon),
|
|
70
71
|
React.createElement(P, { "$fontSize": fontSize, "$lineHeight": lineHeight, "$semiBold": true }, label)));
|
|
71
72
|
};
|
|
72
|
-
const
|
|
73
|
+
const Element = styled.div `
|
|
73
74
|
position: relative;
|
|
74
75
|
display: flex;
|
|
75
76
|
align-items: center;
|