@ayseaistudio/ui-components 3.2.2 → 3.3.0

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 PropTypes from "prop-types";
2
2
  import "./style.css";
3
3
  interface Props {
4
4
  letter?: string;
5
- size?: "large" | "x-small" | "medium" | "small";
5
+ size?: "large" | "xx-small" | "x-small" | "medium" | "small";
6
6
  color?: "mauve" | "lime" | "zest" | "grey" | "blue" | "green" | "galliano" | "orange" | "red";
7
7
  status?: "active" | "default";
8
8
  version?: "half" | "default";
@@ -6,7 +6,7 @@ export const Avatar = ({ letter = "AB", size, color, status, version, className,
6
6
  };
7
7
  Avatar.propTypes = {
8
8
  letter: PropTypes.string,
9
- size: PropTypes.oneOf(["large", "x-small", "medium", "small"]),
9
+ size: PropTypes.oneOf(["large", "xx-small", "x-small", "medium", "small"]),
10
10
  color: PropTypes.oneOf([
11
11
  "mauve",
12
12
  "lime",
@@ -57,6 +57,12 @@
57
57
  width: 24px;
58
58
  }
59
59
 
60
+ .avatar.xx-small {
61
+ border-radius: 6px;
62
+ height: 20px;
63
+ width: 20px;
64
+ }
65
+
60
66
  .avatar.default {
61
67
  box-shadow: inset 0px 0px 10px #ffffff40;
62
68
  }
@@ -186,6 +192,13 @@
186
192
  width: 12px;
187
193
  }
188
194
 
195
+ .avatar.xx-small .rectangle {
196
+ height: 20px;
197
+ left: 0;
198
+ top: calc(50.00% - 10px);
199
+ width: 10px;
200
+ }
201
+
189
202
  .avatar.green .rectangle {
190
203
  background-color: #c3efcc;
191
204
  }
@@ -298,6 +311,15 @@
298
311
  line-height: var(--b3-bold-line-height);
299
312
  }
300
313
 
314
+ .avatar.xx-small .AB {
315
+ font-family: var(--b3-bold-font-family);
316
+ font-size: var(--b3-bold-font-size);
317
+ font-style: var(--b3-bold-font-style);
318
+ font-weight: var(--b3-bold-font-weight);
319
+ letter-spacing: var(--b3-bold-letter-spacing);
320
+ line-height: var(--b3-bold-line-height);
321
+ }
322
+
301
323
  .avatar.large .AB {
302
324
  font-family: var(--h4-black-font-family);
303
325
  font-size: var(--h4-black-font-size);
@@ -0,0 +1,23 @@
1
+ import PropTypes from "prop-types";
2
+ import "./style.css";
3
+ interface Props {
4
+ status?: "warning" | "complete" | "default";
5
+ className?: any;
6
+ icon?: React.ReactNode;
7
+ divideVerticalDivideVertical?: string;
8
+ strikethroughText?: string;
9
+ labelText?: string;
10
+ strikethroughDivClassName?: any;
11
+ strikethroughIcon?: React.ReactNode;
12
+ index?: number;
13
+ }
14
+ export declare const CallCenterTasks: {
15
+ ({ status, className, strikethroughText, labelText, strikethroughDivClassName, strikethroughIcon, index, }: Props): React.ReactNode;
16
+ propTypes: {
17
+ status: PropTypes.Requireable<string>;
18
+ strikethroughText: PropTypes.Requireable<string>;
19
+ labelText: PropTypes.Requireable<string>;
20
+ index: PropTypes.Requireable<number>;
21
+ };
22
+ };
23
+ export {};
@@ -0,0 +1,16 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import PropTypes from "prop-types";
3
+ import { Label } from "../Label";
4
+ import { Strikethrough } from "../Strikethrough";
5
+ import "./style.css";
6
+ import { IconLayoutDashboard, IconCheck, IconX } from "@tabler/icons-react";
7
+ export const CallCenterTasks = ({ status, className, strikethroughText = "Selamlaşma ve kendini tanıtma.", labelText, strikethroughDivClassName, strikethroughIcon = status === "complete" ? _jsx(IconCheck, { className: "icons-12", color: "#fff" }) :
8
+ status === "warning" ? _jsx(IconX, { className: "icons-12", color: "#fff" }) : _jsx(IconLayoutDashboard, { className: "icons-12", color: "#fff" }), index = 1, }) => {
9
+ return (_jsxs("div", { className: `call-center-tasks ${className}`, children: [_jsx("div", { className: "frame-5", "data-status": status, children: _jsx("div", { className: `frame-6 status-4-${status}` }) }), _jsx(Label, { bold: "on", className: "label-2", color: status === "warning" ? "galliano" : "black", size: "medium", spacing: "on", stroke: "off", text: labelText || index.toString(), version: "primary" }), _jsx("div", { className: `frame-7 status-5-${status}`, children: _jsx(Strikethrough, { className: "strikethrough-checkbox", color: "black", size: "medium", status: status === "default" ? "default" : "selected", text: strikethroughText }) })] }));
10
+ };
11
+ CallCenterTasks.propTypes = {
12
+ status: PropTypes.oneOf(["warning", "complete", "default"]),
13
+ strikethroughText: PropTypes.string,
14
+ labelText: PropTypes.string,
15
+ index: PropTypes.number,
16
+ };
@@ -0,0 +1 @@
1
+ export { CallCenterTasks } from "./CallCenterTasks";
@@ -0,0 +1 @@
1
+ export { CallCenterTasks } from "./CallCenterTasks";
@@ -0,0 +1,155 @@
1
+ .call-center-tasks {
2
+ align-items: flex-start;
3
+ display: flex;
4
+ gap: 4px;
5
+ position: relative;
6
+ width: 466px;
7
+ pointer-events: none;
8
+ }
9
+
10
+ .call-center-tasks .frame-5 {
11
+ align-items: center;
12
+ align-self: stretch;
13
+ display: inline-flex;
14
+ flex: 0 0 auto;
15
+ flex-direction: column;
16
+ justify-content: flex-start;
17
+ position: relative;
18
+ }
19
+
20
+ .call-center-tasks .frame-5::before {
21
+ content: '';
22
+ position: absolute;
23
+ right: 5px;
24
+ top: 0;
25
+ bottom: 0;
26
+ width: 1px;
27
+ background-image: repeating-linear-gradient(to bottom, #b0b0b0 0px, #b0b0b0 4px, transparent 4px, transparent 8px);
28
+ }
29
+
30
+ .call-center-tasks .frame-5[data-status="warning"]::before {
31
+ background-image: none;
32
+ background-color: #d7af1b;
33
+ }
34
+
35
+ .call-center-tasks .frame-5[data-status="complete"]::before {
36
+ background-image: none;
37
+ background-color: #3d3d3d;
38
+ }
39
+
40
+ .call-center-tasks .frame-6 {
41
+ border-radius: 96px;
42
+ height: 12px;
43
+ position: relative;
44
+ width: 12px;
45
+ }
46
+
47
+ .call-center-tasks .label-2 {
48
+ flex: 0 0 auto !important;
49
+
50
+ }
51
+
52
+ .call-center-tasks .divide-vertical-2 {
53
+ height: 24px !important;
54
+ left: unset !important;
55
+ position: relative !important;
56
+ top: unset !important;
57
+ }
58
+
59
+ .call-center-tasks .frame-7 {
60
+ align-items: flex-start;
61
+ border: 1px solid;
62
+ border-radius: 12px;
63
+ display: flex;
64
+ flex-direction: column;
65
+ gap: 2px;
66
+ justify-content: center;
67
+ padding: 8px;
68
+ position: relative;
69
+ width: 100%;
70
+ }
71
+
72
+ .call-center-tasks .strikethrough-checkbox {
73
+ align-self: stretch !important;
74
+ display: flex !important;
75
+ flex: 0 0 auto !important;
76
+ width: 100% !important;
77
+ }
78
+
79
+ .call-center-tasks .merhaba-iyi-g-nler-wrapper {
80
+ align-items: center;
81
+ align-self: stretch;
82
+ display: flex;
83
+ flex: 0 0 auto;
84
+ gap: 10px;
85
+ padding: 0px 0px 0px 36px;
86
+ position: relative;
87
+ width: 100%;
88
+ }
89
+
90
+ .call-center-tasks .merhaba-iyi-g-nler {
91
+ flex: 1;
92
+ font-family: var(--b2-medium-font-family);
93
+ font-size: var(--b2-medium-font-size);
94
+ font-style: var(--b2-medium-font-style);
95
+ font-weight: var(--b2-medium-font-weight);
96
+ letter-spacing: var(--b2-medium-letter-spacing);
97
+ line-height: var(--b2-medium-line-height);
98
+ margin-top: -1.00px;
99
+ position: relative;
100
+ }
101
+
102
+ .call-center-tasks .divide-vertical-3 {
103
+ flex: 1 !important;
104
+ flex-grow: 1 !important;
105
+ margin-bottom: -0.50px !important;
106
+ position: relative !important;
107
+ width: 1px !important;
108
+ }
109
+
110
+ .call-center-tasks .icons-12 {
111
+ height: 16px !important;
112
+ left: 4px !important;
113
+ position: absolute !important;
114
+ top: 4px !important;
115
+ width: 16px !important;
116
+ }
117
+
118
+ .call-center-tasks .status-4-warning {
119
+ background-color: #d7af1b;
120
+ }
121
+
122
+ .call-center-tasks .status-4-complete {
123
+ background-color: #3d3d3d;
124
+ }
125
+
126
+ .call-center-tasks .status-4-default {
127
+ background-color: #b0b0b0;
128
+ }
129
+
130
+ .call-center-tasks .status-5-warning {
131
+ background-color: #b989151a;
132
+ border-color: #d7af1b;
133
+ }
134
+
135
+ .call-center-tasks .status-5-complete {
136
+ border-color: #d1d1d1;
137
+ background-color: #ffffff;
138
+ }
139
+
140
+ .call-center-tasks .status-5-default {
141
+ background-color: #f7f7f7;
142
+ border-color: #d1d1d1;
143
+ }
144
+
145
+ .call-center-tasks .frame-7.status-5-warning .merhaba-iyi-g-nler {
146
+ color: #b0b0b0;
147
+ }
148
+
149
+ .call-center-tasks .frame-7.status-5-complete .merhaba-iyi-g-nler {
150
+ color: #b0b0b0;
151
+ }
152
+
153
+ .call-center-tasks .frame-7.status-5-default .merhaba-iyi-g-nler {
154
+ color: rgba(136, 136, 136, 1);
155
+ }
@@ -0,0 +1,16 @@
1
+ import PropTypes from "prop-types";
2
+ import "./style.css";
3
+ type ColorOption = "lime" | "red" | "galliano" | "grey";
4
+ interface Props {
5
+ property1: ColorOption | "default";
6
+ className: any;
7
+ labelIcon: React.JSX.Element;
8
+ onChange?: (color: ColorOption) => void;
9
+ }
10
+ export declare const ColorFlag: {
11
+ ({ property1, className, labelIcon, onChange, }: Props): React.JSX.Element;
12
+ propTypes: {
13
+ property1: PropTypes.Requireable<string>;
14
+ };
15
+ };
16
+ export {};
@@ -0,0 +1,68 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import PropTypes from "prop-types";
3
+ import { useEffect, useLayoutEffect, useRef, useState } from "react";
4
+ import { createPortal } from "react-dom";
5
+ import "./style.css";
6
+ import { IconChevronDown } from "@tabler/icons-react";
7
+ import { Avatar, Label } from "../index";
8
+ export const ColorFlag = ({ property1, className, labelIcon = _jsx(IconChevronDown, { className: "icons-3", color: "#5D5D5D" }), onChange, }) => {
9
+ const containerRef = useRef(null);
10
+ const [isOpen, setIsOpen] = useState(false);
11
+ const initialColor = (property1 === "default" ? "grey" : property1);
12
+ const [selectedColor, setSelectedColor] = useState(initialColor);
13
+ const [overlayPos, setOverlayPos] = useState({ left: 0, right: 0, top: 0, width: 0 });
14
+ useEffect(() => {
15
+ const handleClickOutside = (e) => {
16
+ if (containerRef.current && !containerRef.current.contains(e.target)) {
17
+ setIsOpen(false);
18
+ }
19
+ };
20
+ if (isOpen) {
21
+ document.addEventListener("mousedown", handleClickOutside);
22
+ }
23
+ return () => document.removeEventListener("mousedown", handleClickOutside);
24
+ }, [isOpen]);
25
+ useEffect(() => {
26
+ // sync when prop changes
27
+ const next = (property1 === "default" ? "grey" : property1);
28
+ setSelectedColor(next);
29
+ }, [property1]);
30
+ const updateOverlayPosition = () => {
31
+ const el = containerRef.current;
32
+ if (!el)
33
+ return;
34
+ const rect = el.getBoundingClientRect();
35
+ setOverlayPos({
36
+ left: Math.round(rect.left),
37
+ right: Math.round(window.innerWidth - rect.right),
38
+ top: Math.round(rect.bottom + 6),
39
+ width: Math.round(rect.width),
40
+ });
41
+ };
42
+ useLayoutEffect(() => {
43
+ if (!isOpen)
44
+ return;
45
+ updateOverlayPosition();
46
+ const handle = () => updateOverlayPosition();
47
+ window.addEventListener("scroll", handle, true);
48
+ window.addEventListener("resize", handle);
49
+ return () => {
50
+ window.removeEventListener("scroll", handle, true);
51
+ window.removeEventListener("resize", handle);
52
+ };
53
+ }, [isOpen]);
54
+ const handleToggle = () => setIsOpen((prev) => !prev);
55
+ const handleSelect = (color) => {
56
+ setSelectedColor(color);
57
+ setIsOpen(false);
58
+ onChange?.(color);
59
+ };
60
+ return (_jsxs("div", { className: `color-flag ${className}`, ref: containerRef, onClick: (e) => { e.preventDefault(); e.stopPropagation(); handleToggle(); }, onMouseDown: (e) => { e.preventDefault(); e.stopPropagation(); }, role: "button", tabIndex: 0, onKeyDown: (e) => { if (e.key === "Enter" || e.key === " ") {
61
+ e.preventDefault();
62
+ e.stopPropagation();
63
+ handleToggle();
64
+ } }, children: [_jsx(Avatar, { className: `${selectedColor === "grey" ? "class-2" : (selectedColor === "lime") ? "class-3" : "class-4"}`, color: selectedColor, letter: "", size: "x-small", status: "active", version: "default" }), _jsx(Label, { bold: "off", className: "label-instance-color-flag", color: "black", leftIcon: labelIcon, size: "medium", spacing: "on", stroke: "off", version: "primary" }), isOpen && createPortal(_jsx("div", { className: "color-flag-overlay", onClick: (e) => e.stopPropagation(), style: { right: overlayPos.right, top: overlayPos.top }, children: ["lime", "galliano", "red", "grey"].map((color) => (_jsxs("div", { className: `color-flag-option ${color}`, onClick: () => handleSelect(color), children: [_jsx(Avatar, { className: `${color === "grey" ? "class-2" : color === "lime" ? "class-3" : "class-4"} avatar-instance`, color: color, letter: "", size: "xx-small", status: "active", version: "default" }), _jsx(Label, { bold: "off", className: "label-instance", color: "black", size: "medium", spacing: "on", stroke: "off", text: color.charAt(0).toUpperCase() + color.slice(1), version: "primary" })] }, color))) }), document.body)] }));
65
+ };
66
+ ColorFlag.propTypes = {
67
+ property1: PropTypes.oneOf(["lime", "red", "galliano", "grey", "default"]),
68
+ };
@@ -0,0 +1 @@
1
+ export { ColorFlag } from "./ColorFlag";
@@ -0,0 +1 @@
1
+ export { ColorFlag } from "./ColorFlag";
@@ -0,0 +1,68 @@
1
+ .color-flag {
2
+ align-items: center;
3
+ border-radius: 8px;
4
+ display: inline-flex;
5
+ gap: 4px;
6
+ padding: 4px 2px 4px 4px;
7
+ position: relative;
8
+ }
9
+
10
+ .color-flag *{
11
+ cursor: pointer;
12
+ }
13
+
14
+ .color-flag .class-2 {
15
+ aspect-ratio: 1 !important;
16
+ background-color: #f1f1f1 !important;
17
+ height: 20px !important;
18
+ width: 20px !important;
19
+ }
20
+
21
+ .color-flag .class-3 {
22
+ height: 20px !important;
23
+ width: 20px !important;
24
+ }
25
+
26
+ .color-flag .class-4 {
27
+ aspect-ratio: 1 !important;
28
+ height: 20px !important;
29
+ width: 20px !important;
30
+ }
31
+
32
+ .color-flag .label-instance-color-flag {
33
+ flex: 0 0 auto !important;
34
+ padding: 4px !important;
35
+ }
36
+
37
+ .color-flag .icons-3 {
38
+ height: 18px !important;
39
+ position: relative !important;
40
+ width: 18px !important;
41
+ }
42
+ /* Overlay */
43
+ .color-flag-overlay {
44
+ position: fixed;
45
+ z-index: 10000;
46
+ background: #ffffff;
47
+ border: 1px solid #e0e0e0;
48
+ border-radius: 8px;
49
+ box-shadow: 0 4px 16px rgba(0,0,0,0.12);
50
+ padding: 4px;
51
+ display: grid;
52
+ grid-template-columns: 1fr;
53
+ gap: 6px;
54
+ }
55
+
56
+ .color-flag-option {
57
+ display: flex;
58
+ align-items: center;
59
+ padding-left: 4px;
60
+ border-radius: 6px;
61
+ }
62
+ .color-flag-option * {
63
+ cursor: pointer;
64
+ }
65
+
66
+ .color-flag-option:hover {
67
+ background: #f6f6f6;
68
+ }
@@ -0,0 +1,10 @@
1
+ import React from "react";
2
+ import "./style.css";
3
+ type InfoTooltipProps = {
4
+ text: string;
5
+ className?: string;
6
+ icon?: React.JSX.Element;
7
+ withIcon?: boolean;
8
+ };
9
+ export declare const InfoTooltip: React.FC<InfoTooltipProps>;
10
+ export default InfoTooltip;
@@ -0,0 +1,7 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import "./style.css";
3
+ import { IconInfoCircle } from "@tabler/icons-react";
4
+ export const InfoTooltip = ({ text, className, icon, withIcon = true }) => {
5
+ return (_jsxs("div", { className: `info ${className || ""}`.trim(), children: [withIcon ? (icon || _jsx(IconInfoCircle, { className: "icons", size: 16, color: "#5D5D5D" })) : null, _jsx("p", { className: "text-wrapper", children: text })] }));
6
+ };
7
+ export default InfoTooltip;
@@ -0,0 +1 @@
1
+ export { InfoTooltip } from "./InfoTooltip";
@@ -0,0 +1 @@
1
+ export { InfoTooltip } from "./InfoTooltip";
@@ -0,0 +1,35 @@
1
+ .info {
2
+ align-items: flex-start;
3
+ background-color: #ffffff;
4
+ border-radius: 8px;
5
+ box-shadow: var(--drop-shadow-mid);
6
+ display: flex;
7
+ gap: 6px;
8
+ padding: 6px;
9
+ position: relative;
10
+ width: auto;
11
+ max-width: 276px;
12
+ white-space: normal;
13
+ word-break: break-word;
14
+ }
15
+
16
+ .info .icons {
17
+ height: 16px !important;
18
+ position: relative !important;
19
+ width: 16px !important;
20
+ }
21
+
22
+ .info .text-wrapper {
23
+ color: #5d5d5d;
24
+ flex: 1;
25
+ font-family: var(--b2-medium-font-family);
26
+ font-size: var(--b2-medium-font-size);
27
+ font-style: var(--b2-medium-font-style);
28
+ font-weight: var(--b2-medium-font-weight);
29
+ letter-spacing: var(--b2-medium-letter-spacing);
30
+ line-height: var(--b2-medium-line-height);
31
+ margin-top: -1.00px;
32
+ position: relative;
33
+ }
34
+
35
+
@@ -14,15 +14,17 @@ interface Props {
14
14
  spacing?: "off" | "on";
15
15
  className: any;
16
16
  divClassName?: string;
17
+ onClick?: () => void;
18
+ hover?: boolean;
19
+ tooltip?: string;
20
+ useInfoTooltip?: boolean;
21
+ tooltipWithIcon?: boolean;
17
22
  }
18
23
  export declare const Label: {
19
- ({ text, title, leftIcon, rightIcon, size, color, version, stroke, bold, spacing, className, divClassName, }: Props): React.JSX.Element;
24
+ ({ text, title, leftIcon, rightIcon, size, color, version, stroke, bold, spacing, className, divClassName, onClick, hover, tooltip, useInfoTooltip, tooltipWithIcon, }: Props): React.JSX.Element;
20
25
  propTypes: {
21
26
  text: PropTypes.Requireable<string>;
22
27
  title: PropTypes.Requireable<string>;
23
- withLeftIcon: PropTypes.Requireable<boolean>;
24
- withRightIcon: PropTypes.Requireable<boolean>;
25
- withText: PropTypes.Requireable<boolean>;
26
28
  size: PropTypes.Requireable<string>;
27
29
  color: PropTypes.Requireable<string>;
28
30
  version: PropTypes.Requireable<string>;
@@ -30,6 +32,10 @@ export declare const Label: {
30
32
  bold: PropTypes.Requireable<string>;
31
33
  spacing: PropTypes.Requireable<string>;
32
34
  divClassName: PropTypes.Requireable<string>;
35
+ hover: PropTypes.Requireable<boolean>;
36
+ tooltip: PropTypes.Requireable<string>;
37
+ useInfoTooltip: PropTypes.Requireable<boolean>;
38
+ tooltipWithIcon: PropTypes.Requireable<boolean>;
33
39
  };
34
40
  };
35
41
  export {};
@@ -1,7 +1,9 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import React from "react";
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import React, { useEffect, useRef, useState } from "react";
3
3
  import PropTypes from "prop-types";
4
+ import { createPortal } from "react-dom";
4
5
  import "./style.css";
6
+ import { InfoTooltip } from "../InfoTooltip";
5
7
  const getIconColor = (version, color) => {
6
8
  if (version === "primary" && color === "black") {
7
9
  return "#5D5D5D";
@@ -32,21 +34,58 @@ const getIconClassName = (size) => {
32
34
  };
33
35
  return sizeClassMap[size] || "";
34
36
  };
35
- export const Label = ({ text, title, leftIcon, rightIcon, size, color, version, stroke = "off", bold, spacing, className, divClassName, }) => {
36
- return (_jsxs("div", { className: `label ${size} ${stroke} ${spacing} ${color} ${className}`, title: title, children: [leftIcon && (React.cloneElement(leftIcon, {
37
- className: getIconClassName(size),
38
- color: getIconColor(version, color)
39
- })), text && (_jsx("div", { className: `text-wrapper ${version} bold-${bold} size-${size} color-${color} ${divClassName || ""}`, children: text })), rightIcon && (React.cloneElement(rightIcon, {
40
- className: getIconClassName(size),
41
- color: getIconColor(version, color)
42
- }))] }));
37
+ export const Label = ({ text, title, leftIcon, rightIcon, size, color, version, stroke = "off", bold, spacing, className, divClassName, onClick, hover = false, tooltip = "", useInfoTooltip = false, tooltipWithIcon = true, }) => {
38
+ const strokeClass = stroke === "on" ? "stroke-on" : "stroke-off";
39
+ const tooltipTimerRef = useRef(undefined);
40
+ const [isTooltipVisible, setIsTooltipVisible] = useState(false);
41
+ const labelRef = useRef(null);
42
+ const [anchorPos, setAnchorPos] = useState({ left: 0, top: 0 });
43
+ const hasLabelText = typeof text === "string" && text.trim().length > 0;
44
+ const tooltipText = hasLabelText ? (tooltip || text || "") : (tooltip || "");
45
+ useEffect(() => {
46
+ return () => {
47
+ if (tooltipTimerRef.current) {
48
+ window.clearTimeout(tooltipTimerRef.current);
49
+ }
50
+ };
51
+ }, []);
52
+ const handleMouseEnter = () => {
53
+ if (!tooltipText)
54
+ return;
55
+ const rect = labelRef.current?.getBoundingClientRect();
56
+ if (rect) {
57
+ setAnchorPos({ left: rect.left, top: rect.bottom });
58
+ }
59
+ tooltipTimerRef.current = window.setTimeout(() => {
60
+ setIsTooltipVisible(true);
61
+ }, 150);
62
+ };
63
+ const handleMouseLeave = () => {
64
+ if (tooltipTimerRef.current) {
65
+ window.clearTimeout(tooltipTimerRef.current);
66
+ tooltipTimerRef.current = undefined;
67
+ }
68
+ setIsTooltipVisible(false);
69
+ };
70
+ return (_jsxs(_Fragment, { children: [_jsxs("div", { className: `label ${size} ${strokeClass} ${spacing} ${color} ${className} ${hover ? "hover-move" : ""}`, title: title, onClick: onClick, "data-testid": "label", onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave, style: { cursor: hover ? "pointer" : "default" }, ref: labelRef, children: [leftIcon && (React.cloneElement(leftIcon, {
71
+ className: getIconClassName(size),
72
+ color: getIconColor(version, color)
73
+ })), text && (_jsx("div", { className: `text-wrapper ${version} bold-${bold} size-${size} color-${color} ${divClassName || ""}`, children: text })), rightIcon && (React.cloneElement(rightIcon, {
74
+ className: getIconClassName(size),
75
+ color: getIconColor(version, color)
76
+ }))] }), isTooltipVisible && useInfoTooltip
77
+ ? createPortal(_jsx("div", { style: {
78
+ position: "fixed",
79
+ top: Math.min(anchorPos.top + 6, (typeof window !== "undefined" ? window.innerHeight : 0) - 100),
80
+ left: Math.max(8, Math.min(anchorPos.left, (typeof window !== "undefined" ? window.innerWidth : 0) - 300)),
81
+ zIndex: 9999,
82
+ pointerEvents: "none",
83
+ }, children: _jsx(InfoTooltip, { text: tooltipText, withIcon: tooltipWithIcon }) }), document.body)
84
+ : null] }));
43
85
  };
44
86
  Label.propTypes = {
45
87
  text: PropTypes.string,
46
88
  title: PropTypes.string,
47
- withLeftIcon: PropTypes.bool,
48
- withRightIcon: PropTypes.bool,
49
- withText: PropTypes.bool,
50
89
  size: PropTypes.oneOf(["large", "x-large", "medium", "small"]),
51
90
  color: PropTypes.oneOf([
52
91
  "mauve",
@@ -65,4 +104,8 @@ Label.propTypes = {
65
104
  bold: PropTypes.oneOf(["off", "on"]),
66
105
  spacing: PropTypes.oneOf(["off", "on"]),
67
106
  divClassName: PropTypes.string,
107
+ hover: PropTypes.bool,
108
+ tooltip: PropTypes.string,
109
+ useInfoTooltip: PropTypes.bool,
110
+ tooltipWithIcon: PropTypes.bool,
68
111
  };
@@ -29,7 +29,6 @@
29
29
  align-items: center;
30
30
  display: flex;
31
31
  justify-content: center;
32
- margin-top: -1.00px;
33
32
  position: relative;
34
33
  text-align: center;
35
34
  white-space: nowrap;
@@ -70,13 +70,20 @@
70
70
  display: flex;
71
71
  top: 272px;
72
72
  width: 107px;
73
+ display: flex;
74
+ justify-content: flex-start;
75
+ align-items: center;
73
76
  }
74
77
 
75
78
  .tab-button.small.left-align {
76
79
  display: flex;
77
80
  width: 95px;
81
+ display: flex;
82
+ justify-content: flex-start;
83
+ align-items: center;
78
84
  }
79
85
 
86
+
80
87
  .tab-button.large .button {
81
88
  font-family: var(--h6-medium-font-family);
82
89
  font-size: var(--h6-medium-font-size);
@@ -125,6 +132,7 @@
125
132
  width: fit-content;
126
133
  display: flex;
127
134
  justify-content: flex-start;
135
+ align-items: center;
128
136
  }
129
137
 
130
138
  .tab-button.large.selected .button {
package/dist/index.d.ts CHANGED
@@ -36,3 +36,6 @@ export { Flag } from "./Flag/Flag";
36
36
  export { MessageInputField } from "./MessageInputField/MessageInputField";
37
37
  export { TimeSelector } from "./TimeSelector/TimeSelector";
38
38
  export { TabButtonForSidebar } from "./TabButtonForSidebar/TabButtonForSidebar";
39
+ export { InfoTooltip } from "./InfoTooltip/InfoTooltip";
40
+ export { ColorFlag } from "./ColorFlag/ColorFlag";
41
+ export { CallCenterTasks } from "./CallCenterTasks/CallCenterTasks";
package/dist/index.js CHANGED
@@ -36,3 +36,6 @@ export { Flag } from "./Flag/Flag";
36
36
  export { MessageInputField } from "./MessageInputField/MessageInputField";
37
37
  export { TimeSelector } from "./TimeSelector/TimeSelector";
38
38
  export { TabButtonForSidebar } from "./TabButtonForSidebar/TabButtonForSidebar";
39
+ export { InfoTooltip } from "./InfoTooltip/InfoTooltip";
40
+ export { ColorFlag } from "./ColorFlag/ColorFlag";
41
+ export { CallCenterTasks } from "./CallCenterTasks/CallCenterTasks";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ayseaistudio/ui-components",
3
- "version": "3.2.2",
3
+ "version": "3.3.0",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/index.js",
6
6
  "types": "dist/index.d.ts",