@soul-refiner/design-system 0.2.61 → 0.2.62
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/dist/components/actions/button/button.js +5 -1
- package/dist/components/card/card.d.ts +3 -2
- package/dist/components/card/card.js +2 -0
- package/dist/components/card/feature/feature.js +1 -1
- package/dist/components/card/meeting/index.d.ts +2 -0
- package/dist/components/card/meeting/index.js +1 -0
- package/dist/components/card/meeting/meeting.d.ts +19 -0
- package/dist/components/card/meeting/meeting.js +105 -0
- package/dist/components/surfaces/modal/modal.d.ts +1 -0
- package/dist/components/surfaces/modal/modal.js +1 -0
- package/package.json +1 -1
|
@@ -126,12 +126,16 @@ const Secondary = styled(Box) `
|
|
|
126
126
|
const Outlined = styled(Box) `
|
|
127
127
|
background-color: var(--color-white);
|
|
128
128
|
color: var(--color-grey-3);
|
|
129
|
-
border: 1px solid var(--color-
|
|
129
|
+
border: 1px solid var(--color-white);
|
|
130
130
|
|
|
131
131
|
&:active {
|
|
132
132
|
background-color: var(--color-grey-8);
|
|
133
133
|
}
|
|
134
134
|
|
|
135
|
+
&:hover {
|
|
136
|
+
border: 1px solid var(--color-grey-8);
|
|
137
|
+
}
|
|
138
|
+
|
|
135
139
|
${base}
|
|
136
140
|
${Styles.flex}
|
|
137
141
|
${Styles.padding}
|
|
@@ -7,8 +7,9 @@ import { PriceCardProps } from './price';
|
|
|
7
7
|
import { RegularCardProps } from './regular';
|
|
8
8
|
import { VideoEpisodeCardProps } from './video';
|
|
9
9
|
import { WrittenEpisodeCardProps } from './written';
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
import { MeetingCardCardProps } from './meeting';
|
|
11
|
+
type CardType = 'action' | 'audio-episode' | 'feature' | 'person' | 'price' | 'regular' | 'video-episode' | 'written-episode' | 'meeting';
|
|
12
|
+
export type CardProps = (ActionCardProps | AudioEpisodeCardProps | FeatureCardProps | PersonCardProps | PriceCardProps | RegularCardProps | VideoEpisodeCardProps | WrittenEpisodeCardProps | MeetingCardCardProps) & {
|
|
12
13
|
type: CardType;
|
|
13
14
|
};
|
|
14
15
|
export declare const Card: ({ type, ...rest }: CardProps) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
|
|
@@ -8,6 +8,7 @@ import { PriceCard } from './price';
|
|
|
8
8
|
import { RegularCard } from './regular';
|
|
9
9
|
import { VideoEpisodeCard } from './video';
|
|
10
10
|
import { WrittenEpisodeCard } from './written';
|
|
11
|
+
import { MeetingCard } from './meeting';
|
|
11
12
|
export const Card = ({ type = 'regular', ...rest }) => {
|
|
12
13
|
const lookup = {
|
|
13
14
|
action: React.createElement(ActionCard, { ...rest }),
|
|
@@ -18,6 +19,7 @@ export const Card = ({ type = 'regular', ...rest }) => {
|
|
|
18
19
|
regular: React.createElement(RegularCard, { ...rest }),
|
|
19
20
|
'video-episode': React.createElement(VideoEpisodeCard, { ...rest }),
|
|
20
21
|
'written-episode': (React.createElement(WrittenEpisodeCard, { ...rest })),
|
|
22
|
+
meeting: React.createElement(MeetingCard, { ...rest }),
|
|
21
23
|
};
|
|
22
24
|
return lookup[type];
|
|
23
25
|
};
|
|
@@ -25,7 +25,7 @@ export const FeatureCard = ({ content = '', editable, href, image, onSave, sx, t
|
|
|
25
25
|
};
|
|
26
26
|
const showEditIcon = !editing && editable;
|
|
27
27
|
const isLink = !!href;
|
|
28
|
-
return (React.createElement(Wrapper, { as: isLink ? '
|
|
28
|
+
return (React.createElement(Wrapper, { as: isLink ? 'a' : 'div', href: href },
|
|
29
29
|
React.createElement(Figure, { "$editing": editing, "$isLink": isLink, "$sx": sx },
|
|
30
30
|
React.createElement("img", { alt: title, src: image }),
|
|
31
31
|
!editing && (React.createElement(Title, null,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { MeetingCard } from './meeting';
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface MeetingCardCardProps {
|
|
3
|
+
href?: string;
|
|
4
|
+
image: string;
|
|
5
|
+
sx?: string;
|
|
6
|
+
title: string;
|
|
7
|
+
actions: React.ReactElement | React.ReactElement[];
|
|
8
|
+
course: string;
|
|
9
|
+
startDate: string;
|
|
10
|
+
endDate: string;
|
|
11
|
+
startTime: string;
|
|
12
|
+
endTime: string;
|
|
13
|
+
location: string;
|
|
14
|
+
shareModal?: React.ReactElement;
|
|
15
|
+
handleInterestedOnClick?: (event: React.MouseEvent<HTMLDivElement>) => void | undefined;
|
|
16
|
+
handleNotInterestedOnClick?: (event: React.MouseEvent<HTMLDivElement>) => void | undefined;
|
|
17
|
+
handleVisibleToConnectionsOnClick?: (event: React.MouseEvent<HTMLDivElement>) => void | undefined;
|
|
18
|
+
}
|
|
19
|
+
export declare const MeetingCard: ({ href, image, sx, title, actions, course, startDate, endDate, startTime, endTime, location, shareModal, handleInterestedOnClick, handleNotInterestedOnClick, handleVisibleToConnectionsOnClick, }: MeetingCardCardProps) => React.JSX.Element;
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import styled from 'styled-components';
|
|
4
|
+
import { Box, H, P, Modal, Button, Dropdown } from '../..';
|
|
5
|
+
import { Calendar, GraduationCap, Clock, Pin, ForwardBold, StarFilled, Star, } from 'icons';
|
|
6
|
+
export const MeetingCard = ({ href, image, sx, title, actions, course, startDate, endDate, startTime, endTime, location, shareModal, handleInterestedOnClick, handleNotInterestedOnClick, handleVisibleToConnectionsOnClick, }) => {
|
|
7
|
+
const secondaryActions = [];
|
|
8
|
+
!!handleInterestedOnClick &&
|
|
9
|
+
secondaryActions.push({
|
|
10
|
+
value: 'interested',
|
|
11
|
+
label: 'Interested',
|
|
12
|
+
onClick: handleInterestedOnClick,
|
|
13
|
+
icon: React.createElement(StarFilled, { color: "yellow-5" }),
|
|
14
|
+
});
|
|
15
|
+
!!handleNotInterestedOnClick &&
|
|
16
|
+
secondaryActions.push({
|
|
17
|
+
value: 'notInterested',
|
|
18
|
+
label: 'Not Interested',
|
|
19
|
+
onClick: handleNotInterestedOnClick,
|
|
20
|
+
icon: React.createElement(StarFilled, { color: "red-4" }),
|
|
21
|
+
});
|
|
22
|
+
!!handleVisibleToConnectionsOnClick &&
|
|
23
|
+
secondaryActions.push('break', {
|
|
24
|
+
value: 'visibleToConnections',
|
|
25
|
+
label: 'Visible to connections',
|
|
26
|
+
onClick: handleVisibleToConnectionsOnClick,
|
|
27
|
+
});
|
|
28
|
+
return (React.createElement(Wrapper, { "$isLink": !!href, "$sx": sx, as: href ? 'a' : 'div', href: href },
|
|
29
|
+
React.createElement(Figure, null,
|
|
30
|
+
React.createElement("img", { src: image, alt: "" }),
|
|
31
|
+
React.createElement(OverlayContainer, { id: "overlay" },
|
|
32
|
+
shareModal && (React.createElement(Modal, null,
|
|
33
|
+
React.createElement(Modal.Trigger, null,
|
|
34
|
+
React.createElement(Button, { icon: React.createElement(ForwardBold, null), type: "outlined", size: "small", onClick: (e) => e.preventDefault() })),
|
|
35
|
+
React.createElement(Modal.Content, { onClick: (e) => e.preventDefault() }, shareModal))),
|
|
36
|
+
!!secondaryActions.length && (React.createElement(Dropdown, { open: "left", offset: [40, 10], maintainState: false, options: secondaryActions, trigger: React.createElement(Button, { icon: React.createElement(Star, null), type: "outlined", size: "small" }), onClick: (e) => e.preventDefault() })))),
|
|
37
|
+
React.createElement(Box, { "$dir": "column", "$padding": 24 },
|
|
38
|
+
React.createElement(H.Eight, { "$textAlign": "center", "$color": "grey-2" }, title),
|
|
39
|
+
React.createElement(MeetingInformation, null,
|
|
40
|
+
React.createElement(Box, { "$align": "center", "$gap": 20 },
|
|
41
|
+
React.createElement(GraduationCap, { color: "grey-6" }),
|
|
42
|
+
React.createElement(P, { as: "span", "$color": "grey-3", "$lineHeight": 20, "$fontSize": 14 }, course)),
|
|
43
|
+
React.createElement(Box, { "$align": "center", "$gap": 20 },
|
|
44
|
+
React.createElement(Calendar, { color: "grey-6" }),
|
|
45
|
+
React.createElement(P, { as: "span", "$color": "grey-3", "$lineHeight": 20, "$fontSize": 14 },
|
|
46
|
+
startDate,
|
|
47
|
+
" - ",
|
|
48
|
+
endDate)),
|
|
49
|
+
React.createElement(Box, { "$align": "center", "$gap": 20 },
|
|
50
|
+
React.createElement(Clock, { color: "grey-6" }),
|
|
51
|
+
React.createElement(P, { as: "span", "$color": "grey-3", "$lineHeight": 20, "$fontSize": 14 },
|
|
52
|
+
startTime,
|
|
53
|
+
" - ",
|
|
54
|
+
endTime)),
|
|
55
|
+
React.createElement(Box, { "$align": "center", "$gap": 20 },
|
|
56
|
+
React.createElement(Pin, { color: "grey-6" }),
|
|
57
|
+
React.createElement(P, { as: "span", "$color": "grey-3", "$lineHeight": 20, "$fontSize": 14 }, location))),
|
|
58
|
+
React.createElement(Box, { "$display": "flex", "$dir": "row", "$gap": 8, sx: "margin-top: 16px; width: 100%;" }, React.Children.toArray(actions)))));
|
|
59
|
+
};
|
|
60
|
+
const Wrapper = styled.div `
|
|
61
|
+
min-width: 312px;
|
|
62
|
+
position: relative;
|
|
63
|
+
display: block;
|
|
64
|
+
text-decoration: none;
|
|
65
|
+
cursor: pointer;
|
|
66
|
+
box-shadow: var(--elevation-1);
|
|
67
|
+
border-radius: 16px;
|
|
68
|
+
background-color: var(--color-white);
|
|
69
|
+
|
|
70
|
+
&:hover {
|
|
71
|
+
${({ $isLink }) => $isLink ? 'border: 1px solid var(--color-primary-blue-3);' : ''}
|
|
72
|
+
|
|
73
|
+
#overlay {
|
|
74
|
+
opacity: 1;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
img {
|
|
79
|
+
border-radius: 16px 16px 0px 0px;
|
|
80
|
+
height: 160px;
|
|
81
|
+
width: 100%;
|
|
82
|
+
object-fit: cover;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
${({ $sx }) => ($sx ? $sx : '')};
|
|
86
|
+
`;
|
|
87
|
+
const MeetingInformation = styled.div `
|
|
88
|
+
display: flex;
|
|
89
|
+
flex-direction: column;
|
|
90
|
+
gap: 16px;
|
|
91
|
+
margin-top: 16px;
|
|
92
|
+
`;
|
|
93
|
+
const Figure = styled.figure `
|
|
94
|
+
position: relative;
|
|
95
|
+
margin: 0;
|
|
96
|
+
`;
|
|
97
|
+
const OverlayContainer = styled.div `
|
|
98
|
+
position: absolute;
|
|
99
|
+
right: 0;
|
|
100
|
+
bottom: 0;
|
|
101
|
+
padding: 0 10px 10px 0;
|
|
102
|
+
opacity: 0;
|
|
103
|
+
display: flex;
|
|
104
|
+
gap: 8px;
|
|
105
|
+
`;
|
|
@@ -60,6 +60,7 @@ const ModalContent = ({ backgroundDark = true, children, footer, header, setClos
|
|
|
60
60
|
const handleOutsideClick = (event) => {
|
|
61
61
|
if (event.currentTarget != event.target)
|
|
62
62
|
return;
|
|
63
|
+
event.preventDefault();
|
|
63
64
|
event.stopPropagation();
|
|
64
65
|
event.preventDefault();
|
|
65
66
|
setClosed ? setClosed() : setOpen(false);
|