@ayseaistudio/ui-components 3.3.0 → 3.4.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.
@@ -0,0 +1,40 @@
1
+ import PropTypes from "prop-types";
2
+ import "./style.css";
3
+ interface Props {
4
+ three?: boolean;
5
+ one?: boolean;
6
+ two?: boolean;
7
+ four?: boolean;
8
+ property1: "two" | "one" | "three" | "four";
9
+ tertiaryButtonWithRightIcon?: boolean;
10
+ tertiaryButtonText?: string;
11
+ tertiaryButtonIcon?: React.JSX.Element;
12
+ labelText?: string;
13
+ labelIcon?: React.JSX.Element;
14
+ onTertiaryButtonClick?: () => void;
15
+ thirdLevelText?: string;
16
+ thirdLevelIcon?: React.JSX.Element;
17
+ secondLevelText?: string;
18
+ secondLevelIcon?: React.JSX.Element;
19
+ onSecondLevelClick?: () => void;
20
+ }
21
+ export declare const Breadcrumbs: {
22
+ ({ three, one, two, four, property1, tertiaryButtonWithRightIcon, tertiaryButtonText, tertiaryButtonIcon, labelText, labelIcon, onTertiaryButtonClick, thirdLevelText, thirdLevelIcon, secondLevelText, secondLevelIcon, onSecondLevelClick, }: Props): React.JSX.Element;
23
+ propTypes: {
24
+ three: PropTypes.Requireable<boolean>;
25
+ one: PropTypes.Requireable<boolean>;
26
+ two: PropTypes.Requireable<boolean>;
27
+ four: PropTypes.Requireable<boolean>;
28
+ property1: PropTypes.Requireable<string>;
29
+ tertiaryButtonWithRightIcon: PropTypes.Requireable<boolean>;
30
+ tertiaryButtonText: PropTypes.Requireable<string>;
31
+ labelText: PropTypes.Requireable<string>;
32
+ onTertiaryButtonClick: PropTypes.Requireable<(...args: any[]) => any>;
33
+ thirdLevelText: PropTypes.Requireable<string>;
34
+ thirdLevelIcon: PropTypes.Requireable<PropTypes.ReactElementLike>;
35
+ secondLevelText: PropTypes.Requireable<string>;
36
+ secondLevelIcon: PropTypes.Requireable<PropTypes.ReactElementLike>;
37
+ onSecondLevelClick: PropTypes.Requireable<(...args: any[]) => any>;
38
+ };
39
+ };
40
+ export {};
@@ -0,0 +1,25 @@
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import PropTypes from "prop-types";
3
+ import "./style.css";
4
+ import { IconChevronRight, IconLayoutDashboard, IconUser } from "@tabler/icons-react";
5
+ import { TertiaryButton } from "../TertiaryButton";
6
+ import { Label } from "../Label";
7
+ export const Breadcrumbs = ({ three = true, one = true, two = true, four = true, property1, tertiaryButtonWithRightIcon, tertiaryButtonText = "Button", tertiaryButtonIcon = (_jsx(IconLayoutDashboard, { size: 16, color: "#6D6D6D" })), labelText = "Label", labelIcon = (_jsx(IconLayoutDashboard, { size: 18, color: "#5D5D5D" })), onTertiaryButtonClick, thirdLevelText, thirdLevelIcon, secondLevelText, secondLevelIcon, onSecondLevelClick, }) => {
8
+ return (_jsxs("div", { className: "breadcrumbs", children: [one && (_jsx(_Fragment, { children: _jsxs(_Fragment, { children: [["four", "three", "two"].includes(property1) && (_jsx(TertiaryButton, { className: "instance-node", color: "black", leftIcon: tertiaryButtonWithRightIcon ? tertiaryButtonIcon : undefined, size: "medium", status: "default", text: tertiaryButtonText, onClick: onTertiaryButtonClick })), property1 === "one" && (_jsx(Label, { bold: "on", className: "instance-node-bordered", color: "black", leftIcon: _jsx(IconLayoutDashboard, { size: 18, color: "#5D5D5D" }), size: "medium", spacing: "on", stroke: "on", text: "Label", version: "primary" }))] }) })), two && _jsx(IconChevronRight, { size: 16, color: "#5D5D5D" }), two && (_jsx(_Fragment, { children: _jsxs(_Fragment, { children: [["four", "one"].includes(property1) && (_jsx(TertiaryButton, { className: "instance-node", color: "black", leftIcon: _jsx(IconUser, { size: 16, color: "#6D6D6D" }), size: "medium", status: "default", text: "Button", onClick: onTertiaryButtonClick })), property1 === "three" && (_jsx(TertiaryButton, { className: "instance-node", color: "black", leftIcon: secondLevelIcon || _jsx(IconLayoutDashboard, { size: 16, color: "#6D6D6D" }), size: "medium", status: "default", text: secondLevelText || "Detay", onClick: onSecondLevelClick })), property1 === "two" && (_jsx(Label, { bold: "on", className: "instance-node-bordered", color: "black", leftIcon: labelIcon, size: "medium", spacing: "on", stroke: "on", text: labelText, version: "primary" }))] }) })), three && _jsx(IconChevronRight, { size: 16, color: "#5D5D5D" }), three && (_jsx(_Fragment, { children: _jsxs(_Fragment, { children: [["four", "one", "two"].includes(property1) && property1 !== "three" && (_jsx(TertiaryButton, { className: "instance-node", color: "black", leftIcon: _jsx(IconLayoutDashboard, { size: 16, color: "#6D6D6D" }), size: "medium", status: "default", text: "Button", onClick: onTertiaryButtonClick })), property1 === "three" && thirdLevelText && (_jsx(Label, { bold: "on", className: "instance-node-bordered", color: "black", leftIcon: thirdLevelIcon || _jsx(IconLayoutDashboard, { size: 18, color: "#5D5D5D" }), size: "medium", spacing: "on", stroke: "on", text: thirdLevelText, version: "primary" }))] }) })), four && _jsx(IconChevronRight, { size: 16, color: "#5D5D5D" }), four && (_jsx(_Fragment, { children: _jsxs(_Fragment, { children: [property1 === "four" && (_jsx(Label, { bold: "on", className: "instance-node", color: "black", leftIcon: _jsx(IconLayoutDashboard, { size: 18, color: "#5D5D5D" }), size: "medium", spacing: "on", stroke: "on", text: "Label", version: "primary" })), ["one", "two"].includes(property1) && (_jsx(TertiaryButton, { className: "instance-node", color: "black", leftIcon: _jsx(IconLayoutDashboard, { size: 16, color: "#6D6D6D" }), size: "medium", status: "default", text: "Button", onClick: onTertiaryButtonClick })), property1 === "three" && thirdLevelText && (_jsx(Label, { bold: "on", className: "instance-node-bordered", color: "black", leftIcon: thirdLevelIcon || _jsx(IconLayoutDashboard, { size: 18, color: "#5D5D5D" }), size: "medium", spacing: "on", stroke: "on", text: thirdLevelText, version: "primary" }))] }) }))] }));
9
+ };
10
+ Breadcrumbs.propTypes = {
11
+ three: PropTypes.bool,
12
+ one: PropTypes.bool,
13
+ two: PropTypes.bool,
14
+ four: PropTypes.bool,
15
+ property1: PropTypes.oneOf(["two", "one", "three", "four"]),
16
+ tertiaryButtonWithRightIcon: PropTypes.bool,
17
+ tertiaryButtonText: PropTypes.string,
18
+ labelText: PropTypes.string,
19
+ onTertiaryButtonClick: PropTypes.func,
20
+ thirdLevelText: PropTypes.string,
21
+ thirdLevelIcon: PropTypes.element,
22
+ secondLevelText: PropTypes.string,
23
+ secondLevelIcon: PropTypes.element,
24
+ onSecondLevelClick: PropTypes.func,
25
+ };
@@ -0,0 +1 @@
1
+ export { Breadcrumbs } from "./Breadcrumbs";
@@ -0,0 +1 @@
1
+ export { Breadcrumbs } from "./Breadcrumbs";
@@ -0,0 +1,14 @@
1
+ .breadcrumbs {
2
+ align-items: center;
3
+ display: inline-flex;
4
+ position: relative;
5
+ }
6
+
7
+ .breadcrumbs .instance-node {
8
+ flex: 0 0 auto !important;
9
+ }
10
+
11
+ .breadcrumbs .instance-node-bordered {
12
+ border: 1px solid rgba(209, 209, 209, 1);
13
+ border-radius: 8px;
14
+ }
@@ -3,16 +3,14 @@ import "./style.css";
3
3
  interface Props {
4
4
  status?: "warning" | "complete" | "default";
5
5
  className?: any;
6
- icon?: React.ReactNode;
6
+ icon?: React.JSX.Element;
7
7
  divideVerticalDivideVertical?: string;
8
8
  strikethroughText?: string;
9
9
  labelText?: string;
10
- strikethroughDivClassName?: any;
11
- strikethroughIcon?: React.ReactNode;
12
10
  index?: number;
13
11
  }
14
12
  export declare const CallCenterTasks: {
15
- ({ status, className, strikethroughText, labelText, strikethroughDivClassName, strikethroughIcon, index, }: Props): React.ReactNode;
13
+ ({ status, className, strikethroughText, labelText, index, }: Props): React.JSX.Element;
16
14
  propTypes: {
17
15
  status: PropTypes.Requireable<string>;
18
16
  strikethroughText: PropTypes.Requireable<string>;
@@ -3,9 +3,7 @@ import PropTypes from "prop-types";
3
3
  import { Label } from "../Label";
4
4
  import { Strikethrough } from "../Strikethrough";
5
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, }) => {
6
+ export const CallCenterTasks = ({ status, className, strikethroughText = "Selamlaşma ve kendini tanıtma.", labelText, index = 1, }) => {
9
7
  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
8
  };
11
9
  CallCenterTasks.propTypes = {
@@ -58,11 +58,11 @@
58
58
  gap: 4px;
59
59
  }
60
60
 
61
- .label.on {
61
+ .label.stroke-on {
62
62
  border: 1px solid;
63
63
  }
64
64
 
65
- .label.off {
65
+ .label.stroke-off {
66
66
  border: none;
67
67
  }
68
68
 
@@ -14,9 +14,13 @@ interface Props {
14
14
  avatarLetter?: string;
15
15
  activitySize?: string;
16
16
  activityColor?: string;
17
+ hover?: boolean;
18
+ useInfoTooltip?: boolean;
19
+ tooltip?: string;
20
+ tooltipWithIcon?: boolean;
17
21
  }
18
22
  export declare const ProfileButton: {
19
- ({ text, subtext, activity, size, status, className, avatarSize, avatarColor, avatarStatus, avatarSizeLargeColorClassName, avatarLetter, activitySize, activityColor, }: Props): React.JSX.Element;
23
+ ({ text, subtext, activity, size, status, className, avatarSize, avatarColor, avatarStatus, avatarSizeLargeColorClassName, avatarLetter, activitySize, activityColor, hover, useInfoTooltip, tooltip, tooltipWithIcon, }: Props): React.JSX.Element;
20
24
  propTypes: {
21
25
  text: PropTypes.Requireable<string>;
22
26
  subtext: PropTypes.Requireable<string>;
@@ -29,6 +33,10 @@ export declare const ProfileButton: {
29
33
  avatarLetter: PropTypes.Requireable<string>;
30
34
  activitySize: PropTypes.Requireable<string>;
31
35
  activityColor: PropTypes.Requireable<string>;
36
+ hover: PropTypes.Requireable<boolean>;
37
+ useInfoTooltip: PropTypes.Requireable<boolean>;
38
+ tooltip: PropTypes.Requireable<string>;
39
+ tooltipWithIcon: PropTypes.Requireable<boolean>;
32
40
  };
33
41
  };
34
42
  export {};
@@ -1,10 +1,49 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
2
  import PropTypes from "prop-types";
3
3
  import "./style.css";
4
+ import { useEffect, useRef, useState } from "react";
5
+ import { createPortal } from "react-dom";
4
6
  import { Avatar } from "../Avatar";
5
7
  import { Activity } from "../Activity";
6
- export const ProfileButton = ({ text, subtext, activity = false, size, status, className, avatarSize, avatarColor, avatarStatus, avatarSizeLargeColorClassName, avatarLetter, activitySize, activityColor, }) => {
7
- return (_jsxs("div", { className: `profile-button size-0-${size} status-0-${status} ${className}`, children: [_jsx(Avatar, { className: avatarSizeLargeColorClassName, color: avatarColor, letter: avatarLetter, size: avatarSize, status: avatarStatus, version: "default" }), _jsxs("div", { className: "frame", children: [text && _jsx("div", { className: "text", children: text }), subtext && _jsx("div", { className: "subtext", children: subtext })] }), activity && (_jsx(Activity, { className: `class`, color: activityColor, size: activitySize }))] }));
8
+ import { InfoTooltip } from "../InfoTooltip";
9
+ export const ProfileButton = ({ text, subtext, activity = false, size, status, className, avatarSize, avatarColor, avatarStatus, avatarSizeLargeColorClassName, avatarLetter, activitySize, activityColor, hover = false, useInfoTooltip = false, tooltip = "", tooltipWithIcon = true, }) => {
10
+ const tooltipTimerRef = useRef(undefined);
11
+ const [isTooltipVisible, setIsTooltipVisible] = useState(false);
12
+ const containerRef = useRef(null);
13
+ const [anchorPos, setAnchorPos] = useState({ left: 0, top: 0 });
14
+ useEffect(() => {
15
+ return () => {
16
+ if (tooltipTimerRef.current)
17
+ window.clearTimeout(tooltipTimerRef.current);
18
+ };
19
+ }, []);
20
+ const handleMouseEnter = () => {
21
+ const tooltipText = (tooltip && tooltip.trim().length > 0) ? tooltip : text;
22
+ if (!tooltipText)
23
+ return;
24
+ const rect = containerRef.current?.getBoundingClientRect();
25
+ if (rect) {
26
+ setAnchorPos({ left: rect.left, top: rect.bottom });
27
+ }
28
+ tooltipTimerRef.current = window.setTimeout(() => {
29
+ setIsTooltipVisible(true);
30
+ }, 150);
31
+ };
32
+ const handleMouseLeave = () => {
33
+ if (tooltipTimerRef.current)
34
+ window.clearTimeout(tooltipTimerRef.current);
35
+ setIsTooltipVisible(false);
36
+ };
37
+ return (_jsxs(_Fragment, { children: [_jsxs("div", { className: `profile-button size-0-${size} status-0-${status} ${className}`, onMouseEnter: hover ? handleMouseEnter : undefined, onMouseLeave: hover ? handleMouseLeave : undefined, ref: containerRef, style: { cursor: hover ? "pointer" : "default" }, children: [_jsx(Avatar, { className: avatarSizeLargeColorClassName, color: avatarColor, letter: avatarLetter, size: avatarSize, status: avatarStatus, version: "default" }), _jsxs("div", { className: "frame", children: [text && _jsx("div", { className: "text", children: text }), subtext && _jsx("div", { className: "subtext", children: subtext })] }), activity && (_jsx(Activity, { className: `class`, color: activityColor, size: activitySize }))] }), isTooltipVisible && useInfoTooltip
38
+ ? typeof document !== "undefined" &&
39
+ createPortal(_jsx("div", { style: {
40
+ position: "fixed",
41
+ top: Math.min(anchorPos.top + 6, (typeof window !== "undefined" ? window.innerHeight : 0) - 100),
42
+ left: Math.max(8, Math.min(anchorPos.left, (typeof window !== "undefined" ? window.innerWidth : 0) - 300)),
43
+ zIndex: 9999,
44
+ pointerEvents: "none",
45
+ }, children: _jsx(InfoTooltip, { text: (tooltip && tooltip.trim().length > 0) ? tooltip : (text || ""), withIcon: tooltipWithIcon }) }), document.body)
46
+ : null] }));
8
47
  };
9
48
  ProfileButton.propTypes = {
10
49
  text: PropTypes.string,
@@ -18,4 +57,8 @@ ProfileButton.propTypes = {
18
57
  avatarLetter: PropTypes.string,
19
58
  activitySize: PropTypes.string,
20
59
  activityColor: PropTypes.string,
60
+ hover: PropTypes.bool,
61
+ useInfoTooltip: PropTypes.bool,
62
+ tooltip: PropTypes.string,
63
+ tooltipWithIcon: PropTypes.bool,
21
64
  };
package/dist/index.d.ts CHANGED
@@ -39,3 +39,4 @@ export { TabButtonForSidebar } from "./TabButtonForSidebar/TabButtonForSidebar";
39
39
  export { InfoTooltip } from "./InfoTooltip/InfoTooltip";
40
40
  export { ColorFlag } from "./ColorFlag/ColorFlag";
41
41
  export { CallCenterTasks } from "./CallCenterTasks/CallCenterTasks";
42
+ export { Breadcrumbs } from "./Breadcrumbs/Breadcrumbs";
package/dist/index.js CHANGED
@@ -39,3 +39,4 @@ export { TabButtonForSidebar } from "./TabButtonForSidebar/TabButtonForSidebar";
39
39
  export { InfoTooltip } from "./InfoTooltip/InfoTooltip";
40
40
  export { ColorFlag } from "./ColorFlag/ColorFlag";
41
41
  export { CallCenterTasks } from "./CallCenterTasks/CallCenterTasks";
42
+ export { Breadcrumbs } from "./Breadcrumbs/Breadcrumbs";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ayseaistudio/ui-components",
3
- "version": "3.3.0",
3
+ "version": "3.4.0",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/index.js",
6
6
  "types": "dist/index.d.ts",