@soul-refiner/design-system 0.2.61 → 0.2.63

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.
@@ -53,6 +53,7 @@ const Components = () => ({
53
53
  text: Text,
54
54
  });
55
55
  const base = css `
56
+ font-family: var(--font-inter);
56
57
  display: flex;
57
58
  border-radius: ${({ $roundness }) => $roundness === 'large'
58
59
  ? '32px'
@@ -126,12 +127,16 @@ const Secondary = styled(Box) `
126
127
  const Outlined = styled(Box) `
127
128
  background-color: var(--color-white);
128
129
  color: var(--color-grey-3);
129
- border: 1px solid var(--color-grey-8);
130
+ border: 1px solid var(--color-white);
130
131
 
131
132
  &:active {
132
133
  background-color: var(--color-grey-8);
133
134
  }
134
135
 
136
+ &:hover {
137
+ border: 1px solid var(--color-grey-8);
138
+ }
139
+
135
140
  ${base}
136
141
  ${Styles.flex}
137
142
  ${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
- type CardType = 'action' | 'audio-episode' | 'feature' | 'person' | 'price' | 'regular' | 'video-episode' | 'written-episode';
11
- export type CardProps = (ActionCardProps | AudioEpisodeCardProps | FeatureCardProps | PersonCardProps | PriceCardProps | RegularCardProps | VideoEpisodeCardProps | WrittenEpisodeCardProps) & {
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 ? 'div' : 'a', href: href },
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,2 @@
1
+ export { MeetingCard } from './meeting';
2
+ export type { MeetingCardCardProps } from './meeting';
@@ -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
+ `;
@@ -5,14 +5,14 @@ export interface RadioProps extends NativeProps {
5
5
  checked: boolean;
6
6
  disabled?: boolean;
7
7
  label?: string;
8
- onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;
8
+ onClick?: (event: React.MouseEvent) => void;
9
9
  name?: string;
10
10
  reversed?: boolean;
11
11
  sx?: string;
12
12
  value: string;
13
13
  }
14
14
  declare const Radio: {
15
- ({ checked, disabled, label, onChange, reversed, sx, value, ...rest }: RadioProps): React.JSX.Element;
15
+ ({ checked, disabled, label, onClick, reversed, sx, value, ...rest }: RadioProps): React.JSX.Element;
16
16
  Group: {
17
17
  ({ children, name, ...rest }: RadioGroupProps): React.JSX.Element;
18
18
  displayName: string;
@@ -2,13 +2,13 @@
2
2
  import React from 'react';
3
3
  import styled from 'styled-components';
4
4
  import { Box, P } from '../../';
5
- const Radio = ({ checked = false, disabled, label, onChange, reversed, sx, value, ...rest }) => {
5
+ const Radio = ({ checked = false, disabled, label, onClick, reversed, sx, value, ...rest }) => {
6
6
  const handleChange = (event) => {
7
7
  event.stopPropagation();
8
- onChange && onChange(event);
8
+ onClick && onClick(event);
9
9
  };
10
- return (React.createElement(Label, { "$disabled": disabled, "$reversed": reversed, "$sx": sx },
11
- React.createElement(Input, { checked: checked, disabled: disabled, onChange: handleChange, type: "radio", value: value, ...rest }),
10
+ return (React.createElement(Label, { "$disabled": disabled, "$reversed": reversed, "$sx": sx, onClick: handleChange },
11
+ React.createElement(Input, { checked: checked, disabled: disabled, type: "radio", value: value, ...rest }),
12
12
  React.createElement(P, { as: "span" }, label)));
13
13
  };
14
14
  const Label = styled.label `
@@ -27,6 +27,7 @@ const SelectBox = styled.div `
27
27
  height: 18px;
28
28
  border: 1px solid var(--color-grey-8);
29
29
  border-radius: 4px;
30
+ flex-shrink: 0;
30
31
 
31
32
  ${({ $selected }) => $selected
32
33
  ? `
@@ -17,7 +17,8 @@ const Breadcrumb = ({ children, previous }) => {
17
17
  }
18
18
  return (React.createElement(Box, { "$align": "center", "$gap": 8 }, _children.map((child, index) => {
19
19
  if (React.isValidElement(child) &&
20
- child.type?.displayName === 'BreadcrumbItem') {
20
+ (child.type?.displayName === 'BreadcrumbItem' ||
21
+ child.type?.displayName === 'Breadcrumb.Item')) {
21
22
  return (React.createElement(React.Fragment, null,
22
23
  child,
23
24
  _children.length - 1 !== index && (React.createElement(ChevronRight, { color: "grey-3", size: 24 }))));
@@ -38,5 +38,6 @@ export interface ModalContentProps extends React.PropsWithChildren {
38
38
  header?: React.ReactElement;
39
39
  setClosed?: () => void;
40
40
  sx?: string;
41
+ onClick?: (event: React.MouseEvent<HTMLDivElement>) => void;
41
42
  }
42
43
  export { Modal };
@@ -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);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@soul-refiner/design-system",
3
- "version": "0.2.61",
3
+ "version": "0.2.63",
4
4
  "main": "dist/index.js",
5
5
  "license": "MIT",
6
6
  "publishConfig": {