@ayseaistudio/ui-components 3.11.1 → 3.11.3
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.
|
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import PropTypes from "prop-types";
|
|
3
3
|
import React, { useEffect, useReducer, useState } from "react";
|
|
4
4
|
import "./style.css";
|
|
5
|
-
import { IconLayoutDashboard, IconUser,
|
|
5
|
+
import { IconLayoutDashboard, IconUser, IconEye, IconEyeOff, IconLock } from "@tabler/icons-react";
|
|
6
6
|
export const LoginInput = ({ withIcon = true, placeholder = "Enter text", status = "default", className = "", icon = _jsx(IconLayoutDashboard, { size: 20, color: "#B0B0B0" }), value = "", onChange, inputType = "text", version, singleChar = false, inputRef, onKeyDown, }) => {
|
|
7
7
|
let finalPlaceholder = placeholder;
|
|
8
8
|
let finalInputType = inputType;
|
|
@@ -37,7 +37,7 @@ export const LoginInput = ({ withIcon = true, placeholder = "Enter text", status
|
|
|
37
37
|
finalIcon = _jsx(IconUser, { size: 20, color: iconColor });
|
|
38
38
|
}
|
|
39
39
|
else if (version === "password") {
|
|
40
|
-
finalIcon = _jsx(
|
|
40
|
+
finalIcon = _jsx(IconLock, { size: 20, color: iconColor });
|
|
41
41
|
}
|
|
42
42
|
else if (icon && React.isValidElement(icon) && icon.type === IconLayoutDashboard) {
|
|
43
43
|
finalIcon = _jsx(IconLayoutDashboard, { size: 20, color: iconColor });
|
|
@@ -2,15 +2,19 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import PropTypes from "prop-types";
|
|
3
3
|
import { useEffect, useRef, useState } from "react";
|
|
4
4
|
import "./style.css";
|
|
5
|
-
import { IconArrowDown, IconBold, IconHash, IconItalic, IconMoodSmile, IconPhoto, IconStrikethrough, IconUnderline, } from "@tabler/icons-react";
|
|
6
5
|
import { PrimaryButton } from "../PrimaryButton/PrimaryButton";
|
|
6
|
+
import { IconArrowDown, IconBold, IconHash, IconItalic, IconMoodSmile, IconPhoto, IconStrikethrough, IconUnderline, } from "@tabler/icons-react";
|
|
7
7
|
export const MessageInputField = ({ text = "", enter = true, richTextFormattingTools = true, className, placeholder = "Mesaj yazın...", withPicture = true, withEmoji = true, withBold = true, withItalic = true, withUnderline = true, withStrikethrough = true, withHash = true, value, onChange, onKeyDown, onValueChange, onEnter, }) => {
|
|
8
8
|
const editorRef = useRef(null);
|
|
9
9
|
const fileInputRef = useRef(null);
|
|
10
10
|
const [showEmoji, setShowEmoji] = useState(false);
|
|
11
|
+
const [emojiPanelAbove, setEmojiPanelAbove] = useState(false);
|
|
11
12
|
const emojiTriggerRef = useRef(null);
|
|
12
13
|
const emojiPanelRef = useRef(null);
|
|
13
14
|
const [isEmpty, setIsEmpty] = useState(true);
|
|
15
|
+
/** Approximate height of emoji panel (content + padding) for viewport check */
|
|
16
|
+
const EMOJI_PANEL_HEIGHT = 220;
|
|
17
|
+
const EMOJI_PANEL_GAP = 8;
|
|
14
18
|
useEffect(() => {
|
|
15
19
|
if (editorRef.current) {
|
|
16
20
|
const hasInitial = (text ?? "").length > 0;
|
|
@@ -90,7 +94,17 @@ export const MessageInputField = ({ text = "", enter = true, richTextFormattingT
|
|
|
90
94
|
handleInsertImage(file);
|
|
91
95
|
if (fileInputRef.current)
|
|
92
96
|
fileInputRef.current.value = "";
|
|
93
|
-
} })] }), _jsxs("div", { ref: emojiTriggerRef, className: "emoji-trigger", children: [withEmoji && _jsx(IconMoodSmile, { className: "icon-instance-node toolbar-icon", size: 20, strokeWidth: 1.5, color: "#3D3D3D", onMouseDown: onIconMouseDown, onClick: () =>
|
|
97
|
+
} })] }), _jsxs("div", { ref: emojiTriggerRef, className: "emoji-trigger", children: [withEmoji && _jsx(IconMoodSmile, { className: "icon-instance-node toolbar-icon", size: 20, strokeWidth: 1.5, color: "#3D3D3D", onMouseDown: onIconMouseDown, onClick: () => {
|
|
98
|
+
if (!showEmoji) {
|
|
99
|
+
const trigger = emojiTriggerRef.current;
|
|
100
|
+
if (trigger) {
|
|
101
|
+
const rect = trigger.getBoundingClientRect();
|
|
102
|
+
const spaceBelow = typeof window !== "undefined" ? window.innerHeight - rect.bottom : EMOJI_PANEL_HEIGHT + EMOJI_PANEL_GAP;
|
|
103
|
+
setEmojiPanelAbove(spaceBelow < EMOJI_PANEL_HEIGHT + EMOJI_PANEL_GAP);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
setShowEmoji((s) => !s);
|
|
107
|
+
} }), withEmoji && showEmoji && (_jsx("div", { ref: emojiPanelRef, className: `emoji-panel ${emojiPanelAbove ? "emoji-panel--above" : ""}`, children: _jsx("div", { className: "emoji-grid", children: EMOJIS.map((e) => (_jsx("button", { type: "button", onMouseDown: (evt) => evt.preventDefault(), onClick: () => {
|
|
94
108
|
exec("insertText", e);
|
|
95
109
|
setShowEmoji(false);
|
|
96
110
|
}, className: "emoji-btn", children: e }, e))) }) }))] })] })] }) }))] }));
|
|
@@ -140,18 +140,10 @@
|
|
|
140
140
|
line-height: var(--b2-black-line-height);
|
|
141
141
|
}
|
|
142
142
|
|
|
143
|
-
.profile-button.size-0-x-small .frame {
|
|
144
|
-
height: 24px;
|
|
145
|
-
}
|
|
146
|
-
|
|
147
143
|
.profile-button.size-0-large .frame {
|
|
148
144
|
gap: 6px;
|
|
149
145
|
}
|
|
150
146
|
|
|
151
|
-
.profile-button.size-0-small .frame {
|
|
152
|
-
height: 28px;
|
|
153
|
-
}
|
|
154
|
-
|
|
155
147
|
.profile-button.size-0-x-small .text {
|
|
156
148
|
-webkit-line-clamp: 0;
|
|
157
149
|
font-family: var(--b2-bold-font-family);
|
package/dist/Tags/Tags.d.ts
CHANGED
|
@@ -9,9 +9,10 @@ interface Props {
|
|
|
9
9
|
disabled?: "off" | "on";
|
|
10
10
|
className?: any;
|
|
11
11
|
icon?: React.JSX.Element;
|
|
12
|
+
bold?: boolean;
|
|
12
13
|
}
|
|
13
14
|
export declare const Tags: {
|
|
14
|
-
({ text, size, colors, version, disabled, className, icon, }: Props): React.JSX.Element;
|
|
15
|
+
({ text, size, colors, version, disabled, className, icon, bold, }: Props): React.JSX.Element;
|
|
15
16
|
propTypes: {
|
|
16
17
|
text: PropTypes.Requireable<string>;
|
|
17
18
|
withText: PropTypes.Requireable<boolean>;
|
|
@@ -20,6 +21,7 @@ export declare const Tags: {
|
|
|
20
21
|
colors: PropTypes.Requireable<string>;
|
|
21
22
|
version: PropTypes.Requireable<string>;
|
|
22
23
|
disabled: PropTypes.Requireable<string>;
|
|
24
|
+
bold: PropTypes.Requireable<boolean>;
|
|
23
25
|
};
|
|
24
26
|
};
|
|
25
27
|
export {};
|
package/dist/Tags/Tags.js
CHANGED
|
@@ -21,11 +21,11 @@ const getIconColor = (colors, disabled) => {
|
|
|
21
21
|
}
|
|
22
22
|
return undefined;
|
|
23
23
|
};
|
|
24
|
-
export const Tags = ({ text, size, colors, version, disabled, className, icon, }) => {
|
|
24
|
+
export const Tags = ({ text, size, colors, version, disabled, className, icon, bold, }) => {
|
|
25
25
|
return (_jsxs("div", { className: `tags ${colors} ${size} ${version} ${className}`, children: [icon && (React.cloneElement(icon, {
|
|
26
26
|
className: `${["small", "x-small"].includes(size) ? "class" : "class-2"}`,
|
|
27
27
|
color: getIconColor(colors, disabled)
|
|
28
|
-
})), text && (_jsx("div", { className: `text size-${size} ${disabled} version-${version} colors-${colors}`, children: text }))] }));
|
|
28
|
+
})), text && (_jsx("div", { className: `text size-${size} ${disabled} version-${version} colors-${colors} ${bold ? "bold" : ""}`, children: text }))] }));
|
|
29
29
|
};
|
|
30
30
|
Tags.propTypes = {
|
|
31
31
|
text: PropTypes.string,
|
|
@@ -44,4 +44,5 @@ Tags.propTypes = {
|
|
|
44
44
|
]),
|
|
45
45
|
version: PropTypes.oneOf(["vertical", "horizontal"]),
|
|
46
46
|
disabled: PropTypes.oneOf(["off", "on"]),
|
|
47
|
+
bold: PropTypes.bool,
|
|
47
48
|
};
|
package/dist/Tags/style.css
CHANGED