@soul-refiner/design-system 0.2.78 → 0.2.79

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.
@@ -1,4 +1,5 @@
1
1
  import React from 'react';
2
+ import { COLORS } from 'common';
2
3
  type NativeProps = Pick<React.HTMLAttributes<HTMLDivElement>, 'children' | 'onBlur' | 'onBlurCapture' | 'onClick' | 'onChange' | 'onMouseDown' | 'onMouseDownCapture' | 'onMouseEnter' | 'onMouseLeave' | 'onMouseOut' | 'onMouseOver'>;
3
4
  export interface DropdownProps extends NativeProps, React.PropsWithChildren {
4
5
  checkbox?: boolean;
@@ -18,7 +19,7 @@ export interface DropdownProps extends NativeProps, React.PropsWithChildren {
18
19
  declare const Dropdown: {
19
20
  ({ checkbox, children, closeOnChange, closeOnBlur, defaultValue, disabled, hasArrow, maintainState, multiple, offset, onChange, open: openDirection, options, sx, trigger, ...rest }: DropdownProps): React.JSX.Element;
20
21
  Option: {
21
- ({ checkbox, disabled, icon, label, onClick, selected, sublabel, sx, value, }: DropdownOptionProps): React.JSX.Element;
22
+ ({ checkbox, disabled, icon, label, onClick, selected, sublabel, sx, value, color, }: DropdownOptionProps): React.JSX.Element;
22
23
  displayName: string;
23
24
  };
24
25
  Spacer: {
@@ -28,7 +29,7 @@ declare const Dropdown: {
28
29
  };
29
30
  export interface DropdownOptionProps {
30
31
  checkbox?: boolean;
31
- color?: string;
32
+ color?: (typeof COLORS)[number];
32
33
  disabled?: boolean;
33
34
  icon?: React.ReactElement;
34
35
  label?: React.ReactNode;
@@ -134,11 +134,11 @@ const Container = styled.div `
134
134
  : ''}
135
135
  ${({ $offset }) => $offset ? `transform: translate(${$offset[0]}px, ${$offset[1]}px);` : ''}
136
136
  `;
137
- const Option = ({ checkbox, disabled, icon, label, onClick, selected, sublabel, sx, value, }) => {
137
+ const Option = ({ checkbox, disabled, icon, label, onClick, selected, sublabel, sx, value, color, }) => {
138
138
  return (React.createElement(OptionWrapper, { "data-value": value, onClick: !disabled ? onClick : undefined, "$disabled": disabled, "$hasCheckbox": !!checkbox, "$hasSublabel": !!sublabel, "$selected": selected, "$sx": sx },
139
139
  checkbox ? React.createElement(Checkbox, { selected: selected }) : icon,
140
140
  React.createElement(Box, { "$dir": "column", "$display": "flex" },
141
- label && (React.createElement(P, { "$color": "grey-4", "$fontSize": 14, "$lineHeight": 20, "$mediumBold": true, "$textClampLines": 1 }, label)),
141
+ label && (React.createElement(P, { "$color": color || 'grey-4', "$fontSize": 14, "$lineHeight": 20, "$mediumBold": true, "$textClampLines": 1 }, label)),
142
142
  sublabel && (React.createElement(P, { "$color": "grey-4", "$fontSize": 12, "$lineHeight": 16, "$textClampLines": 1 }, sublabel)))));
143
143
  };
144
144
  Option.displayName = 'Dropdown.Option';
@@ -7,9 +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
- import { MeetingCardCardProps } from './meeting';
10
+ import { MeetingCardProps } from './meeting';
11
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
+ export type CardProps = (ActionCardProps | AudioEpisodeCardProps | FeatureCardProps | PersonCardProps | PriceCardProps | RegularCardProps | VideoEpisodeCardProps | WrittenEpisodeCardProps | MeetingCardProps) & {
13
13
  type: CardType;
14
14
  };
15
15
  export declare const Card: ({ type, ...rest }: CardProps) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
@@ -1,2 +1,2 @@
1
1
  export { MeetingCard } from './meeting';
2
- export type { MeetingCardCardProps } from './meeting';
2
+ export type { MeetingCardProps } from './meeting';
@@ -1,5 +1,9 @@
1
1
  import React from 'react';
2
- export interface MeetingCardCardProps {
2
+ declare enum RSVP {
3
+ INTERESTED = "INTERESTED",
4
+ NOT_INTERESTED = "NOT_INTERESTED"
5
+ }
6
+ export interface MeetingCardProps {
3
7
  href?: string;
4
8
  image: string;
5
9
  sx?: string;
@@ -15,5 +19,7 @@ export interface MeetingCardCardProps {
15
19
  handleInterestedOnClick?: (event: React.MouseEvent<HTMLDivElement>) => void | undefined;
16
20
  handleNotInterestedOnClick?: (event: React.MouseEvent<HTMLDivElement>) => void | undefined;
17
21
  handleVisibleToConnectionsOnClick?: (event: React.MouseEvent<HTMLDivElement>) => void | undefined;
22
+ rsvp?: `${RSVP}`;
18
23
  }
19
- export declare const MeetingCard: ({ href, image, sx, title, actions, course, startDate, endDate, startTime, endTime, location, shareModal, handleInterestedOnClick, handleNotInterestedOnClick, handleVisibleToConnectionsOnClick, }: MeetingCardCardProps) => React.JSX.Element;
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;
25
+ export {};
@@ -3,7 +3,12 @@ import React from 'react';
3
3
  import styled from 'styled-components';
4
4
  import { Box, H, P, Modal, Button, Dropdown } from '../..';
5
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, }) => {
6
+ var RSVP;
7
+ (function (RSVP) {
8
+ RSVP["INTERESTED"] = "INTERESTED";
9
+ RSVP["NOT_INTERESTED"] = "NOT_INTERESTED";
10
+ })(RSVP || (RSVP = {}));
11
+ export const MeetingCard = ({ href, image, sx, title, actions, course, startDate, endDate, startTime, endTime, location, shareModal, handleInterestedOnClick, handleNotInterestedOnClick, handleVisibleToConnectionsOnClick, rsvp, }) => {
7
12
  const secondaryActions = [];
8
13
  !!handleInterestedOnClick &&
9
14
  secondaryActions.push({
@@ -11,6 +16,7 @@ export const MeetingCard = ({ href, image, sx, title, actions, course, startDate
11
16
  label: 'Interested',
12
17
  onClick: handleInterestedOnClick,
13
18
  icon: React.createElement(StarFilled, { color: "yellow-5" }),
19
+ color: rsvp === RSVP.INTERESTED ? 'primary-blue-2' : undefined,
14
20
  });
15
21
  !!handleNotInterestedOnClick &&
16
22
  secondaryActions.push({
@@ -18,6 +24,7 @@ export const MeetingCard = ({ href, image, sx, title, actions, course, startDate
18
24
  label: 'Not Interested',
19
25
  onClick: handleNotInterestedOnClick,
20
26
  icon: React.createElement(StarFilled, { color: "red-4" }),
27
+ color: rsvp === RSVP.NOT_INTERESTED ? 'primary-blue-2' : undefined,
21
28
  });
22
29
  !!handleVisibleToConnectionsOnClick &&
23
30
  secondaryActions.push('break', {
@@ -33,7 +40,8 @@ export const MeetingCard = ({ href, image, sx, title, actions, course, startDate
33
40
  React.createElement(Modal.Trigger, null,
34
41
  React.createElement(Button, { icon: React.createElement(ForwardBold, null), type: "outlined", size: "small", onClick: (e) => e.preventDefault(), className: "icon" })),
35
42
  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", className: "icon" }), onClick: (e) => e.preventDefault() })))),
43
+ !!secondaryActions.length && (React.createElement(Dropdown, { open: "left", offset: [40, 10], maintainState: false, options: secondaryActions, trigger: React.createElement(Button, { icon: (rsvp === RSVP.INTERESTED && (React.createElement(StarFilled, { sx: "color: var(--color-yellow-5);" }))) ||
44
+ (rsvp === RSVP.NOT_INTERESTED && (React.createElement(StarFilled, { sx: "color: var(--color-red-4);" }))) || React.createElement(Star, null), type: "outlined", size: "small", className: "icon" }), onClick: (e) => e.preventDefault() })))),
37
45
  React.createElement(Box, { "$dir": "column", "$padding": 24 },
38
46
  React.createElement(H.Eight, { "$textAlign": "center", "$color": "grey-2" }, title),
39
47
  React.createElement(MeetingInformation, null,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@soul-refiner/design-system",
3
- "version": "0.2.78",
3
+ "version": "0.2.79",
4
4
  "main": "dist/index.js",
5
5
  "license": "MIT",
6
6
  "publishConfig": {