@soul-refiner/design-system 0.2.85 → 0.2.87
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.d.ts +2 -1
- package/dist/components/actions/button/button.js +2 -2
- package/dist/components/card/meeting/meeting.d.ts +3 -1
- package/dist/components/card/meeting/meeting.js +19 -5
- package/dist/components/feedback/toast/toast.js +16 -2
- package/package.json +1 -1
|
@@ -17,6 +17,7 @@ export interface ButtonProps extends NativeProps, React.PropsWithChildren {
|
|
|
17
17
|
sx?: string;
|
|
18
18
|
type?: ButtonTypes;
|
|
19
19
|
className?: string;
|
|
20
|
+
showChevron?: boolean;
|
|
20
21
|
}
|
|
21
|
-
export declare const Button: ({ as, children, disabled, fluid, href, icon, isDropdownOpen, roundness, size, sx, type, ...props }: ButtonProps) => React.JSX.Element;
|
|
22
|
+
export declare const Button: ({ as, children, disabled, fluid, href, icon, isDropdownOpen, roundness, size, sx, type, showChevron, ...props }: ButtonProps) => React.JSX.Element;
|
|
22
23
|
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, href, 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', showChevron = true, ...props }) => {
|
|
18
18
|
const Component = Components()[type];
|
|
19
19
|
const buttonIcon = React.Children.map(icon, (item) => {
|
|
20
20
|
if (React.isValidElement(item))
|
|
@@ -30,7 +30,7 @@ export const Button = ({ as = 'button', children, disabled, fluid = false, href,
|
|
|
30
30
|
},
|
|
31
31
|
};
|
|
32
32
|
})?.[0];
|
|
33
|
-
const dropdownIcon = isDropdownOpen === true ? (React.createElement(ChevronUp, { size: size === 'large' ? LG_ICON_SIZE : SM_ICON_SIZE })) : isDropdownOpen === false ? (React.createElement(ChevronDown, { size: size === 'large' ? LG_ICON_SIZE : SM_ICON_SIZE })) : undefined;
|
|
33
|
+
const dropdownIcon = showChevron ? (isDropdownOpen === true ? (React.createElement(ChevronUp, { size: size === 'large' ? LG_ICON_SIZE : SM_ICON_SIZE })) : isDropdownOpen === false ? (React.createElement(ChevronDown, { size: size === 'large' ? LG_ICON_SIZE : SM_ICON_SIZE })) : undefined) : undefined;
|
|
34
34
|
const padding = !!children
|
|
35
35
|
? size === 'large'
|
|
36
36
|
? LG_PADDING
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { DropdownOptionProps } from '../..';
|
|
2
3
|
declare enum RSVP {
|
|
3
4
|
INTERESTED = "INTERESTED",
|
|
4
5
|
NOT_INTERESTED = "NOT_INTERESTED"
|
|
@@ -20,6 +21,7 @@ export interface MeetingCardProps {
|
|
|
20
21
|
handleNotInterestedOnClick?: (event: React.MouseEvent<HTMLDivElement>) => void | undefined;
|
|
21
22
|
handleVisibleToConnectionsOnClick?: (event: React.MouseEvent<HTMLDivElement>) => void | undefined;
|
|
22
23
|
rsvp?: `${RSVP}`;
|
|
24
|
+
dotsActions?: (Omit<DropdownOptionProps, 'selected'> | 'break')[];
|
|
23
25
|
}
|
|
24
|
-
export declare const MeetingCard: ({ href, image, sx, title, actions, course, startDate, endDate, startTime, endTime, location, shareModal, handleInterestedOnClick, handleNotInterestedOnClick, handleVisibleToConnectionsOnClick, rsvp, }: MeetingCardProps) => React.JSX.Element;
|
|
26
|
+
export declare const MeetingCard: ({ href, image, sx, title, actions, course, startDate, endDate, startTime, endTime, location, shareModal, handleInterestedOnClick, handleNotInterestedOnClick, handleVisibleToConnectionsOnClick, rsvp, dotsActions, }: MeetingCardProps) => React.JSX.Element;
|
|
25
27
|
export {};
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import styled from 'styled-components';
|
|
4
4
|
import { Box, H, P, Modal, Button, Dropdown } from '../..';
|
|
5
|
-
import { Calendar, GraduationCap, Clock, Pin, ForwardBold, StarFilled, Star, } from '../../../icons';
|
|
5
|
+
import { Calendar, GraduationCap, Clock, Pin, ForwardBold, StarFilled, Star, EllipsisHorizontal, } from '../../../icons';
|
|
6
6
|
var RSVP;
|
|
7
7
|
(function (RSVP) {
|
|
8
8
|
RSVP["INTERESTED"] = "INTERESTED";
|
|
9
9
|
RSVP["NOT_INTERESTED"] = "NOT_INTERESTED";
|
|
10
10
|
})(RSVP || (RSVP = {}));
|
|
11
|
-
export const MeetingCard = ({ href, image, sx, title, actions, course, startDate, endDate, startTime, endTime, location, shareModal, handleInterestedOnClick, handleNotInterestedOnClick, handleVisibleToConnectionsOnClick, rsvp, }) => {
|
|
11
|
+
export const MeetingCard = ({ href, image, sx, title, actions, course, startDate, endDate, startTime, endTime, location, shareModal, handleInterestedOnClick, handleNotInterestedOnClick, handleVisibleToConnectionsOnClick, rsvp, dotsActions, }) => {
|
|
12
12
|
const secondaryActions = [];
|
|
13
13
|
!!handleInterestedOnClick &&
|
|
14
14
|
secondaryActions.push({
|
|
@@ -35,7 +35,8 @@ export const MeetingCard = ({ href, image, sx, title, actions, course, startDate
|
|
|
35
35
|
return (React.createElement(Wrapper, { "$isLink": !!href, "$sx": sx, as: href ? 'a' : 'div', href: href },
|
|
36
36
|
React.createElement(Figure, null,
|
|
37
37
|
React.createElement("img", { src: image, alt: "" }),
|
|
38
|
-
React.createElement(
|
|
38
|
+
React.createElement(OverlayTopContainer, { id: "overlayTop" }, dotsActions && !!dotsActions.length && (React.createElement(Dropdown, { hasArrow: true, maintainState: false, options: dotsActions, trigger: React.createElement(Button, { icon: React.createElement(EllipsisHorizontal, null), showChevron: false, type: "outlined", size: "small", className: "icon" }), onClick: (e) => e.preventDefault() }))),
|
|
39
|
+
React.createElement(OverlayBottomContainer, { id: "overlayBottom" },
|
|
39
40
|
shareModal && (React.createElement(Modal, null,
|
|
40
41
|
React.createElement(Modal.Trigger, null,
|
|
41
42
|
React.createElement(Button, { icon: React.createElement(ForwardBold, null), type: "outlined", size: "small", onClick: (e) => e.preventDefault(), className: "icon" })),
|
|
@@ -79,7 +80,11 @@ const Wrapper = styled.div `
|
|
|
79
80
|
&:hover {
|
|
80
81
|
${({ $isLink }) => $isLink ? 'border: 1px solid var(--color-primary-blue-3);' : ''}
|
|
81
82
|
|
|
82
|
-
#
|
|
83
|
+
#overlayBottom {
|
|
84
|
+
opacity: 1;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
#overlayTop {
|
|
83
88
|
opacity: 1;
|
|
84
89
|
}
|
|
85
90
|
}
|
|
@@ -103,7 +108,7 @@ const Figure = styled.figure `
|
|
|
103
108
|
position: relative;
|
|
104
109
|
margin: 0;
|
|
105
110
|
`;
|
|
106
|
-
const
|
|
111
|
+
const OverlayBottomContainer = styled.div `
|
|
107
112
|
position: absolute;
|
|
108
113
|
right: 0;
|
|
109
114
|
bottom: 0;
|
|
@@ -112,3 +117,12 @@ const OverlayContainer = styled.div `
|
|
|
112
117
|
display: flex;
|
|
113
118
|
gap: 8px;
|
|
114
119
|
`;
|
|
120
|
+
const OverlayTopContainer = styled.div `
|
|
121
|
+
position: absolute;
|
|
122
|
+
right: 0;
|
|
123
|
+
top: 0;
|
|
124
|
+
padding: 10px 10px 0 0;
|
|
125
|
+
opacity: 0;
|
|
126
|
+
display: flex;
|
|
127
|
+
gap: 8px;
|
|
128
|
+
`;
|
|
@@ -64,14 +64,28 @@ const Wrapper = styled.output `
|
|
|
64
64
|
bottom: 24px;
|
|
65
65
|
right: 24px;`}
|
|
66
66
|
|
|
67
|
-
width: 99vw;
|
|
68
|
-
max-width: 476px;
|
|
69
67
|
box-sizing: border-box;
|
|
70
68
|
padding: 12px 16px;
|
|
71
69
|
display: flex;
|
|
72
70
|
box-shadow: var(--elevation-2);
|
|
73
71
|
border-radius: var(--small);
|
|
74
72
|
|
|
73
|
+
&::before {
|
|
74
|
+
position: absolute;
|
|
75
|
+
content: '';
|
|
76
|
+
left: 0px;
|
|
77
|
+
width: 4px;
|
|
78
|
+
height: 100%;
|
|
79
|
+
background-color: ${({ $type }) => $type === 'error'
|
|
80
|
+
? 'var(--color-red-4)'
|
|
81
|
+
: $type === 'info'
|
|
82
|
+
? 'var(--color-blue-4)'
|
|
83
|
+
: $type === 'success'
|
|
84
|
+
? 'var(--color-green-3)'
|
|
85
|
+
: 'var(--color-orange-5)'};
|
|
86
|
+
border-radius: 8px 0px 0px 8px;
|
|
87
|
+
}
|
|
88
|
+
|
|
75
89
|
& > svg {
|
|
76
90
|
fill: ${({ $type }) => $type === 'error'
|
|
77
91
|
? 'var(--color-red-4)'
|