@soul-refiner/design-system 0.2.77 → 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.
- package/dist/components/actions/dropdown/dropdown.d.ts +3 -2
- package/dist/components/actions/dropdown/dropdown.js +2 -2
- package/dist/components/card/card.d.ts +2 -2
- package/dist/components/card/meeting/index.d.ts +1 -1
- package/dist/components/card/meeting/meeting.d.ts +8 -2
- package/dist/components/card/meeting/meeting.js +10 -2
- package/dist/components/editor/simple_editor/navbar.js +9 -0
- package/dist/components/editor/simple_editor/simple_editor.js +10 -3
- package/package.json +1 -1
|
@@ -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?:
|
|
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":
|
|
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 {
|
|
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 |
|
|
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 {
|
|
2
|
+
export type { MeetingCardProps } from './meeting';
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
|
|
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, }:
|
|
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
|
-
|
|
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(
|
|
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,
|
|
@@ -2,6 +2,8 @@ import React from 'react';
|
|
|
2
2
|
import styled from 'styled-components';
|
|
3
3
|
import { insertImage, useLinkToolbarButton, useLinkToolbarButtonState, useListToolbarButton, useListToolbarButtonState, useMarkToolbarButton, useMarkToolbarButtonState, usePlateEditorRef, } from '@udecode/plate';
|
|
4
4
|
import { Tooltip } from '../../';
|
|
5
|
+
import { AlignmentDropdown } from '../navbar/alignment_dropdown';
|
|
6
|
+
import { StyleDropdown } from '../navbar/style_dropdown';
|
|
5
7
|
import { Bold, Image, Italic, Link, ListOrdered, ListUnordered, Redo, Underline, Undo, } from '../../../icons';
|
|
6
8
|
import { ELEMENT_OL, ELEMENT_UL, MARK_BOLD, MARK_ITALIC, MARK_UNDERLINE, } from '../constants';
|
|
7
9
|
export const EditorBar = ({ handleUploadImage }) => {
|
|
@@ -43,6 +45,13 @@ export const EditorBar = ({ handleUploadImage }) => {
|
|
|
43
45
|
React.createElement(MenuButton, { "$active": false, onClick: handleRedo },
|
|
44
46
|
React.createElement(Redo, { size: 24, color: "grey-5" })))),
|
|
45
47
|
React.createElement(Divider, null),
|
|
48
|
+
React.createElement(MenuSection, null,
|
|
49
|
+
React.createElement(StyleDropdown, { editorRef: editorRef })),
|
|
50
|
+
React.createElement(Divider, null),
|
|
51
|
+
React.createElement(MenuSection, null,
|
|
52
|
+
React.createElement(MenuButton, { "$active": false, as: "div" },
|
|
53
|
+
React.createElement(AlignmentDropdown, { editorRef: editorRef }))),
|
|
54
|
+
React.createElement(Divider, null),
|
|
46
55
|
React.createElement(MenuSection, null,
|
|
47
56
|
React.createElement(Tooltip, { content: "Bold", place: "top" },
|
|
48
57
|
React.createElement(MenuButton, { "$active": currBold, onClick: handleBold },
|
|
@@ -26,9 +26,15 @@ export const SimpleEditor = ({ editable, handleUploadImage, onChange, placeholde
|
|
|
26
26
|
} })))));
|
|
27
27
|
};
|
|
28
28
|
const InnerWrapper = styled.div `
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
29
|
+
& > div {
|
|
30
|
+
padding: 24px;
|
|
31
|
+
min-height: 224px;
|
|
32
|
+
box-sizing: border-box;
|
|
33
|
+
|
|
34
|
+
& > div {
|
|
35
|
+
margin: 24px 0px;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
32
38
|
`;
|
|
33
39
|
const Wrapper = styled.div `
|
|
34
40
|
position: relative;
|
|
@@ -61,6 +67,7 @@ const Wrapper = styled.div `
|
|
|
61
67
|
}
|
|
62
68
|
|
|
63
69
|
li {
|
|
70
|
+
margin: 8px 0px;
|
|
64
71
|
color: var(--color-grey-3);
|
|
65
72
|
}
|
|
66
73
|
|