@ayseaistudio/ui-components 2.3.2 → 3.0.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.
Files changed (51) hide show
  1. package/dist/ChatMessageLeft/ChatMessageLeft.d.ts +16 -0
  2. package/dist/ChatMessageLeft/ChatMessageLeft.js +11 -0
  3. package/dist/ChatMessageLeft/index.d.ts +1 -0
  4. package/dist/ChatMessageLeft/index.js +1 -0
  5. package/dist/ChatMessageLeft/style.css +69 -0
  6. package/dist/ChatMessageRight/ChatMessageRight.d.ts +21 -0
  7. package/dist/ChatMessageRight/ChatMessageRight.js +13 -0
  8. package/dist/ChatMessageRight/index.d.ts +1 -0
  9. package/dist/ChatMessageRight/index.js +1 -0
  10. package/dist/ChatMessageRight/style.css +87 -0
  11. package/dist/LabelCheckbox/LabelCheckbox.d.ts +25 -0
  12. package/dist/LabelCheckbox/LabelCheckbox.js +45 -0
  13. package/dist/LabelCheckbox/index.d.ts +1 -0
  14. package/dist/LabelCheckbox/index.js +1 -0
  15. package/dist/LabelCheckbox/style.css +94 -0
  16. package/dist/Player/Player.d.ts +24 -0
  17. package/dist/Player/Player.js +72 -0
  18. package/dist/Player/index.d.ts +1 -0
  19. package/dist/Player/index.js +1 -0
  20. package/dist/Player/style.css +32 -0
  21. package/dist/Radio/Radio.d.ts +19 -0
  22. package/dist/Radio/Radio.js +46 -0
  23. package/dist/Radio/index.d.ts +1 -0
  24. package/dist/Radio/index.js +1 -0
  25. package/dist/Radio/style.css +215 -0
  26. package/dist/SingleSlider/SingleSlider.d.ts +2 -1
  27. package/dist/SingleSlider/SingleSlider.js +2 -2
  28. package/dist/SingleSlider/style.css +22 -0
  29. package/dist/Strikethrough/Strikethrough.d.ts +20 -0
  30. package/dist/Strikethrough/Strikethrough.js +48 -0
  31. package/dist/Strikethrough/index.d.ts +1 -0
  32. package/dist/Strikethrough/index.js +1 -0
  33. package/dist/Strikethrough/style.css +366 -0
  34. package/dist/Switch/Switch.d.ts +17 -0
  35. package/dist/Switch/Switch.js +31 -0
  36. package/dist/Switch/index.d.ts +1 -0
  37. package/dist/Switch/index.js +1 -0
  38. package/dist/Switch/style.css +151 -0
  39. package/dist/SwitchButton/SwitchButton.d.ts +19 -0
  40. package/dist/SwitchButton/SwitchButton.js +63 -0
  41. package/dist/SwitchButton/index.d.ts +1 -0
  42. package/dist/SwitchButton/index.js +1 -0
  43. package/dist/SwitchButton/style.css +17 -0
  44. package/dist/TabButton/TabButton.d.ts +27 -0
  45. package/dist/TabButton/TabButton.js +22 -0
  46. package/dist/TabButton/index.d.ts +1 -0
  47. package/dist/TabButton/index.js +1 -0
  48. package/dist/TabButton/style.css +134 -0
  49. package/dist/index.d.ts +9 -0
  50. package/dist/index.js +9 -0
  51. package/package.json +1 -1
@@ -0,0 +1,16 @@
1
+ import PropTypes from "prop-types";
2
+ import "./style.css";
3
+ interface Props {
4
+ text?: string;
5
+ className?: any;
6
+ timestamp?: string;
7
+ highlighted?: boolean;
8
+ }
9
+ export declare const ChatMessageLeft: {
10
+ ({ text, className, timestamp, highlighted, }: Props): React.JSX.Element;
11
+ propTypes: {
12
+ text: PropTypes.Requireable<string>;
13
+ timestamp: PropTypes.Requireable<string>;
14
+ };
15
+ };
16
+ export {};
@@ -0,0 +1,11 @@
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 { Label } from "../Label/Label";
5
+ export const ChatMessageLeft = ({ text, className, timestamp, highlighted, }) => {
6
+ return (_jsx("div", { className: `chat-message-left ${highlighted ? "highlighted" : ""} ${className}`, children: _jsxs(_Fragment, { children: [_jsx("p", { className: "hafta-sonu-i-in-bir-2", children: text }), _jsx(_Fragment, { children: _jsx("div", { className: "timestamp-wrapper", children: timestamp && (_jsx(Label, { bold: "off", className: "instance-node-2", color: "black", size: "small", spacing: "off", stroke: "off", text: timestamp, version: "secondary" })) }) })] }) }));
7
+ };
8
+ ChatMessageLeft.propTypes = {
9
+ text: PropTypes.string,
10
+ timestamp: PropTypes.string,
11
+ };
@@ -0,0 +1 @@
1
+ export { ChatMessageLeft } from "./ChatMessageLeft";
@@ -0,0 +1 @@
1
+ export { ChatMessageLeft } from "./ChatMessageLeft";
@@ -0,0 +1,69 @@
1
+ .chat-message-left {
2
+ align-items: flex-start;
3
+ border-radius: 16px;
4
+ display: flex;
5
+ gap: 4px;
6
+ padding: 12px;
7
+ position: relative;
8
+ width: 80%;
9
+ cursor: pointer;
10
+ background-color: rgba(241, 241, 241, 1);
11
+ }
12
+
13
+ .chat-message-left.highlighted {
14
+ background-color: rgba(113, 163, 13, 0.05);
15
+ border-color: rgba(152, 211, 23, 1);
16
+ }
17
+
18
+ .chat-message-left *{
19
+ cursor: pointer;
20
+ }
21
+
22
+ .chat-message-left .hafta-sonu-i-in-bir-2 {
23
+ color: #3d3d3d;
24
+ flex: 1;
25
+ font-family: var(--b1-medium-font-family);
26
+ font-size: var(--b1-medium-font-size);
27
+ font-style: var(--b1-medium-font-style);
28
+ font-weight: var(--b1-medium-font-weight);
29
+ letter-spacing: var(--b1-medium-letter-spacing);
30
+ line-height: var(--b1-medium-line-height);
31
+ position: relative;
32
+ }
33
+
34
+ .chat-message-left .instance-node-2 {
35
+ padding: 0px;
36
+ }
37
+
38
+ .chat-message-left .hafta-sonu-i-in-bir-3 {
39
+ align-self: stretch;
40
+ color: #3d3d3d;
41
+ flex: 1;
42
+ font-family: var(--b1-medium-font-family);
43
+ font-size: var(--b1-medium-font-size);
44
+ font-style: var(--b1-medium-font-style);
45
+ font-weight: var(--b1-medium-font-weight);
46
+ letter-spacing: var(--b1-medium-letter-spacing);
47
+ line-height: var(--b1-medium-line-height);
48
+ margin-top: -1.00px;
49
+ position: relative;
50
+ }
51
+
52
+ .chat-message-left .frame-10 {
53
+ align-items: flex-end;
54
+ align-self: stretch;
55
+ display: inline-flex;
56
+ flex: 0 0 auto;
57
+ flex-direction: column;
58
+ justify-content: space-between;
59
+ position: relative;
60
+ }
61
+
62
+ .chat-message-left .timestamp-wrapper {
63
+ justify-content: flex-end;
64
+ align-items: center;
65
+ display: inline-flex;
66
+ height: 100% !important;
67
+ flex-direction: column;
68
+ position: relative;
69
+ }
@@ -0,0 +1,21 @@
1
+ import PropTypes from "prop-types";
2
+ import "./style.css";
3
+ interface Props {
4
+ className?: any;
5
+ divClassName?: any;
6
+ text?: string;
7
+ frameClassName?: any;
8
+ avatarColor?: "grey" | "lime" | "mauve" | "zest" | "blue" | "green" | "galliano" | "orange" | "red";
9
+ timestamp?: string;
10
+ avatarLetter?: string;
11
+ highlighted?: boolean;
12
+ }
13
+ export declare const ChatMessageRight: {
14
+ ({ className, divClassName, text, frameClassName, avatarColor, timestamp, avatarLetter, highlighted, }: Props): React.JSX.Element;
15
+ propTypes: {
16
+ hasDiv: PropTypes.Requireable<boolean>;
17
+ text: PropTypes.Requireable<string>;
18
+ avatarColor: PropTypes.Requireable<string>;
19
+ };
20
+ };
21
+ export {};
@@ -0,0 +1,13 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import PropTypes from "prop-types";
3
+ import "./style.css";
4
+ import { Avatar } from "../Avatar/Avatar";
5
+ import { Label } from "../Label/Label";
6
+ export const ChatMessageRight = ({ className, divClassName, text, frameClassName, avatarColor = "lime", timestamp, avatarLetter, highlighted, }) => {
7
+ return (_jsxs("div", { className: `chat-message-right ${highlighted ? "highlighted" : ""} ${className}`, children: [_jsx("div", { className: "message-baloon", children: _jsx("p", { className: `p ${divClassName}`, children: text }) }), _jsxs("div", { className: `frame-22 ${frameClassName}`, children: [_jsx(Avatar, { color: avatarColor, letter: avatarLetter, size: "medium", status: "default", version: "default" }), _jsx(Label, { bold: "off", className: "label-9", color: "black", size: "small", spacing: "off", stroke: "off", text: timestamp, version: "secondary" })] })] }));
8
+ };
9
+ ChatMessageRight.propTypes = {
10
+ hasDiv: PropTypes.bool,
11
+ text: PropTypes.string,
12
+ avatarColor: PropTypes.string,
13
+ };
@@ -0,0 +1 @@
1
+ export { ChatMessageRight } from "./ChatMessageRight";
@@ -0,0 +1 @@
1
+ export { ChatMessageRight } from "./ChatMessageRight";
@@ -0,0 +1,87 @@
1
+ .chat-message-right {
2
+ align-items: flex-start;
3
+ background-color: #f7f7f7;
4
+ border: 1px solid;
5
+ border-color: #e7e7e7;
6
+ border-radius: 16px;
7
+ display: flex;
8
+ gap: 8px;
9
+ max-width: 560px;
10
+ padding: 12px;
11
+ position: relative;
12
+ width: 80%;
13
+ }
14
+
15
+ .chat-message-right.highlighted {
16
+ background-color: rgba(113, 163, 13, 0.05);
17
+ border-color: rgba(152, 211, 23, 1);
18
+ }
19
+
20
+ .chat-message-right .message-baloon {
21
+ align-items: flex-start;
22
+ display: flex;
23
+ flex: 1;
24
+ flex-grow: 1;
25
+ gap: 12px;
26
+ position: relative;
27
+ }
28
+
29
+ .chat-message-right .message {
30
+ align-items: flex-end;
31
+ align-self: stretch;
32
+ display: flex;
33
+ flex: 1;
34
+ flex-grow: 1;
35
+ gap: 4px;
36
+ justify-content: flex-end;
37
+ position: relative;
38
+ }
39
+
40
+ .chat-message-right .frame-21 {
41
+ align-items: flex-start;
42
+ display: flex;
43
+ flex: 1;
44
+ flex-direction: column;
45
+ flex-grow: 1;
46
+ gap: 6px;
47
+ position: relative;
48
+ }
49
+
50
+ .chat-message-right .text-wrapper-3 {
51
+ align-self: stretch;
52
+ color: #3d3d3d;
53
+ font-family: var(--b1-bold-font-family);
54
+ font-size: var(--b1-bold-font-size);
55
+ font-style: var(--b1-bold-font-style);
56
+ font-weight: var(--b1-bold-font-weight);
57
+ letter-spacing: var(--b1-bold-letter-spacing);
58
+ line-height: var(--b1-bold-line-height);
59
+ margin-top: -1.00px;
60
+ position: relative;
61
+ }
62
+
63
+ .chat-message-right .p {
64
+ align-self: stretch;
65
+ color: #3d3d3d;
66
+ font-family: var(--b1-medium-font-family);
67
+ font-size: var(--b1-medium-font-size);
68
+ font-style: var(--b1-medium-font-style);
69
+ font-weight: var(--b1-medium-font-weight);
70
+ letter-spacing: var(--b1-medium-letter-spacing);
71
+ line-height: var(--b1-medium-line-height);
72
+ position: relative;
73
+ }
74
+
75
+ .chat-message-right .frame-22 {
76
+ align-items: flex-end;
77
+ display: inline-flex;
78
+ flex: 0 0 auto;
79
+ flex-direction: column;
80
+ gap: 6px;
81
+ justify-content: center;
82
+ position: relative;
83
+ }
84
+
85
+ .chat-message-right .label-9 {
86
+ padding: 0px;
87
+ }
@@ -0,0 +1,25 @@
1
+ import PropTypes from "prop-types";
2
+ import { ReactNode } from "react";
3
+ import "./style.css";
4
+ interface Props {
5
+ label?: string;
6
+ size?: "large" | "medium";
7
+ status?: "hover" | "selected" | "default";
8
+ color?: "black";
9
+ className?: string;
10
+ icon?: ReactNode;
11
+ withCheckbox?: boolean;
12
+ }
13
+ export declare const LabelCheckbox: {
14
+ ({ label, size, status, color, className, icon, withCheckbox, }: Props): React.JSX.Element;
15
+ propTypes: {
16
+ label: PropTypes.Requireable<string>;
17
+ icon: PropTypes.Requireable<PropTypes.ReactNodeLike>;
18
+ size: PropTypes.Requireable<string>;
19
+ status: PropTypes.Requireable<string>;
20
+ color: PropTypes.Requireable<string>;
21
+ withCheckbox: PropTypes.Requireable<boolean>;
22
+ className: PropTypes.Requireable<string>;
23
+ };
24
+ };
25
+ export {};
@@ -0,0 +1,45 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import PropTypes from "prop-types";
3
+ import { useReducer } from "react";
4
+ import "./style.css";
5
+ import { Checkbox } from "../Checkbox/Checkbox";
6
+ export const LabelCheckbox = ({ label, size, status, color, className = "", icon, withCheckbox = true, }) => {
7
+ const [state, dispatch] = useReducer(reducer, {
8
+ size: size || "large",
9
+ status: status || "default",
10
+ color: color || "black",
11
+ });
12
+ return (_jsxs("div", { className: `label-checkbox ${state.size} status-1-${state.status} ${className}`, onMouseEnter: () => {
13
+ dispatch("mouse_enter");
14
+ }, onClick: () => {
15
+ dispatch("click");
16
+ }, onMouseLeave: () => {
17
+ dispatch("mouse_leave");
18
+ }, children: [icon && _jsx("span", { className: "icons", children: icon }), label && _jsx("div", { className: "label", children: label }), withCheckbox &&
19
+ _jsx(Checkbox, { className: "checkbox-instance", color: "lime", size: "x-small", status: "default" })] }));
20
+ };
21
+ function reducer(state, action) {
22
+ switch (action) {
23
+ case "mouse_enter":
24
+ return state.status === "default" ? { ...state, status: "hover" } : state;
25
+ case "mouse_leave":
26
+ return state.status === "hover" ? { ...state, status: "default" } : state;
27
+ case "click":
28
+ if (state.status === "hover")
29
+ return { ...state, status: "selected" };
30
+ if (state.status === "selected")
31
+ return { ...state, status: "default" };
32
+ return state;
33
+ default:
34
+ return state;
35
+ }
36
+ }
37
+ LabelCheckbox.propTypes = {
38
+ label: PropTypes.string,
39
+ icon: PropTypes.node,
40
+ size: PropTypes.oneOf(["large", "medium"]),
41
+ status: PropTypes.oneOf(["hover", "selected", "default"]),
42
+ color: PropTypes.oneOf(["black"]),
43
+ withCheckbox: PropTypes.bool,
44
+ className: PropTypes.string,
45
+ };
@@ -0,0 +1 @@
1
+ export { LabelCheckbox } from "./LabelCheckbox";
@@ -0,0 +1 @@
1
+ export { LabelCheckbox } from "./LabelCheckbox";
@@ -0,0 +1,94 @@
1
+ .label-checkbox {
2
+ align-items: center;
3
+ border: 1px solid;
4
+ border-radius: 12px;
5
+ display: flex;
6
+ gap: 6px;
7
+ position: relative;
8
+ width: 130px;
9
+ cursor: pointer;
10
+ }
11
+ .label-checkbox * {
12
+ cursor: pointer;
13
+ }
14
+
15
+ .label-checkbox .icons {
16
+ height: 24px !important;
17
+ position: relative !important;
18
+ width: 24px !important;
19
+ }
20
+
21
+ .label-checkbox .label {
22
+ -webkit-box-orient: vertical;
23
+ -webkit-line-clamp: 1;
24
+ align-items: center;
25
+ display: -webkit-box;
26
+ flex: 1;
27
+ justify-content: center;
28
+ overflow: hidden;
29
+ position: relative;
30
+ text-overflow: ellipsis;
31
+ }
32
+
33
+ .label-checkbox .checkbox-instance {
34
+ background-color: unset !important;
35
+ border: unset !important;
36
+ border-color: unset !important;
37
+ display: flex !important;
38
+ padding: unset !important;
39
+ width: 18px !important;
40
+ }
41
+
42
+ .label-checkbox.large {
43
+ padding: 12px;
44
+ }
45
+
46
+ .label-checkbox.status-1-default {
47
+ background-color: #f7f7f7;
48
+ border-color: #e7e7e7;
49
+ }
50
+
51
+ .label-checkbox.medium {
52
+ padding: 8px;
53
+ }
54
+
55
+ .label-checkbox.status-1-selected {
56
+ background-color: #e7e7e7;
57
+ border-color: #d1d1d1;
58
+ }
59
+
60
+ .label-checkbox.status-1-hover {
61
+ background-color: #f7f7f7;
62
+ border-color: #e7e7e7;
63
+ }
64
+
65
+ .label-checkbox.large .label {
66
+ font-family: var(--h6-medium-font-family);
67
+ font-size: var(--h6-medium-font-size);
68
+ font-style: var(--h6-medium-font-style);
69
+ font-weight: var(--h6-medium-font-weight);
70
+ letter-spacing: var(--h6-medium-letter-spacing);
71
+ line-height: var(--h6-medium-line-height);
72
+ margin-top: -1.00px;
73
+ }
74
+
75
+ .label-checkbox.status-1-default .label {
76
+ color: #888888;
77
+ }
78
+
79
+ .label-checkbox.medium .label {
80
+ font-family: var(--b1-medium-font-family);
81
+ font-size: var(--b1-medium-font-size);
82
+ font-style: var(--b1-medium-font-style);
83
+ font-weight: var(--b1-medium-font-weight);
84
+ letter-spacing: var(--b1-medium-letter-spacing);
85
+ line-height: var(--b1-medium-line-height);
86
+ }
87
+
88
+ .label-checkbox.status-1-selected .label {
89
+ color: #3d3d3d;
90
+ }
91
+
92
+ .label-checkbox.status-1-hover .label {
93
+ color: #5d5d5d;
94
+ }
@@ -0,0 +1,24 @@
1
+ import PropTypes from "prop-types";
2
+ import "./style.css";
3
+ interface Props {
4
+ withButton: boolean;
5
+ size: "large";
6
+ status: "play" | "pause";
7
+ direction: "horizontal";
8
+ isPlaying?: boolean;
9
+ togglePlayPause?: () => void;
10
+ className: any;
11
+ audioUrl?: string;
12
+ audioReference: React.Ref<HTMLAudioElement | null>;
13
+ }
14
+ export declare const Player: {
15
+ ({ withButton, size, status, direction, className, isPlaying, togglePlayPause, audioUrl, audioReference }: Props): React.JSX.Element;
16
+ propTypes: {
17
+ withButton: PropTypes.Requireable<boolean>;
18
+ size: PropTypes.Requireable<string>;
19
+ status: PropTypes.Requireable<string>;
20
+ direction: PropTypes.Requireable<string>;
21
+ audioUrl: PropTypes.Requireable<string>;
22
+ };
23
+ };
24
+ export {};
@@ -0,0 +1,72 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import PropTypes from "prop-types";
3
+ import { SingleSlider } from "../SingleSlider";
4
+ import "./style.css";
5
+ import { IconPlayerPlayFilled, IconPlayerPauseFilled } from "@tabler/icons-react";
6
+ import { PrimaryButton } from "../PrimaryButton/PrimaryButton";
7
+ import { useState, useEffect, useRef } from "react";
8
+ export const Player = ({ withButton = true, size, status, direction, className, isPlaying, togglePlayPause, audioUrl, audioReference }) => {
9
+ const [volume, setVolume] = useState(100);
10
+ const [currentTime, setCurrentTime] = useState(0);
11
+ const [duration, setDuration] = useState(0);
12
+ const audioRef = useRef(null);
13
+ const setAudioInstance = (instance) => {
14
+ audioRef.current = instance;
15
+ if (typeof audioReference === "function") {
16
+ audioReference(instance);
17
+ }
18
+ else if (audioReference && "current" in audioReference) {
19
+ audioReference.current = instance;
20
+ }
21
+ };
22
+ const formatTime = (seconds) => {
23
+ const minutes = Math.floor(seconds / 60);
24
+ const remainingSeconds = Math.floor(seconds % 60);
25
+ return `${minutes}:${remainingSeconds.toString().padStart(2, '0')}`;
26
+ };
27
+ const handleSeekChange = (value) => {
28
+ if (audioRef.current) {
29
+ audioRef.current.currentTime = value;
30
+ setCurrentTime(value);
31
+ }
32
+ };
33
+ useEffect(() => {
34
+ if (audioUrl) {
35
+ fetch(audioUrl)
36
+ .then((res) => res.blob())
37
+ .then((blob) => {
38
+ const blobUrl = URL.createObjectURL(blob);
39
+ setAudioInstance(new Audio(blobUrl));
40
+ audioRef.current?.addEventListener("loadedmetadata", () => {
41
+ setDuration(audioRef.current?.duration || 0);
42
+ });
43
+ audioRef.current?.addEventListener("timeupdate", () => {
44
+ setCurrentTime(audioRef.current?.currentTime || 0);
45
+ });
46
+ // Ses seviyesi ayarı
47
+ if (audioRef.current) {
48
+ audioRef.current.volume = 1.0;
49
+ }
50
+ })
51
+ .catch((err) => {
52
+ console.error("Ses dosyası alınamadı:", err);
53
+ });
54
+ }
55
+ return () => {
56
+ if (audioRef.current) {
57
+ audioRef.current.pause();
58
+ }
59
+ setAudioInstance(null);
60
+ };
61
+ }, [audioUrl]);
62
+ return (_jsxs("div", { className: `player ${className}`, children: [withButton && (_jsx(PrimaryButton, { className: "primary-button", leftIcon: isPlaying ?
63
+ _jsx(IconPlayerPauseFilled, { size: 20, color: "#F1F1F1" }) :
64
+ _jsx(IconPlayerPlayFilled, { size: 20, color: "#F1F1F1" }), color: "black", onClick: togglePlayPause })), _jsx("div", { className: "player-controls", children: _jsx(SingleSlider, { className: "seek-slider", size: "large", status: "zero", value: currentTime, min: 0, max: duration, onChange: handleSeekChange, rightLabel: _jsxs("span", { className: "slider-time", children: [_jsx("span", { className: "current-time", children: formatTime(currentTime) }), _jsx("span", { children: " / " }), _jsx("span", { className: "total-time", children: formatTime(duration || 0) })] }) }) })] }));
65
+ };
66
+ Player.propTypes = {
67
+ withButton: PropTypes.bool,
68
+ size: PropTypes.oneOf(["large"]),
69
+ status: PropTypes.oneOf(["play"]),
70
+ direction: PropTypes.oneOf(["horizontal"]),
71
+ audioUrl: PropTypes.string,
72
+ };
@@ -0,0 +1 @@
1
+ export { Player } from "./Player";
@@ -0,0 +1 @@
1
+ export { Player } from "./Player";
@@ -0,0 +1,32 @@
1
+ .player {
2
+ display: flex;
3
+ align-items: center;
4
+ gap: 16px;
5
+ width: 100%;
6
+ }
7
+
8
+ .player-controls {
9
+ display: flex;
10
+ align-items: center;
11
+ gap: 16px;
12
+ flex: 1;
13
+ }
14
+
15
+ .time-display {
16
+ font-size: 14px;
17
+ color: #303030;
18
+ min-width: 80px;
19
+ text-align: center;
20
+ }
21
+
22
+
23
+
24
+ .player .primary-button {
25
+ border-radius: 50% !important;
26
+ width: 44px !important;
27
+ height: 44px !important;
28
+ display: flex !important;
29
+ align-items: center !important;
30
+ justify-content: center !important;
31
+ box-shadow: none !important;
32
+ }
@@ -0,0 +1,19 @@
1
+ import PropTypes from "prop-types";
2
+ import "./style.css";
3
+ interface Props {
4
+ text?: string;
5
+ size?: "large" | "x-small" | "medium" | "small";
6
+ status?: "hover" | "selected" | "default";
7
+ color?: "black" | "blue" | "lime" | "mauve";
8
+ className?: string;
9
+ }
10
+ export declare const Radio: {
11
+ ({ text, size, status, color, className, }: Props): React.JSX.Element;
12
+ propTypes: {
13
+ text: PropTypes.Requireable<string>;
14
+ size: PropTypes.Requireable<string>;
15
+ status: PropTypes.Requireable<string>;
16
+ color: PropTypes.Requireable<string>;
17
+ };
18
+ };
19
+ export {};
@@ -0,0 +1,46 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import PropTypes from "prop-types";
3
+ import { useReducer } from "react";
4
+ import "./style.css";
5
+ export const Radio = ({ text, size, status, color, className, }) => {
6
+ const [state, dispatch] = useReducer(reducer, {
7
+ size: size || "large",
8
+ status: status || "default",
9
+ color: color || "black",
10
+ });
11
+ return (_jsxs("div", { className: `radio ${state.status} ${state.size} ${state.color} ${className || ""}`, onMouseEnter: () => {
12
+ dispatch("mouse_enter");
13
+ }, onMouseLeave: () => {
14
+ dispatch("mouse_leave");
15
+ }, onClick: () => {
16
+ dispatch("click");
17
+ }, children: [_jsx("div", { className: "field", children: state.status === "selected" && _jsx("div", { className: "ellipse" }) }), text && _jsx("div", { className: "text", children: text })] }));
18
+ };
19
+ function reducer(state, action) {
20
+ const type = typeof action === "string" ? action : action?.type;
21
+ switch (type) {
22
+ case "mouse_enter":
23
+ return {
24
+ ...state,
25
+ status: state.status === "selected" ? "selected" : "hover",
26
+ };
27
+ case "mouse_leave":
28
+ return {
29
+ ...state,
30
+ status: state.status === "selected" ? "selected" : "default",
31
+ };
32
+ case "click":
33
+ return {
34
+ ...state,
35
+ status: state.status === "selected" ? "default" : "selected",
36
+ };
37
+ default:
38
+ return state;
39
+ }
40
+ }
41
+ Radio.propTypes = {
42
+ text: PropTypes.string,
43
+ size: PropTypes.oneOf(["large", "x-small", "medium", "small"]),
44
+ status: PropTypes.oneOf(["hover", "selected", "default"]),
45
+ color: PropTypes.oneOf(["black", "blue", "lime", "mauve"]),
46
+ };
@@ -0,0 +1 @@
1
+ export { Radio } from "./Radio";
@@ -0,0 +1 @@
1
+ export { Radio } from "./Radio";