@bigbinary/neeto-editor 0.2.1 → 0.2.2
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/index.js +8 -8
- package/package.json +1 -1
- package/webpack.config.js +4 -3
- package/webpack.dev.config.js +4 -3
- package/src/App.js +0 -8
- package/src/Common/Avatar.js +0 -168
- package/src/Common/Button.js +0 -95
- package/src/Common/CodeBlock.js +0 -11
- package/src/Common/Description.js +0 -8
- package/src/Common/Dropdown/index.js +0 -122
- package/src/Common/Heading.js +0 -13
- package/src/Common/HighlightText.js +0 -7
- package/src/Common/Icons/HashtagFilled.js +0 -59
- package/src/Common/Icons/TextColor.js +0 -35
- package/src/Common/Icons/index.js +0 -2
- package/src/Common/Input.js +0 -70
- package/src/Common/Label.js +0 -45
- package/src/Common/ListItems.js +0 -17
- package/src/Common/Modal.js +0 -91
- package/src/Common/Tab.js +0 -79
- package/src/Common/ToolTip.js +0 -37
- package/src/Editor/CustomExtensions/BubbleMenu/index.js +0 -92
- package/src/Editor/CustomExtensions/CodeBlock/CodeBlockComponent.js +0 -12
- package/src/Editor/CustomExtensions/CodeBlock/ExtensionConfig.js +0 -10
- package/src/Editor/CustomExtensions/Embeds.js +0 -72
- package/src/Editor/CustomExtensions/FixedMenu/FontSizeOption.js +0 -32
- package/src/Editor/CustomExtensions/FixedMenu/TextColorOption.js +0 -29
- package/src/Editor/CustomExtensions/FixedMenu/constants.js +0 -3
- package/src/Editor/CustomExtensions/FixedMenu/index.js +0 -183
- package/src/Editor/CustomExtensions/Image/ExtensionConfig.js +0 -47
- package/src/Editor/CustomExtensions/Image/LinkUploader/URLForm.js +0 -39
- package/src/Editor/CustomExtensions/Image/LocalUploader.js +0 -21
- package/src/Editor/CustomExtensions/Image/ProgressBar.js +0 -34
- package/src/Editor/CustomExtensions/Image/Uploader.js +0 -82
- package/src/Editor/CustomExtensions/Image/constants.js +0 -5
- package/src/Editor/CustomExtensions/Mention/ExtensionConfig.js +0 -66
- package/src/Editor/CustomExtensions/Mention/MentionList.js +0 -96
- package/src/Editor/CustomExtensions/Mention/helpers.js +0 -23
- package/src/Editor/CustomExtensions/Placeholder/ExtensionConfig.js +0 -81
- package/src/Editor/CustomExtensions/Placeholder/helpers.js +0 -18
- package/src/Editor/CustomExtensions/SlashCommands/Commands.js +0 -20
- package/src/Editor/CustomExtensions/SlashCommands/CommandsList.js +0 -109
- package/src/Editor/CustomExtensions/SlashCommands/ExtensionConfig.js +0 -209
- package/src/Editor/CustomExtensions/Variable/ExtensionConfig.js +0 -208
- package/src/Editor/CustomExtensions/Variable/VariableList.js +0 -45
- package/src/Editor/CustomExtensions/Variable/VariableSuggestion.js +0 -20
- package/src/Editor/CustomExtensions/Variable/helpers.js +0 -31
- package/src/Editor/CustomExtensions/Variable/index.js +0 -35
- package/src/Editor/CustomExtensions/useCustomExtensions.js +0 -88
- package/src/Editor/index.js +0 -104
- package/src/Editor/sharedState.js +0 -8
- package/src/constants/regexp.js +0 -1
- package/src/examples/constants.js +0 -95
- package/src/examples/index.js +0 -186
- package/src/hooks/useOutsideClick.js +0 -19
- package/src/hooks/useTabBar.js +0 -9
- package/src/index.js +0 -10
- package/src/index.scss +0 -46
- package/src/styles/abstracts/_mixins.scss +0 -20
- package/src/styles/abstracts/_neeto-ui-variables.scss +0 -107
- package/src/styles/abstracts/_variables.scss +0 -13
- package/src/styles/components/_avatar.scss +0 -105
- package/src/styles/components/_button.scss +0 -161
- package/src/styles/components/_codeblock.scss +0 -16
- package/src/styles/components/_command-list.scss +0 -19
- package/src/styles/components/_dropdown.scss +0 -69
- package/src/styles/components/_editor-variables.scss +0 -12
- package/src/styles/components/_editor.scss +0 -102
- package/src/styles/components/_fixed-menu.scss +0 -17
- package/src/styles/components/_image-uploader.scss +0 -109
- package/src/styles/components/_input.scss +0 -165
- package/src/styles/components/_tab.scss +0 -74
- package/src/styles/components/_tooltip.scss +0 -152
- package/src/utils/common.js +0 -13
package/package.json
CHANGED
package/webpack.config.js
CHANGED
|
@@ -2,7 +2,7 @@ const PeerDepsExternalsPlugin = require("peer-deps-externals-webpack-plugin");
|
|
|
2
2
|
const path = require("path");
|
|
3
3
|
|
|
4
4
|
module.exports = {
|
|
5
|
-
entry: "./
|
|
5
|
+
entry: "./lib/index.js",
|
|
6
6
|
module: {
|
|
7
7
|
rules: [
|
|
8
8
|
{
|
|
@@ -43,8 +43,9 @@ module.exports = {
|
|
|
43
43
|
plugins: [new PeerDepsExternalsPlugin()],
|
|
44
44
|
resolve: {
|
|
45
45
|
alias: {
|
|
46
|
-
common: path.resolve(__dirname, "/
|
|
47
|
-
hooks: path.resolve(__dirname, "/
|
|
46
|
+
common: path.resolve(__dirname, "/lib/components/Common"),
|
|
47
|
+
hooks: path.resolve(__dirname, "/lib/hooks"),
|
|
48
|
+
constants: path.resolve(__dirname, "/lib/constants"),
|
|
48
49
|
},
|
|
49
50
|
},
|
|
50
51
|
};
|
package/webpack.dev.config.js
CHANGED
|
@@ -2,7 +2,7 @@ const HtmlWebPackPlugin = require("html-webpack-plugin");
|
|
|
2
2
|
const path = require("path");
|
|
3
3
|
|
|
4
4
|
module.exports = {
|
|
5
|
-
entry: "./
|
|
5
|
+
entry: "./example/index.js",
|
|
6
6
|
devtool:
|
|
7
7
|
process.env.NODE_ENV === "production"
|
|
8
8
|
? "source-map"
|
|
@@ -61,8 +61,9 @@ module.exports = {
|
|
|
61
61
|
],
|
|
62
62
|
resolve: {
|
|
63
63
|
alias: {
|
|
64
|
-
common: path.resolve(__dirname, "/
|
|
65
|
-
hooks: path.resolve(__dirname, "/
|
|
64
|
+
common: path.resolve(__dirname, "/lib/components/Common"),
|
|
65
|
+
hooks: path.resolve(__dirname, "/lib/hooks"),
|
|
66
|
+
constants: path.resolve(__dirname, "/lib/constants"),
|
|
66
67
|
},
|
|
67
68
|
},
|
|
68
69
|
};
|
package/src/App.js
DELETED
package/src/Common/Avatar.js
DELETED
|
@@ -1,168 +0,0 @@
|
|
|
1
|
-
import React, { useState } from "react";
|
|
2
|
-
import PropTypes from "prop-types";
|
|
3
|
-
import classNames from "classnames";
|
|
4
|
-
|
|
5
|
-
const SIZE = {
|
|
6
|
-
small: 24,
|
|
7
|
-
medium: 32,
|
|
8
|
-
large: 40,
|
|
9
|
-
xlarge: 64,
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
const STATUS = {
|
|
13
|
-
online: "online",
|
|
14
|
-
idle: "idle",
|
|
15
|
-
offline: "offline",
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
const COLORS = [
|
|
19
|
-
"#E5E7EB",
|
|
20
|
-
"#FECACA",
|
|
21
|
-
"#FDE68A",
|
|
22
|
-
"#A7F3D0",
|
|
23
|
-
"#BFDBFE",
|
|
24
|
-
"#C7D2FE",
|
|
25
|
-
"#DDD6FE",
|
|
26
|
-
"#FBCFE8",
|
|
27
|
-
];
|
|
28
|
-
|
|
29
|
-
function Avatar({
|
|
30
|
-
size,
|
|
31
|
-
user,
|
|
32
|
-
isSquare,
|
|
33
|
-
status,
|
|
34
|
-
onClick,
|
|
35
|
-
className,
|
|
36
|
-
...otherProps
|
|
37
|
-
}) {
|
|
38
|
-
const [loaded, setLoaded] = useState(false);
|
|
39
|
-
|
|
40
|
-
const { name = "", imageUrl } = user;
|
|
41
|
-
|
|
42
|
-
const isMedium = size === "medium";
|
|
43
|
-
const isLarge = size === "large";
|
|
44
|
-
const isXLarge = size === "xlarge";
|
|
45
|
-
|
|
46
|
-
const getInitials = (fullName) => {
|
|
47
|
-
const allNames = fullName.trim().split(" ");
|
|
48
|
-
const initials = allNames.reduce((acc, curr, index) => {
|
|
49
|
-
if (index === 0 || index === allNames.length - 1) {
|
|
50
|
-
acc = `${acc}${curr.charAt(0).toUpperCase()}`;
|
|
51
|
-
}
|
|
52
|
-
return acc;
|
|
53
|
-
}, "");
|
|
54
|
-
return initials;
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
const avatarString = getInitials(name);
|
|
58
|
-
|
|
59
|
-
const getRandomBackgroundColor = () => {
|
|
60
|
-
const charCode =
|
|
61
|
-
(avatarString.charCodeAt(0) || 0) + (avatarString.charCodeAt(1) || 0);
|
|
62
|
-
const bgColor = COLORS[(charCode % 65) % COLORS.length] || COLORS[0];
|
|
63
|
-
return bgColor;
|
|
64
|
-
};
|
|
65
|
-
|
|
66
|
-
const imageContainerStyle = {
|
|
67
|
-
height: SIZE[size],
|
|
68
|
-
width: SIZE[size],
|
|
69
|
-
backgroundColor: getRandomBackgroundColor(),
|
|
70
|
-
};
|
|
71
|
-
|
|
72
|
-
const imageClasses = classNames("neeto-ui-avatar", {
|
|
73
|
-
"neeto-ui-avatar--medium": isMedium,
|
|
74
|
-
"neeto-ui-avatar--large": isLarge,
|
|
75
|
-
"neeto-ui-avatar--xlarge": isXLarge,
|
|
76
|
-
"neeto-ui-avatar--round": !isSquare,
|
|
77
|
-
hidden: !loaded,
|
|
78
|
-
});
|
|
79
|
-
|
|
80
|
-
const placeholderClasses = classNames("neeto-ui-avatar__text", {
|
|
81
|
-
"neeto-ui-avatar__text-medium": isMedium,
|
|
82
|
-
"neeto-ui-avatar__text-large": isLarge,
|
|
83
|
-
"neeto-ui-avatar__text-xlarge": isXLarge,
|
|
84
|
-
});
|
|
85
|
-
|
|
86
|
-
// TODO: Remove 'v2' prefix.
|
|
87
|
-
const statusClasses = classNames("neeto-ui-avatar__status", `${status}`, {
|
|
88
|
-
"neeto-ui-avatar__status-medium": isMedium,
|
|
89
|
-
"neeto-ui-avatar__status-large": isLarge,
|
|
90
|
-
"neeto-ui-avatar__status-xlarge": isXLarge,
|
|
91
|
-
"neeto-ui-avatar__status-square": isSquare,
|
|
92
|
-
});
|
|
93
|
-
|
|
94
|
-
const Indicator = () =>
|
|
95
|
-
status === undefined || status === null ? (
|
|
96
|
-
React.Fragment
|
|
97
|
-
) : (
|
|
98
|
-
<span className={statusClasses} />
|
|
99
|
-
);
|
|
100
|
-
|
|
101
|
-
const ImagePlaceholder = () => (
|
|
102
|
-
<span className={placeholderClasses}>{avatarString}</span>
|
|
103
|
-
);
|
|
104
|
-
|
|
105
|
-
const shouldDisplayInitials = avatarString && !imageUrl && !loaded;
|
|
106
|
-
|
|
107
|
-
return (
|
|
108
|
-
<div
|
|
109
|
-
onClick={onClick}
|
|
110
|
-
style={imageContainerStyle}
|
|
111
|
-
className={classNames(
|
|
112
|
-
"neeto-ui-avatar--container",
|
|
113
|
-
{
|
|
114
|
-
"neeto-ui-avatar--container-round": !isSquare,
|
|
115
|
-
},
|
|
116
|
-
className
|
|
117
|
-
)}
|
|
118
|
-
{...otherProps}
|
|
119
|
-
>
|
|
120
|
-
<Indicator />
|
|
121
|
-
{shouldDisplayInitials ? (
|
|
122
|
-
<ImagePlaceholder />
|
|
123
|
-
) : (
|
|
124
|
-
<img
|
|
125
|
-
className={imageClasses}
|
|
126
|
-
onLoad={() => setLoaded(true)}
|
|
127
|
-
onError={() => setLoaded(false)}
|
|
128
|
-
src={imageUrl}
|
|
129
|
-
alt={`avatar-${avatarString}`}
|
|
130
|
-
/>
|
|
131
|
-
)}
|
|
132
|
-
</div>
|
|
133
|
-
);
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
Avatar.defaultProps = {
|
|
137
|
-
size: "medium",
|
|
138
|
-
user: {
|
|
139
|
-
imageUrl: "",
|
|
140
|
-
name: "",
|
|
141
|
-
},
|
|
142
|
-
isSquare: false,
|
|
143
|
-
onClick: () => {},
|
|
144
|
-
status: null,
|
|
145
|
-
};
|
|
146
|
-
|
|
147
|
-
Avatar.propTypes = {
|
|
148
|
-
/**
|
|
149
|
-
* Specify the dimension for avatar component.
|
|
150
|
-
*/
|
|
151
|
-
size: PropTypes.oneOf(Object.keys(SIZE)),
|
|
152
|
-
user: PropTypes.shape({
|
|
153
|
-
imageUrl: PropTypes.string,
|
|
154
|
-
name: PropTypes.string,
|
|
155
|
-
}),
|
|
156
|
-
isSquare: PropTypes.bool,
|
|
157
|
-
onClick: PropTypes.func,
|
|
158
|
-
/**
|
|
159
|
-
* Specify the status of the user if needed in avatar component.
|
|
160
|
-
*/
|
|
161
|
-
status: PropTypes.oneOf(Object.keys(STATUS)),
|
|
162
|
-
/**
|
|
163
|
-
* Specify custom className to be applied on the Avatar Container
|
|
164
|
-
*/
|
|
165
|
-
className: PropTypes.string,
|
|
166
|
-
};
|
|
167
|
-
|
|
168
|
-
export default Avatar;
|
package/src/Common/Button.js
DELETED
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import classnames from "classnames";
|
|
3
|
-
import { Link } from "react-router-dom";
|
|
4
|
-
import ToolTip from "common/ToolTip";
|
|
5
|
-
|
|
6
|
-
const noop = () => {};
|
|
7
|
-
const BUTTON_STYLES = {
|
|
8
|
-
primary: "primary",
|
|
9
|
-
secondary: "secondary",
|
|
10
|
-
danger: "danger",
|
|
11
|
-
text: "text",
|
|
12
|
-
link: "link",
|
|
13
|
-
};
|
|
14
|
-
const BUTTON_SIZES = { large: "large", default: "default" };
|
|
15
|
-
const ICON_POSITIONS = { left: "left", right: "right" };
|
|
16
|
-
|
|
17
|
-
const Button = React.forwardRef((props, ref) => {
|
|
18
|
-
let {
|
|
19
|
-
icon = null,
|
|
20
|
-
iconPosition = "right",
|
|
21
|
-
iconSize = 16,
|
|
22
|
-
label = "",
|
|
23
|
-
loading = false,
|
|
24
|
-
onClick = noop,
|
|
25
|
-
to = null,
|
|
26
|
-
type = "button",
|
|
27
|
-
style = "primary",
|
|
28
|
-
fullWidth = false,
|
|
29
|
-
className = "",
|
|
30
|
-
disabled = false,
|
|
31
|
-
size = null,
|
|
32
|
-
href = null,
|
|
33
|
-
tooltipProps = null,
|
|
34
|
-
...otherProps
|
|
35
|
-
} = props;
|
|
36
|
-
|
|
37
|
-
const handleClick = (e) => {
|
|
38
|
-
if (!loading && !disabled) {
|
|
39
|
-
onClick(e);
|
|
40
|
-
}
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
let Parent, elementSpecificProps;
|
|
44
|
-
if (to) {
|
|
45
|
-
Parent = Link;
|
|
46
|
-
elementSpecificProps = { to };
|
|
47
|
-
} else if (href) {
|
|
48
|
-
Parent = "a";
|
|
49
|
-
elementSpecificProps = { href };
|
|
50
|
-
} else {
|
|
51
|
-
Parent = "button";
|
|
52
|
-
elementSpecificProps = {
|
|
53
|
-
type,
|
|
54
|
-
};
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
let Icon =
|
|
58
|
-
typeof icon == "string"
|
|
59
|
-
? () => <i className={classnames("neeto-ui-btn__icon", [icon])} />
|
|
60
|
-
: icon || React.Fragment;
|
|
61
|
-
|
|
62
|
-
const spinnerMarginSide =
|
|
63
|
-
iconPosition == "left" ? "marginRight" : "marginLeft";
|
|
64
|
-
|
|
65
|
-
return (
|
|
66
|
-
<ToolTip {...tooltipProps} disabled={!tooltipProps}>
|
|
67
|
-
<Parent
|
|
68
|
-
ref={ref}
|
|
69
|
-
onClick={handleClick}
|
|
70
|
-
className={classnames("neeto-ui-btn", [className], {
|
|
71
|
-
"neeto-ui-btn--style-primary": style === BUTTON_STYLES.primary,
|
|
72
|
-
"neeto-ui-btn--style-secondary": style === BUTTON_STYLES.secondary,
|
|
73
|
-
"neeto-ui-btn--style-danger": style === BUTTON_STYLES.danger,
|
|
74
|
-
"neeto-ui-btn--style-text": style === BUTTON_STYLES.text,
|
|
75
|
-
"neeto-ui-btn--style-link": style === BUTTON_STYLES.link,
|
|
76
|
-
"neeto-ui-btn--size-large": size === BUTTON_SIZES.large,
|
|
77
|
-
"neeto-ui-btn--width-full": fullWidth,
|
|
78
|
-
"neeto-ui-btn--icon-left": iconPosition == ICON_POSITIONS.left,
|
|
79
|
-
"neeto-ui-btn--icon-only": !label,
|
|
80
|
-
disabled: disabled,
|
|
81
|
-
})}
|
|
82
|
-
disabled={disabled}
|
|
83
|
-
{...elementSpecificProps}
|
|
84
|
-
{...otherProps}
|
|
85
|
-
>
|
|
86
|
-
{label && <span>{label}</span>}
|
|
87
|
-
{icon ? (
|
|
88
|
-
<Icon key="2" size={iconSize} className="neeto-ui-btn__icon" />
|
|
89
|
-
) : null}
|
|
90
|
-
</Parent>
|
|
91
|
-
</ToolTip>
|
|
92
|
-
);
|
|
93
|
-
});
|
|
94
|
-
|
|
95
|
-
export default Button;
|
package/src/Common/CodeBlock.js
DELETED
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
import React, { useState, useEffect } from "react";
|
|
2
|
-
import classnames from "classnames";
|
|
3
|
-
import { usePopper } from "react-popper";
|
|
4
|
-
import { Down } from "@bigbinary/neeto-icons";
|
|
5
|
-
import { useHotkeys } from "react-hotkeys-hook";
|
|
6
|
-
import OutsideClickHandler from "react-outside-click-handler";
|
|
7
|
-
|
|
8
|
-
import { hyphenize } from "../../utils/common";
|
|
9
|
-
|
|
10
|
-
const noop = () => {};
|
|
11
|
-
|
|
12
|
-
const Dropdown = ({
|
|
13
|
-
icon,
|
|
14
|
-
label,
|
|
15
|
-
isOpen,
|
|
16
|
-
onClose = noop,
|
|
17
|
-
ulProps,
|
|
18
|
-
position,
|
|
19
|
-
children,
|
|
20
|
-
autoWidth,
|
|
21
|
-
className,
|
|
22
|
-
buttonStyle = "primary",
|
|
23
|
-
buttonProps,
|
|
24
|
-
customTarget,
|
|
25
|
-
disabled = false,
|
|
26
|
-
closeOnEsc = true,
|
|
27
|
-
closeOnSelect = true,
|
|
28
|
-
closeOnOutsideClick = true,
|
|
29
|
-
dropdownModifiers = [],
|
|
30
|
-
...otherProps
|
|
31
|
-
}) => {
|
|
32
|
-
const Target = customTarget;
|
|
33
|
-
const isControlled = !(isOpen === undefined || isOpen === null);
|
|
34
|
-
|
|
35
|
-
const [visible, setVisibility] = useState(false);
|
|
36
|
-
const [reference, setReference] = useState(null);
|
|
37
|
-
const [popper, setPopper] = useState(null);
|
|
38
|
-
|
|
39
|
-
const { styles, attributes } = usePopper(reference, popper, {
|
|
40
|
-
placement: position || "bottom-end",
|
|
41
|
-
modifiers: dropdownModifiers,
|
|
42
|
-
});
|
|
43
|
-
|
|
44
|
-
const onPopupClose = () => {
|
|
45
|
-
if (!isControlled) setVisibility(false);
|
|
46
|
-
onClose();
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
const handlePopperClick = () => {
|
|
50
|
-
closeOnSelect && onPopupClose();
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
const handleButtonClick = () => {
|
|
54
|
-
setVisibility(!visible);
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
closeOnEsc && useHotkeys("esc", onPopupClose);
|
|
58
|
-
|
|
59
|
-
if (!isControlled) {
|
|
60
|
-
buttonProps = {
|
|
61
|
-
...buttonProps,
|
|
62
|
-
onClick: () => {
|
|
63
|
-
handleButtonClick();
|
|
64
|
-
},
|
|
65
|
-
};
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
useEffect(() => {
|
|
69
|
-
isControlled && setVisibility(isOpen);
|
|
70
|
-
}, [isOpen]);
|
|
71
|
-
|
|
72
|
-
return (
|
|
73
|
-
<OutsideClickHandler
|
|
74
|
-
useCapture={true}
|
|
75
|
-
onOutsideClick={() => {
|
|
76
|
-
closeOnOutsideClick && onPopupClose();
|
|
77
|
-
}}
|
|
78
|
-
>
|
|
79
|
-
<div
|
|
80
|
-
className={classnames("neeto-ui-dropdown__wrapper h-full", {
|
|
81
|
-
"neeto-ui-dropdown__wrapper--auto-width": autoWidth,
|
|
82
|
-
[className]: className,
|
|
83
|
-
})}
|
|
84
|
-
{...otherProps}
|
|
85
|
-
>
|
|
86
|
-
{customTarget ? (
|
|
87
|
-
<div
|
|
88
|
-
ref={setReference}
|
|
89
|
-
onClick={handleButtonClick}
|
|
90
|
-
className="h-full"
|
|
91
|
-
>
|
|
92
|
-
<Target />
|
|
93
|
-
</div>
|
|
94
|
-
) : (
|
|
95
|
-
<div>
|
|
96
|
-
{label}
|
|
97
|
-
<Down />
|
|
98
|
-
</div>
|
|
99
|
-
)}
|
|
100
|
-
{visible && (
|
|
101
|
-
<ul
|
|
102
|
-
className="neeto-ui-dropdown__popup"
|
|
103
|
-
ref={setPopper}
|
|
104
|
-
onClick={handlePopperClick}
|
|
105
|
-
data-cy={`${hyphenize(label)}-dropdown-container`}
|
|
106
|
-
{...ulProps}
|
|
107
|
-
style={{
|
|
108
|
-
display: "block",
|
|
109
|
-
...styles.offset,
|
|
110
|
-
...styles.popper,
|
|
111
|
-
}}
|
|
112
|
-
{...attributes.popper}
|
|
113
|
-
>
|
|
114
|
-
{children}
|
|
115
|
-
</ul>
|
|
116
|
-
)}
|
|
117
|
-
</div>
|
|
118
|
-
</OutsideClickHandler>
|
|
119
|
-
);
|
|
120
|
-
};
|
|
121
|
-
|
|
122
|
-
export default Dropdown;
|
package/src/Common/Heading.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import classNames from "classnames";
|
|
3
|
-
|
|
4
|
-
const Heading = ({ children, type = "main" }) => {
|
|
5
|
-
const className = classNames({
|
|
6
|
-
"mb-3 mt-14 text-3xl font-extrabold": type === "main",
|
|
7
|
-
"mb-1 mt-8 text-xl font-bold": type === "sub",
|
|
8
|
-
});
|
|
9
|
-
|
|
10
|
-
return <h1 className={className}>{children}</h1>;
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
export default Heading;
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
/** Icons generated by create-react-icons. Don't edit this file directly. **/
|
|
2
|
-
import React from "react";
|
|
3
|
-
import PropTypes from "prop-types";
|
|
4
|
-
|
|
5
|
-
export function HashtagFilled(props) {
|
|
6
|
-
const { size, color, bgColor, ...other } = props;
|
|
7
|
-
return (
|
|
8
|
-
<svg viewBox="0 0 24 24" fill="none" height={size} width={size} {...other}>
|
|
9
|
-
<path
|
|
10
|
-
d="M21 7V17C21 19.209 19.209 21 17 21H7C4.791 21 3 19.209 3 17V7C3 4.791 4.791 3 7 3H17C19.209 3 21 4.791 21 7Z"
|
|
11
|
-
fill={bgColor}
|
|
12
|
-
stroke={bgColor}
|
|
13
|
-
strokeWidth="1.5"
|
|
14
|
-
strokeLinecap="round"
|
|
15
|
-
strokeLinejoin="round"
|
|
16
|
-
/>
|
|
17
|
-
<path
|
|
18
|
-
d="M10 8V16"
|
|
19
|
-
stroke={color}
|
|
20
|
-
strokeWidth="1.389"
|
|
21
|
-
strokeLinecap="round"
|
|
22
|
-
strokeLinejoin="round"
|
|
23
|
-
/>
|
|
24
|
-
<path
|
|
25
|
-
d="M14 8V16"
|
|
26
|
-
stroke={color}
|
|
27
|
-
strokeWidth="1.389"
|
|
28
|
-
strokeLinecap="round"
|
|
29
|
-
strokeLinejoin="round"
|
|
30
|
-
/>
|
|
31
|
-
<path
|
|
32
|
-
d="M8 14H16"
|
|
33
|
-
stroke={color}
|
|
34
|
-
strokeWidth="1.389"
|
|
35
|
-
strokeLinecap="round"
|
|
36
|
-
strokeLinejoin="round"
|
|
37
|
-
/>
|
|
38
|
-
<path
|
|
39
|
-
d="M8 10H16"
|
|
40
|
-
stroke={color}
|
|
41
|
-
strokeWidth="1.389"
|
|
42
|
-
strokeLinecap="round"
|
|
43
|
-
strokeLinejoin="round"
|
|
44
|
-
/>
|
|
45
|
-
</svg>
|
|
46
|
-
);
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
HashtagFilled.defaultProps = {
|
|
50
|
-
color: "white",
|
|
51
|
-
bgColor: "#68737D",
|
|
52
|
-
size: 24,
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
HashtagFilled.propTypes = {
|
|
56
|
-
color: PropTypes.string,
|
|
57
|
-
bgColor: PropTypes.string,
|
|
58
|
-
size: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
59
|
-
};
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
/** Icons generated by create-react-icons. Don't edit this file directly. **/
|
|
2
|
-
import React from "react";
|
|
3
|
-
import PropTypes from "prop-types";
|
|
4
|
-
|
|
5
|
-
export function TextColor(props) {
|
|
6
|
-
const { size, color, underlineColor, ...other } = props;
|
|
7
|
-
return (
|
|
8
|
-
<svg viewBox="0 0 24 24" fill="none" height={size} width={size} {...other}>
|
|
9
|
-
<path
|
|
10
|
-
d="M21 20H3"
|
|
11
|
-
stroke={underlineColor || color}
|
|
12
|
-
strokeWidth="1.5"
|
|
13
|
-
strokeLinecap="round"
|
|
14
|
-
strokeLinejoin="round"
|
|
15
|
-
/>
|
|
16
|
-
<path
|
|
17
|
-
d="M17.3125 15L12.1562 4L7 15M8.03125 12.8H16.2812"
|
|
18
|
-
stroke={color}
|
|
19
|
-
strokeWidth="1.5"
|
|
20
|
-
strokeLinecap="round"
|
|
21
|
-
strokeLinejoin="round"
|
|
22
|
-
/>
|
|
23
|
-
</svg>
|
|
24
|
-
);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
TextColor.defaultProps = {
|
|
28
|
-
color: "currentColor",
|
|
29
|
-
size: 24,
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
TextColor.propTypes = {
|
|
33
|
-
color: PropTypes.string,
|
|
34
|
-
size: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
35
|
-
};
|
package/src/Common/Input.js
DELETED
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import classnames from "classnames";
|
|
3
|
-
|
|
4
|
-
import Label from "./Label";
|
|
5
|
-
import { hyphenize } from "../utils/common";
|
|
6
|
-
|
|
7
|
-
const Input = React.forwardRef((props, ref) => {
|
|
8
|
-
const {
|
|
9
|
-
id,
|
|
10
|
-
size = "small",
|
|
11
|
-
type = "text",
|
|
12
|
-
label,
|
|
13
|
-
error = null,
|
|
14
|
-
suffix = null,
|
|
15
|
-
prefix = null,
|
|
16
|
-
disabled = false,
|
|
17
|
-
helpText = "",
|
|
18
|
-
className = "",
|
|
19
|
-
nakedInput = false,
|
|
20
|
-
contentSize = null,
|
|
21
|
-
required = false,
|
|
22
|
-
...otherProps
|
|
23
|
-
} = props;
|
|
24
|
-
|
|
25
|
-
return (
|
|
26
|
-
<div className={classnames(["neeto-ui-input__wrapper", className])}>
|
|
27
|
-
{label && (
|
|
28
|
-
<Label
|
|
29
|
-
required={required}
|
|
30
|
-
data-cy={`${hyphenize(label)}-input-label`}
|
|
31
|
-
htmlFor={id}
|
|
32
|
-
>
|
|
33
|
-
{label}
|
|
34
|
-
</Label>
|
|
35
|
-
)}
|
|
36
|
-
<div
|
|
37
|
-
className={classnames("neeto-ui-input", {
|
|
38
|
-
"neeto-ui-input--naked": !!nakedInput,
|
|
39
|
-
"neeto-ui-input--error": !!error,
|
|
40
|
-
"neeto-ui-input--disabled": !!disabled,
|
|
41
|
-
"neeto-ui-input--small": size === "small",
|
|
42
|
-
})}
|
|
43
|
-
>
|
|
44
|
-
{prefix && <div className="neeto-ui-input__prefix">{prefix}</div>}
|
|
45
|
-
<input
|
|
46
|
-
ref={ref}
|
|
47
|
-
type={type}
|
|
48
|
-
disabled={disabled}
|
|
49
|
-
size={contentSize}
|
|
50
|
-
required={required}
|
|
51
|
-
aria-invalid={!!error}
|
|
52
|
-
data-cy={"input-field"}
|
|
53
|
-
{...otherProps}
|
|
54
|
-
/>
|
|
55
|
-
{suffix && <div className="neeto-ui-input__suffix">{suffix}</div>}
|
|
56
|
-
</div>
|
|
57
|
-
{!!error && (
|
|
58
|
-
<p
|
|
59
|
-
data-cy={`${hyphenize(label)}-input-error`}
|
|
60
|
-
className="neeto-ui-input__error"
|
|
61
|
-
>
|
|
62
|
-
{error}
|
|
63
|
-
</p>
|
|
64
|
-
)}
|
|
65
|
-
{helpText && <p className="neeto-ui-input__help-text">{helpText}</p>}
|
|
66
|
-
</div>
|
|
67
|
-
);
|
|
68
|
-
});
|
|
69
|
-
|
|
70
|
-
export default Input;
|