@ayseaistudio/ui-components 2.2.2 → 2.2.4

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.
@@ -15,7 +15,6 @@
15
15
 
16
16
  .badge.galliano {
17
17
  background-color: #e6c629;
18
- top: 180px;
19
18
  }
20
19
 
21
20
  .badge.large {
@@ -23,7 +22,6 @@
23
22
  display: flex;
24
23
  height: 32px;
25
24
  justify-content: center;
26
- left: 12px;
27
25
  padding: 6px;
28
26
  width: 32px;
29
27
  }
@@ -33,20 +31,17 @@
33
31
  display: flex;
34
32
  height: 14px;
35
33
  justify-content: center;
36
- left: 116px;
37
34
  padding: 4px;
38
35
  width: 14px;
39
36
  }
40
37
 
41
38
  .badge.XX-small {
42
39
  height: 6px;
43
- left: 186px;
44
40
  width: 6px;
45
41
  }
46
42
 
47
43
  .badge.lime {
48
44
  background-color: #b1e635;
49
- top: 68px;
50
45
  }
51
46
 
52
47
  .badge.medium {
@@ -54,30 +49,25 @@
54
49
  display: flex;
55
50
  height: 24px;
56
51
  justify-content: center;
57
- left: 68px;
58
52
  padding: 4px;
59
53
  width: 24px;
60
54
  }
61
55
 
62
56
  .badge.grey {
63
57
  background-color: #3d3d3d;
64
- top: 12px;
65
58
  }
66
59
 
67
60
  .badge.red {
68
61
  background-color: #ff6464;
69
- top: 124px;
70
62
  }
71
63
 
72
64
  .badge.x-small {
73
65
  height: 8px;
74
- left: 154px;
75
66
  width: 8px;
76
67
  }
77
68
 
78
69
  .badge.green {
79
70
  background-color: #6ed184;
80
- top: 236px;
81
71
  }
82
72
 
83
73
  .badge.galliano .element {
@@ -0,0 +1,34 @@
1
+ import PropTypes from "prop-types";
2
+ import "./style.css";
3
+ interface AvatarData {
4
+ letter: string;
5
+ color?: "grey" | "blue" | "green" | "red" | "mauve" | "lime" | "zest" | "orange" | "galliano";
6
+ status?: "active" | "default";
7
+ version?: "default" | "half";
8
+ }
9
+ interface Props {
10
+ avatars?: AvatarData[];
11
+ avatarSize?: "large" | "medium" | "small" | "x-small";
12
+ maxVisible?: number;
13
+ withPlusValue?: boolean;
14
+ plusValue?: string | number;
15
+ size: "large" | "medium" | "small";
16
+ className?: string;
17
+ }
18
+ export declare const MultipleAvatar: {
19
+ ({ avatars, maxVisible, withPlusValue, plusValue, size, className, }: Props): React.JSX.Element;
20
+ propTypes: {
21
+ avatars: PropTypes.Requireable<(PropTypes.InferProps<{
22
+ letter: PropTypes.Validator<string>;
23
+ color: PropTypes.Requireable<string>;
24
+ status: PropTypes.Requireable<string>;
25
+ version: PropTypes.Requireable<string>;
26
+ }> | null | undefined)[]>;
27
+ maxVisible: PropTypes.Requireable<number>;
28
+ withPlusValue: PropTypes.Requireable<boolean>;
29
+ plusValue: PropTypes.Requireable<NonNullable<string | number | null | undefined>>;
30
+ size: PropTypes.Validator<string>;
31
+ className: PropTypes.Requireable<string>;
32
+ };
33
+ };
34
+ export {};
@@ -0,0 +1,39 @@
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";
5
+ import { Label } from "../Label";
6
+ export const MultipleAvatar = ({ avatars, maxVisible = 5, withPlusValue = true, plusValue, size, className = "", }) => {
7
+ const getAvatarSize = (index) => {
8
+ if (size === "small")
9
+ return "x-small";
10
+ if (size === "large")
11
+ return index === 0 ? "medium" : "small";
12
+ return index === 0 ? "small" : "small";
13
+ };
14
+ const defaultAvatars = [
15
+ { letter: "AB", color: "grey", status: "active", version: "default" },
16
+ { letter: "CD", color: "grey", status: "active", version: "default" },
17
+ { letter: "EF", color: "grey", status: "active", version: "default" },
18
+ { letter: "GH", color: "grey", status: "active", version: "default" },
19
+ { letter: "IJ", color: "grey", status: "active", version: "default" },
20
+ ];
21
+ const safeAvatars = avatars || defaultAvatars;
22
+ const visibleAvatars = safeAvatars.slice(0, maxVisible);
23
+ const remainingCount = safeAvatars.length - maxVisible;
24
+ const showPlusValue = withPlusValue && remainingCount > 0;
25
+ return (_jsxs("div", { className: `multiple-avatar size-2-${size} ${className}`, children: [_jsx("div", { className: "avatars", children: visibleAvatars.map((avatar, index) => (_jsx(Avatar, { className: index === 0 ? "avatar-instance" : "instance-node", color: avatar.color || "grey", letter: avatar.letter, size: getAvatarSize(index), status: avatar.status || "active", version: avatar.version || "default" }, index))) }), showPlusValue && (_jsx(Label, { bold: "on", className: `${size === "small" ? "class-4" : "class-5"}`, color: "black", divClassName: `${size === "small" && "class-3"}`, size: size === "large" ? "medium" : "small", spacing: "on", stroke: "off", text: plusValue ? `+${plusValue}` : `+${remainingCount}`, version: "secondary" }))] }));
26
+ };
27
+ MultipleAvatar.propTypes = {
28
+ avatars: PropTypes.arrayOf(PropTypes.shape({
29
+ letter: PropTypes.string.isRequired,
30
+ color: PropTypes.oneOf(["grey", "blue", "green", "red", "mauve", "lime", "zest", "orange", "galliano"]),
31
+ status: PropTypes.oneOf(["active", "default"]),
32
+ version: PropTypes.oneOf(["default", "half"]),
33
+ })),
34
+ maxVisible: PropTypes.number,
35
+ withPlusValue: PropTypes.bool,
36
+ plusValue: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
37
+ size: PropTypes.oneOf(["large", "medium", "small"]).isRequired,
38
+ className: PropTypes.string,
39
+ };
@@ -0,0 +1 @@
1
+ export { MultipleAvatar } from "./MultipleAvatar";
@@ -0,0 +1 @@
1
+ export { MultipleAvatar } from "./MultipleAvatar";
@@ -0,0 +1,50 @@
1
+ .multiple-avatar {
2
+ align-items: center;
3
+ position: relative;
4
+ }
5
+
6
+ .multiple-avatar .avatars {
7
+ align-items: center;
8
+ display: inline-flex;
9
+ flex: 0 0 auto;
10
+ position: relative;
11
+ }
12
+
13
+ .multiple-avatar .instance-node {
14
+ margin-left: -6px !important;
15
+ }
16
+
17
+ .multiple-avatar .class-3 {
18
+ margin-bottom: -1.00px !important;
19
+ margin-top: -3.00px !important;
20
+ }
21
+
22
+ .multiple-avatar .class-4 {
23
+ align-self: stretch !important;
24
+ flex: 0 0 auto !important;
25
+ left: unset !important;
26
+ margin-left: -2px !important;
27
+ top: unset !important;
28
+ }
29
+
30
+ .multiple-avatar .class-5 {
31
+ flex: 0 0 auto !important;
32
+ left: unset !important;
33
+ margin-left: -2px !important;
34
+ top: unset !important;
35
+ }
36
+
37
+ .multiple-avatar.size-2-large {
38
+ display: flex;
39
+ width: 173px;
40
+ }
41
+
42
+ .multiple-avatar.size-2-medium {
43
+ display: inline-flex;
44
+ }
45
+
46
+ .multiple-avatar.size-2-small {
47
+ display: inline-flex;
48
+ height: 24px;
49
+ }
50
+
@@ -1,27 +1,34 @@
1
1
  import PropTypes from "prop-types";
2
2
  import "./style.css";
3
3
  interface Props {
4
- text?: string;
4
+ text: string;
5
5
  subtext?: string;
6
6
  activity?: boolean;
7
- size?: "large" | "x-small" | "medium" | "small";
7
+ size: "large" | "x-small" | "medium" | "small";
8
8
  status?: "pressing" | "default";
9
9
  className?: any;
10
- avatarLetter?: string;
10
+ avatarSize?: string;
11
11
  avatarColor?: string;
12
+ avatarStatus?: string;
13
+ avatarSizeLargeColorClassName?: any;
14
+ avatarLetter?: string;
15
+ activitySize?: string;
12
16
  activityColor?: string;
13
17
  }
14
18
  export declare const ProfileButton: {
15
- ({ text, subtext, activity, size, status, avatarLetter, avatarColor, className, activityColor, }: Props): React.JSX.Element;
19
+ ({ text, subtext, activity, size, status, className, avatarSize, avatarColor, avatarStatus, avatarSizeLargeColorClassName, avatarLetter, activitySize, activityColor, }: Props): React.JSX.Element;
16
20
  propTypes: {
17
21
  text: PropTypes.Requireable<string>;
18
- withText: PropTypes.Requireable<boolean>;
19
22
  subtext: PropTypes.Requireable<string>;
20
- withSubtext: PropTypes.Requireable<boolean>;
21
- withAllText: PropTypes.Requireable<boolean>;
22
23
  activity: PropTypes.Requireable<boolean>;
23
24
  size: PropTypes.Requireable<string>;
24
25
  status: PropTypes.Requireable<string>;
26
+ avatarSize: PropTypes.Requireable<string>;
27
+ avatarColor: PropTypes.Requireable<string>;
28
+ avatarStatus: PropTypes.Requireable<string>;
29
+ avatarLetter: PropTypes.Requireable<string>;
30
+ activitySize: PropTypes.Requireable<string>;
31
+ activityColor: PropTypes.Requireable<string>;
25
32
  };
26
33
  };
27
34
  export {};
@@ -3,22 +3,19 @@ import PropTypes from "prop-types";
3
3
  import "./style.css";
4
4
  import { Avatar } from "../Avatar";
5
5
  import { Activity } from "../Activity";
6
- export const ProfileButton = ({ text, subtext, activity = false, size, status, avatarLetter = "AB", avatarColor = "grey", className, activityColor = "black", }) => {
7
- return (_jsxs("div", { className: `profile-button size-0-${size} ${status} ${className}`, children: [_jsx(Avatar, { className: "avatar-instance", color: avatarColor, letter: avatarLetter, size: size === "medium"
8
- ? "medium"
9
- : size === "small"
10
- ? "small"
11
- : size === "x-small"
12
- ? "x-small"
13
- : "large", status: "default", 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: `${size === "medium" ? "class" : (size === "small") ? "class-2" : size === "x-small" ? "class-3" : "class-4"}`, color: activityColor === "black" || activityColor === "green" || activityColor === "galliano" || activityColor === "red" ? activityColor : undefined, size: "x-small" }))] }));
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" }), ["medium", "small", "x-small"].includes(size) && (_jsx("div", { className: "div-wrapper", children: _jsx("div", { className: "text-wrapper", children: avatarLetter }) })), text && subtext && (_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 }))] }));
14
8
  };
15
9
  ProfileButton.propTypes = {
16
10
  text: PropTypes.string,
17
- withText: PropTypes.bool,
18
11
  subtext: PropTypes.string,
19
- withSubtext: PropTypes.bool,
20
- withAllText: PropTypes.bool,
21
12
  activity: PropTypes.bool,
22
13
  size: PropTypes.oneOf(["large", "x-small", "medium", "small"]),
23
14
  status: PropTypes.oneOf(["pressing", "default"]),
15
+ avatarSize: PropTypes.string,
16
+ avatarColor: PropTypes.string,
17
+ avatarStatus: PropTypes.string,
18
+ avatarLetter: PropTypes.string,
19
+ activitySize: PropTypes.string,
20
+ activityColor: PropTypes.string,
24
21
  };
@@ -3,6 +3,28 @@
3
3
  display: inline-flex;
4
4
  padding: 4px;
5
5
  position: relative;
6
+ cursor: pointer;
7
+ }
8
+
9
+ .profile-button .div-wrapper {
10
+ align-items: center;
11
+ background-color: #d1d1d1;
12
+ box-shadow: inset 0px 0px 10px #ffffff40;
13
+ display: flex;
14
+ flex-direction: column;
15
+ justify-content: center;
16
+ position: relative;
17
+ }
18
+
19
+ .profile-button .text-wrapper {
20
+ align-items: center;
21
+ color: #242424b2;
22
+ display: flex;
23
+ justify-content: center;
24
+ position: relative;
25
+ text-align: center;
26
+ white-space: nowrap;
27
+ width: fit-content;
6
28
  }
7
29
 
8
30
  .profile-button .frame {
@@ -30,33 +52,12 @@
30
52
  }
31
53
 
32
54
  .profile-button .class {
33
- left: 29px !important;
34
- position: absolute !important;
35
- top: 2px !important;
36
- }
37
-
38
- .profile-button .class-2 {
39
- left: 24px !important;
40
55
  position: absolute !important;
41
- top: 2px !important;
42
- }
43
-
44
- .profile-button .class-3 {
45
- left: 20px !important;
46
- position: absolute !important;
47
- top: 2px !important;
48
- }
49
-
50
- .profile-button .class-4 {
51
- left: 48px !important;
52
- position: absolute !important;
53
- top: 2px !important;
54
56
  }
55
57
 
56
58
  .profile-button.size-0-large {
57
59
  border-radius: 16px;
58
60
  gap: 8px;
59
- top: 12px;
60
61
  }
61
62
 
62
63
  .profile-button.size-0-small {
@@ -64,6 +65,7 @@
64
65
  gap: 6px;
65
66
  }
66
67
 
68
+
67
69
  .profile-button.size-0-medium {
68
70
  border-radius: 12px;
69
71
  gap: 6px;
@@ -74,9 +76,70 @@
74
76
  gap: 6px;
75
77
  }
76
78
 
77
- .profile-button.pressing {
79
+ .profile-button.status-0-pressing {
78
80
  background-color: #2424240d;
79
81
  }
82
+
83
+ .profile-button.size-0-x-small .div-wrapper {
84
+ border-radius: 6px;
85
+ height: 24px;
86
+ width: 24px;
87
+ }
88
+
89
+ .profile-button.size-0-large .div-wrapper {
90
+ border-radius: 8px;
91
+ height: 36px;
92
+ width: 36px;
93
+ }
94
+
95
+ .profile-button.size-0-medium .div-wrapper {
96
+ border-radius: 8px;
97
+ height: 36px;
98
+ width: 36px;
99
+ }
100
+
101
+ .profile-button.size-0-small .div-wrapper {
102
+ border-radius: 8px;
103
+ height: 28px;
104
+ width: 28px;
105
+ }
106
+
107
+ .profile-button.size-0-x-small .text-wrapper {
108
+ font-family: var(--b3-bold-font-family);
109
+ font-size: var(--b3-bold-font-size);
110
+ font-style: var(--b3-bold-font-style);
111
+ font-weight: var(--b3-bold-font-weight);
112
+ letter-spacing: var(--b3-bold-letter-spacing);
113
+ line-height: var(--b3-bold-line-height);
114
+ }
115
+
116
+ .profile-button.size-0-large .text-wrapper {
117
+ font-family: var(--b1-black-font-family);
118
+ font-size: var(--b1-black-font-size);
119
+ font-style: var(--b1-black-font-style);
120
+ font-weight: var(--b1-black-font-weight);
121
+ letter-spacing: var(--b1-black-letter-spacing);
122
+ line-height: var(--b1-black-line-height);
123
+ }
124
+
125
+ .profile-button.size-0-medium .text-wrapper {
126
+ font-family: var(--b1-black-font-family);
127
+ font-size: var(--b1-black-font-size);
128
+ font-style: var(--b1-black-font-style);
129
+ font-weight: var(--b1-black-font-weight);
130
+ letter-spacing: var(--b1-black-letter-spacing);
131
+ line-height: var(--b1-black-line-height);
132
+ }
133
+
134
+ .profile-button.size-0-small .text-wrapper {
135
+ font-family: var(--b2-black-font-family);
136
+ font-size: var(--b2-black-font-size);
137
+ font-style: var(--b2-black-font-style);
138
+ font-weight: var(--b2-black-font-weight);
139
+ letter-spacing: var(--b2-black-letter-spacing);
140
+ line-height: var(--b2-black-line-height);
141
+ }
142
+
80
143
  .profile-button.size-0-x-small .frame {
81
144
  height: 24px;
82
145
  }
@@ -34,7 +34,6 @@
34
34
  .tertiary-button .button {
35
35
  align-items: center;
36
36
  justify-content: center;
37
- margin-top: -1.00px;
38
37
  position: relative;
39
38
  text-align: center;
40
39
  white-space: nowrap;
package/dist/index.d.ts CHANGED
@@ -18,3 +18,4 @@ export { ProfileButton } from "./ProfileButton/ProfileButton";
18
18
  export { Checkbox } from "./Checkbox/Checkbox";
19
19
  export { Badge } from "./Badge/Badge";
20
20
  export { CalendarYearDay } from "./CalendarYearDay/CalendarYearDay";
21
+ export { MultipleAvatar } from "./MultipleAvatar/MultipleAvatar";
package/dist/index.js CHANGED
@@ -18,3 +18,4 @@ export { ProfileButton } from "./ProfileButton/ProfileButton";
18
18
  export { Checkbox } from "./Checkbox/Checkbox";
19
19
  export { Badge } from "./Badge/Badge";
20
20
  export { CalendarYearDay } from "./CalendarYearDay/CalendarYearDay";
21
+ export { MultipleAvatar } from "./MultipleAvatar/MultipleAvatar";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ayseaistudio/ui-components",
3
- "version": "2.2.2",
3
+ "version": "2.2.4",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/index.js",
6
6
  "types": "dist/index.d.ts",