@krrli/cm-designsystem 1.33.1 → 1.33.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.
- package/dist/cm-designsystem.css +4 -4
- package/dist/components/avatar/Avatar.d.ts +1 -1
- package/dist/components/avatar/Avatar.d.ts.map +1 -1
- package/dist/components/avatar/Avatar.js +5 -9
- package/dist/components/like-toggle/LikeToggle.d.ts +1 -1
- package/dist/components/like-toggle/LikeToggle.d.ts.map +1 -1
- package/dist/compositions/post/Post.d.ts +11 -11
- package/dist/compositions/post/Post.d.ts.map +1 -1
- package/dist/compositions/post/Post.js +9 -11
- package/dist/compositions/post-creator/PostCreator.d.ts +1 -1
- package/dist/compositions/post-creator/PostCreator.d.ts.map +1 -1
- package/dist/compositions/profile-banner/ProfileBanner.d.ts +7 -7
- package/dist/compositions/profile-banner/ProfileBanner.d.ts.map +1 -1
- package/dist/compositions/profile-banner/ProfileBanner.js +3 -5
- package/dist/compositions/profile-banner-image/ProfileBannerImage.d.ts +1 -1
- package/dist/compositions/profile-banner-image/ProfileBannerImage.d.ts.map +1 -1
- package/dist/compositions/profile-banner-image/ProfileBannerImage.js +1 -1
- package/dist/compositions/profile-banner-info/ProfileBannerInfo.d.ts +11 -11
- package/dist/compositions/profile-banner-info/ProfileBannerInfo.d.ts.map +1 -1
- package/dist/compositions/profile-banner-info/ProfileBannerInfo.js +13 -7
- package/dist/compositions/response/Response.d.ts +7 -7
- package/dist/compositions/response/Response.d.ts.map +1 -1
- package/dist/compositions/response/Response.js +9 -11
- package/dist/compositions/response-creator/ResponseCreator.d.ts +3 -3
- package/dist/compositions/response-creator/ResponseCreator.d.ts.map +1 -1
- package/dist/compositions/user-info/UserInfo.d.ts +10 -10
- package/dist/compositions/user-info/UserInfo.d.ts.map +1 -1
- package/dist/compositions/user-info/UserInfo.js +13 -16
- package/dist/compositions/utils/keyword.utils.d.ts +1 -1
- package/dist/compositions/utils/keyword.utils.d.ts.map +1 -1
- package/package.json +7 -7
package/dist/cm-designsystem.css
CHANGED
|
@@ -394,6 +394,10 @@
|
|
|
394
394
|
top: calc(var(--spacing) * 6);
|
|
395
395
|
}
|
|
396
396
|
|
|
397
|
+
.top-60 {
|
|
398
|
+
top: calc(var(--spacing) * 60);
|
|
399
|
+
}
|
|
400
|
+
|
|
397
401
|
.right-2 {
|
|
398
402
|
right: calc(var(--spacing) * 2);
|
|
399
403
|
}
|
|
@@ -406,10 +410,6 @@
|
|
|
406
410
|
right: calc(var(--spacing) * 6);
|
|
407
411
|
}
|
|
408
412
|
|
|
409
|
-
.-bottom-20 {
|
|
410
|
-
bottom: calc(var(--spacing) * -20);
|
|
411
|
-
}
|
|
412
|
-
|
|
413
413
|
.bottom-2 {
|
|
414
414
|
bottom: calc(var(--spacing) * 2);
|
|
415
415
|
}
|
|
@@ -89,7 +89,7 @@ interface AvatarProps extends AvatarVariants {
|
|
|
89
89
|
/**
|
|
90
90
|
* The URL source of the avatar image.
|
|
91
91
|
*/
|
|
92
|
-
src
|
|
92
|
+
src?: string | null;
|
|
93
93
|
/**
|
|
94
94
|
* Accessible label for the action button that appears on extra-large (`xl`)
|
|
95
95
|
* avatars when `onActionClick` is provided.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Avatar.d.ts","sourceRoot":"","sources":["../../../src/components/avatar/Avatar.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAM,KAAK,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAK1D,QAAA,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2CAwDhB,CAAC;AAEH,KAAK,cAAc,GAAG,YAAY,CAAC,OAAO,YAAY,CAAC,CAAC;AACxD,KAAK,UAAU,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAE5C;;GAEG;AACH,UAAU,WAAY,SAAQ,cAAc;IAC1C;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;IAEZ;;OAEG;IACH,IAAI,EAAE,UAAU,CAAC;IAEjB;;OAEG;IACH,GAAG,EAAE,MAAM,GAAG,
|
|
1
|
+
{"version":3,"file":"Avatar.d.ts","sourceRoot":"","sources":["../../../src/components/avatar/Avatar.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAM,KAAK,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAK1D,QAAA,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2CAwDhB,CAAC;AAEH,KAAK,cAAc,GAAG,YAAY,CAAC,OAAO,YAAY,CAAC,CAAC;AACxD,KAAK,UAAU,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAE5C;;GAEG;AACH,UAAU,WAAY,SAAQ,cAAc;IAC1C;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;IAEZ;;OAEG;IACH,IAAI,EAAE,UAAU,CAAC;IAEjB;;OAEG;IACH,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAEpB;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IAEzB;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,IAAI,CAAC;IAE3B;;;;;;;OAOG;IACH,aAAa,CAAC,EAAE,MAAM,IAAI,CAAC;CAC5B;AAED;;;GAGG;AACH,eAAO,MAAM,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CA4BxC,CAAC"}
|
|
@@ -62,7 +62,10 @@ const avatarStyles = tv({
|
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
64
|
});
|
|
65
|
-
const Avatar = (
|
|
65
|
+
const Avatar = ({
|
|
66
|
+
src = "",
|
|
67
|
+
...props
|
|
68
|
+
}) => {
|
|
66
69
|
const { base, avatar, action } = avatarStyles(props);
|
|
67
70
|
return /* @__PURE__ */ jsxs(
|
|
68
71
|
RadixAvatar.Root,
|
|
@@ -71,14 +74,7 @@ const Avatar = (props) => {
|
|
|
71
74
|
className: base({ isClickable: !!props.onAvatarClick, ...props }),
|
|
72
75
|
"data-testid": "avatar",
|
|
73
76
|
children: [
|
|
74
|
-
/* @__PURE__ */ jsx(
|
|
75
|
-
RadixAvatar.Image,
|
|
76
|
-
{
|
|
77
|
-
src: props.src,
|
|
78
|
-
alt: props.alt,
|
|
79
|
-
className: avatar(props)
|
|
80
|
-
}
|
|
81
|
-
),
|
|
77
|
+
/* @__PURE__ */ jsx(RadixAvatar.Image, { src, alt: props.alt, className: avatar(props) }),
|
|
82
78
|
props.size === "xl" && props.onActionClick && /* @__PURE__ */ jsx("div", { className: action(props), children: /* @__PURE__ */ jsx(
|
|
83
79
|
RoundButton,
|
|
84
80
|
{
|
|
@@ -90,7 +90,7 @@ declare const toggleStyles: import('tailwind-variants').TVReturnType<{
|
|
|
90
90
|
type LikeToggleVariants = VariantProps<typeof toggleStyles>;
|
|
91
91
|
interface LikeToggleProps extends LikeToggleVariants {
|
|
92
92
|
pressed?: boolean;
|
|
93
|
-
likes?: number;
|
|
93
|
+
likes?: number | null;
|
|
94
94
|
onLikeChange: (liked: boolean) => void;
|
|
95
95
|
}
|
|
96
96
|
export declare const LikeToggle: ({ pressed, likes, onLikeChange, }: LikeToggleProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LikeToggle.d.ts","sourceRoot":"","sources":["../../../src/components/like-toggle/LikeToggle.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAM,KAAK,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAI1D,QAAA,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2CA0IhB,CAAC;AAEH,KAAK,kBAAkB,GAAG,YAAY,CAAC,OAAO,YAAY,CAAC,CAAC;AAE5D,UAAU,eAAgB,SAAQ,kBAAkB;IAClD,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"LikeToggle.d.ts","sourceRoot":"","sources":["../../../src/components/like-toggle/LikeToggle.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAM,KAAK,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAI1D,QAAA,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2CA0IhB,CAAC;AAEH,KAAK,kBAAkB,GAAG,YAAY,CAAC,OAAO,YAAY,CAAC,CAAC;AAE5D,UAAU,eAAgB,SAAQ,kBAAkB;IAClD,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,YAAY,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;CACxC;AAED,eAAO,MAAM,UAAU,GAAI,mCAIxB,eAAe,4CAwEjB,CAAC"}
|
|
@@ -45,25 +45,25 @@ interface PostProps extends PostVariants {
|
|
|
45
45
|
/** Size of the post, affecting layout and styling. */
|
|
46
46
|
size: PostSize;
|
|
47
47
|
/** The display name of the user who created the post. */
|
|
48
|
-
displayName
|
|
48
|
+
displayName?: string | null;
|
|
49
49
|
/** The username or handle associated with the post. */
|
|
50
|
-
userName
|
|
50
|
+
userName?: string | null;
|
|
51
51
|
/** The date and time when the post was created. */
|
|
52
|
-
timestamp
|
|
52
|
+
timestamp?: Date | null;
|
|
53
53
|
/** The main text content of the post. */
|
|
54
|
-
text
|
|
54
|
+
text?: string;
|
|
55
55
|
/** Avatar image URL */
|
|
56
|
-
|
|
57
|
-
/** Triggered when the avatar is clicked. */
|
|
58
|
-
onAvatarClick: () => void;
|
|
56
|
+
avatarSrc?: string | null;
|
|
59
57
|
/** Number of likes the post has received. */
|
|
60
|
-
nbrOfLikes
|
|
58
|
+
nbrOfLikes?: number | null;
|
|
61
59
|
/** Number of comments the post has received. */
|
|
62
|
-
nbrOfComments
|
|
60
|
+
nbrOfComments?: number | null;
|
|
63
61
|
/** Optional image source URL displayed within the post. */
|
|
64
|
-
imageSrc?: string |
|
|
62
|
+
imageSrc?: string | null;
|
|
65
63
|
/** Optional alt text for the post image, used for accessibility. */
|
|
66
|
-
imageAlt?: string;
|
|
64
|
+
imageAlt?: string | null;
|
|
65
|
+
/** Triggered when the avatar is clicked. */
|
|
66
|
+
onAvatarClick: () => void;
|
|
67
67
|
/** Callback fired when the comment button is clicked. */
|
|
68
68
|
onCommentClick: () => void;
|
|
69
69
|
/** Callback fired when the like button is clicked. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Post.d.ts","sourceRoot":"","sources":["../../../src/compositions/post/Post.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAM,KAAK,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAc1D,QAAA,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2CAmBd,CAAC;AAEH,KAAK,YAAY,GAAG,YAAY,CAAC,OAAO,UAAU,CAAC,CAAC;AACpD,KAAK,QAAQ,GAAG,IAAI,GAAG,IAAI,CAAC;AAE5B,UAAU,SAAU,SAAQ,YAAY;IACtC,sDAAsD;IACtD,IAAI,EAAE,QAAQ,CAAC;IAEf,yDAAyD;IACzD,WAAW,EAAE,MAAM,GAAG,
|
|
1
|
+
{"version":3,"file":"Post.d.ts","sourceRoot":"","sources":["../../../src/compositions/post/Post.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAM,KAAK,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAc1D,QAAA,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2CAmBd,CAAC;AAEH,KAAK,YAAY,GAAG,YAAY,CAAC,OAAO,UAAU,CAAC,CAAC;AACpD,KAAK,QAAQ,GAAG,IAAI,GAAG,IAAI,CAAC;AAE5B,UAAU,SAAU,SAAQ,YAAY;IACtC,sDAAsD;IACtD,IAAI,EAAE,QAAQ,CAAC;IAEf,yDAAyD;IACzD,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAE5B,uDAAuD;IACvD,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAEzB,mDAAmD;IACnD,SAAS,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IAExB,yCAAyC;IACzC,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd,uBAAuB;IACvB,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAE1B,6CAA6C;IAC7C,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAE3B,gDAAgD;IAChD,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAE9B,2DAA2D;IAC3D,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAEzB,oEAAoE;IACpE,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAEzB,4CAA4C;IAC5C,aAAa,EAAE,MAAM,IAAI,CAAC;IAE1B,yDAAyD;IACzD,cAAc,EAAE,MAAM,IAAI,CAAC;IAE3B,sDAAsD;IACtD,WAAW,EAAE,MAAM,IAAI,CAAC;IAExB,uDAAuD;IACvD,YAAY,EAAE,MAAM,IAAI,CAAC;CAC1B;AAED;;;GAGG;AACH,eAAO,MAAM,IAAI,EAAE,KAAK,CAAC,EAAE,CAAC,SAAS,CA4DpC,CAAC"}
|
|
@@ -31,7 +31,11 @@ const PostStyles = tv({
|
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
33
|
});
|
|
34
|
-
const Post = (
|
|
34
|
+
const Post = ({
|
|
35
|
+
nbrOfLikes = 0,
|
|
36
|
+
nbrOfComments = 0,
|
|
37
|
+
...props
|
|
38
|
+
}) => {
|
|
35
39
|
const { base, avatar, content, text, action } = PostStyles(props);
|
|
36
40
|
return /* @__PURE__ */ jsxs(PostBase, { className: base(), children: [
|
|
37
41
|
/* @__PURE__ */ jsx("div", { className: avatar(), children: /* @__PURE__ */ jsx(
|
|
@@ -39,7 +43,7 @@ const Post = (props) => {
|
|
|
39
43
|
{
|
|
40
44
|
alt: "Profile",
|
|
41
45
|
size: "md",
|
|
42
|
-
src: props.
|
|
46
|
+
src: props.avatarSrc,
|
|
43
47
|
onAvatarClick: props.onAvatarClick
|
|
44
48
|
}
|
|
45
49
|
) }),
|
|
@@ -69,18 +73,12 @@ const Post = (props) => {
|
|
|
69
73
|
Toggle,
|
|
70
74
|
{
|
|
71
75
|
ariaLabel: "Comment",
|
|
72
|
-
labelText:
|
|
73
|
-
pressed:
|
|
76
|
+
labelText: nbrOfComments === 0 ? "Comment" : nbrOfComments === 1 ? "1 Comment" : `${nbrOfComments} Comments`,
|
|
77
|
+
pressed: nbrOfComments !== 0,
|
|
74
78
|
onToggle: props.onCommentClick
|
|
75
79
|
}
|
|
76
80
|
),
|
|
77
|
-
/* @__PURE__ */ jsx(
|
|
78
|
-
LikeToggle,
|
|
79
|
-
{
|
|
80
|
-
likes: props.nbrOfLikes,
|
|
81
|
-
onLikeChange: props.onLikeClick
|
|
82
|
-
}
|
|
83
|
-
),
|
|
81
|
+
/* @__PURE__ */ jsx(LikeToggle, { likes: nbrOfLikes, onLikeChange: props.onLikeClick }),
|
|
84
82
|
/* @__PURE__ */ jsx(
|
|
85
83
|
TimedButton,
|
|
86
84
|
{
|
|
@@ -51,7 +51,7 @@ declare const PostCreatorStyles: import('tailwind-variants').TVReturnType<{
|
|
|
51
51
|
type PostCreatorVariants = VariantProps<typeof PostCreatorStyles>;
|
|
52
52
|
interface PostCreatorProps extends PostCreatorVariants {
|
|
53
53
|
/** Avatar image URL */
|
|
54
|
-
src: string |
|
|
54
|
+
src: string | null;
|
|
55
55
|
/** Triggered when the avatar is clicked. */
|
|
56
56
|
onAvatarClick: () => void;
|
|
57
57
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PostCreator.d.ts","sourceRoot":"","sources":["../../../src/compositions/post-creator/PostCreator.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAM,KAAK,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAS1D,QAAA,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2CAQrB,CAAC;AAEH,KAAK,mBAAmB,GAAG,YAAY,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAElE,UAAU,gBAAiB,SAAQ,mBAAmB;IACpD,uBAAuB;IACvB,GAAG,EAAE,MAAM,GAAG,
|
|
1
|
+
{"version":3,"file":"PostCreator.d.ts","sourceRoot":"","sources":["../../../src/compositions/post-creator/PostCreator.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAM,KAAK,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAS1D,QAAA,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2CAQrB,CAAC;AAEH,KAAK,mBAAmB,GAAG,YAAY,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAElE,UAAU,gBAAiB,SAAQ,mBAAmB;IACpD,uBAAuB;IACvB,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IAEnB,4CAA4C;IAC5C,aAAa,EAAE,MAAM,IAAI,CAAC;IAE1B;;;OAGG;IACH,WAAW,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,GAAG,IAAI,KAAK,IAAI,CAAC;CACxD;AAED;;;;GAIG;AACH,eAAO,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,gBAAgB,CAuDlD,CAAC"}
|
|
@@ -45,23 +45,23 @@ declare const ProfileBannerStyles: import('tailwind-variants').TVReturnType<{
|
|
|
45
45
|
type ProfileBannerVariants = VariantProps<typeof ProfileBannerStyles>;
|
|
46
46
|
interface ProfileBannerProps extends ProfileBannerVariants {
|
|
47
47
|
/** URL of the user's avatar image. */
|
|
48
|
-
avatarSrc
|
|
48
|
+
avatarSrc?: string | null;
|
|
49
49
|
/** Alt text for the avatar image. */
|
|
50
50
|
avatarAlt: string;
|
|
51
51
|
/** URL of the profile banner or main image. */
|
|
52
|
-
imageSrc
|
|
52
|
+
imageSrc?: string | null;
|
|
53
53
|
/** Alt text for the main image. */
|
|
54
54
|
imageAlt: string;
|
|
55
55
|
/** The user's display name. */
|
|
56
|
-
displayName
|
|
56
|
+
displayName?: string | null;
|
|
57
57
|
/** The user’s username/handle. */
|
|
58
|
-
userName
|
|
58
|
+
userName?: string | null;
|
|
59
59
|
/** The user’s location string. */
|
|
60
|
-
location
|
|
60
|
+
location?: string | null;
|
|
61
61
|
/** Date when the user joined. */
|
|
62
|
-
joinedTimestamp
|
|
62
|
+
joinedTimestamp?: Date | null;
|
|
63
63
|
/** Bio or profile description text. */
|
|
64
|
-
description
|
|
64
|
+
description?: string | null;
|
|
65
65
|
/** Whether the profile being viewed belongs to the logged-in user. */
|
|
66
66
|
isCurrentUser: boolean;
|
|
67
67
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProfileBanner.d.ts","sourceRoot":"","sources":["../../../src/compositions/profile-banner/ProfileBanner.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAM,KAAK,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAS1D,QAAA,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2CAOvB,CAAC;AAEH,KAAK,qBAAqB,GAAG,YAAY,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAEtE,UAAU,kBAAmB,SAAQ,qBAAqB;IACxD,sCAAsC;IACtC,SAAS,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"ProfileBanner.d.ts","sourceRoot":"","sources":["../../../src/compositions/profile-banner/ProfileBanner.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAM,KAAK,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAS1D,QAAA,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2CAOvB,CAAC;AAEH,KAAK,qBAAqB,GAAG,YAAY,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAEtE,UAAU,kBAAmB,SAAQ,qBAAqB;IACxD,sCAAsC;IACtC,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAE1B,qCAAqC;IACrC,SAAS,EAAE,MAAM,CAAC;IAElB,+CAA+C;IAC/C,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAEzB,mCAAmC;IACnC,QAAQ,EAAE,MAAM,CAAC;IAEjB,+BAA+B;IAC/B,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAE5B,kCAAkC;IAClC,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAEzB,kCAAkC;IAClC,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAEzB,iCAAiC;IACjC,eAAe,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IAE9B,uCAAuC;IACvC,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAE5B,sEAAsE;IACtE,aAAa,EAAE,OAAO,CAAC;IAEvB;;;OAGG;IACH,oBAAoB,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,KAAK,IAAI,CAAC;IAEnD;;;OAGG;IACH,mBAAmB,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,KAAK,IAAI,CAAC;CACnD;AAED;;GAEG;AACH,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAmDtD,CAAC"}
|
|
@@ -9,8 +9,8 @@ import { Avatar } from "../../components/avatar/Avatar.js";
|
|
|
9
9
|
import { Paragraph } from "../../components/typography/Paragraph.js";
|
|
10
10
|
const ProfileBannerStyles = tv({
|
|
11
11
|
slots: {
|
|
12
|
-
base: ["flex", "flex-col", "gap-6", "w-170", "
|
|
13
|
-
avatar: ["absolute", "-
|
|
12
|
+
base: ["flex", "flex-col", "gap-6", "w-170", "relative"],
|
|
13
|
+
avatar: ["absolute", "top-60", "right-6"],
|
|
14
14
|
info: ["flex", "flex-col", "gap-3"],
|
|
15
15
|
description: ["text-slate-500"]
|
|
16
16
|
}
|
|
@@ -46,9 +46,7 @@ const ProfileBanner = (props) => {
|
|
|
46
46
|
displayName: props.displayName,
|
|
47
47
|
userName: props.userName,
|
|
48
48
|
location: props.location,
|
|
49
|
-
joinedTimestamp: props.joinedTimestamp
|
|
50
|
-
onProfileClick: () => {
|
|
51
|
-
}
|
|
49
|
+
joinedTimestamp: props.joinedTimestamp
|
|
52
50
|
}
|
|
53
51
|
),
|
|
54
52
|
/* @__PURE__ */ jsx(Paragraph, { size: "md", className: description(), children: props.description })
|
|
@@ -36,7 +36,7 @@ declare const ProfileBannerImageStyles: import('tailwind-variants').TVReturnType
|
|
|
36
36
|
type ProfileBannerImageVariants = VariantProps<typeof ProfileBannerImageStyles>;
|
|
37
37
|
interface ProfileBannerImageProps extends ProfileBannerImageVariants {
|
|
38
38
|
/** Avatar image URL */
|
|
39
|
-
src
|
|
39
|
+
src?: string | null;
|
|
40
40
|
/**
|
|
41
41
|
* Alternative text for the image, used for accessibility.
|
|
42
42
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProfileBannerImage.d.ts","sourceRoot":"","sources":["../../../src/compositions/profile-banner-image/ProfileBannerImage.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAU,KAAK,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAG9D,QAAA,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2CAwC5B,CAAC;AAEH,KAAK,0BAA0B,GAAG,YAAY,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAEhF,UAAU,uBAAwB,SAAQ,0BAA0B;IAClE,uBAAuB;IACvB,GAAG,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"ProfileBannerImage.d.ts","sourceRoot":"","sources":["../../../src/compositions/profile-banner-image/ProfileBannerImage.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAU,KAAK,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAG9D,QAAA,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2CAwC5B,CAAC;AAEH,KAAK,0BAA0B,GAAG,YAAY,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAEhF,UAAU,uBAAwB,SAAQ,0BAA0B;IAClE,uBAAuB;IACvB,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAEpB;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;IAEZ,+DAA+D;IAC/D,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,EAAE,KAAK,CAAC,EAAE,CAAC,uBAAuB,CA0BhE,CAAC"}
|
|
@@ -47,7 +47,7 @@ const ProfileBannerImageStyles = tv({
|
|
|
47
47
|
});
|
|
48
48
|
const ProfileBannerImage = (props) => {
|
|
49
49
|
const { base, image, overlay, icon } = ProfileBannerImageStyles(props);
|
|
50
|
-
const [src, setSrc] = useState(props.src);
|
|
50
|
+
const [src, setSrc] = useState(props.src ?? "");
|
|
51
51
|
return /* @__PURE__ */ jsx("div", { className: base(), children: src ? /* @__PURE__ */ jsxs(AspectRatio.Root, { ratio: 17 / 8, children: [
|
|
52
52
|
/* @__PURE__ */ jsx(
|
|
53
53
|
"img",
|
|
@@ -2,7 +2,7 @@ import { VariantProps } from 'tailwind-variants';
|
|
|
2
2
|
declare const profileBannerInfoStyles: import('tailwind-variants').TVReturnType<{
|
|
3
3
|
[key: string]: {
|
|
4
4
|
[key: string]: import('tailwind-merge').ClassNameValue | {
|
|
5
|
-
|
|
5
|
+
name?: import('tailwind-merge').ClassNameValue;
|
|
6
6
|
base?: import('tailwind-merge').ClassNameValue;
|
|
7
7
|
title?: import('tailwind-merge').ClassNameValue;
|
|
8
8
|
icon?: import('tailwind-merge').ClassNameValue;
|
|
@@ -13,7 +13,7 @@ declare const profileBannerInfoStyles: import('tailwind-variants').TVReturnType<
|
|
|
13
13
|
} | {
|
|
14
14
|
[x: string]: {
|
|
15
15
|
[x: string]: import('tailwind-merge').ClassNameValue | {
|
|
16
|
-
|
|
16
|
+
name?: import('tailwind-merge').ClassNameValue;
|
|
17
17
|
base?: import('tailwind-merge').ClassNameValue;
|
|
18
18
|
title?: import('tailwind-merge').ClassNameValue;
|
|
19
19
|
icon?: import('tailwind-merge').ClassNameValue;
|
|
@@ -25,13 +25,13 @@ declare const profileBannerInfoStyles: import('tailwind-variants').TVReturnType<
|
|
|
25
25
|
base: string[];
|
|
26
26
|
title: string[];
|
|
27
27
|
icon: string[];
|
|
28
|
-
|
|
28
|
+
name: string[];
|
|
29
29
|
detailInfo: string[];
|
|
30
30
|
secondaryInfo: string[];
|
|
31
31
|
}, undefined, {
|
|
32
32
|
[key: string]: {
|
|
33
33
|
[key: string]: import('tailwind-merge').ClassNameValue | {
|
|
34
|
-
|
|
34
|
+
name?: import('tailwind-merge').ClassNameValue;
|
|
35
35
|
base?: import('tailwind-merge').ClassNameValue;
|
|
36
36
|
title?: import('tailwind-merge').ClassNameValue;
|
|
37
37
|
icon?: import('tailwind-merge').ClassNameValue;
|
|
@@ -43,14 +43,14 @@ declare const profileBannerInfoStyles: import('tailwind-variants').TVReturnType<
|
|
|
43
43
|
base: string[];
|
|
44
44
|
title: string[];
|
|
45
45
|
icon: string[];
|
|
46
|
-
|
|
46
|
+
name: string[];
|
|
47
47
|
detailInfo: string[];
|
|
48
48
|
secondaryInfo: string[];
|
|
49
49
|
}, import('tailwind-variants').TVReturnType<unknown, {
|
|
50
50
|
base: string[];
|
|
51
51
|
title: string[];
|
|
52
52
|
icon: string[];
|
|
53
|
-
|
|
53
|
+
name: string[];
|
|
54
54
|
detailInfo: string[];
|
|
55
55
|
secondaryInfo: string[];
|
|
56
56
|
}, undefined, unknown, unknown, undefined>>;
|
|
@@ -61,25 +61,25 @@ interface ProfileBannerInfoProps extends ProfileBannerInfoVariants {
|
|
|
61
61
|
/**
|
|
62
62
|
* The user's full display name (e.g., "John Doe").
|
|
63
63
|
*/
|
|
64
|
-
displayName
|
|
64
|
+
displayName?: string | null;
|
|
65
65
|
/**
|
|
66
66
|
* The user's username or handle (e.g., "@john").
|
|
67
67
|
*/
|
|
68
|
-
userName
|
|
68
|
+
userName?: string | null;
|
|
69
69
|
/**
|
|
70
70
|
* The user's location as a readable text label.
|
|
71
71
|
*/
|
|
72
|
-
location
|
|
72
|
+
location?: string | null;
|
|
73
73
|
/**
|
|
74
74
|
* A timestamp representing when the user joined.
|
|
75
75
|
* Used to generate the "Member since" relative date.
|
|
76
76
|
*/
|
|
77
|
-
joinedTimestamp
|
|
77
|
+
joinedTimestamp?: Date | null;
|
|
78
78
|
/**
|
|
79
79
|
* Callback fired whenever any profile-related element is clicked.
|
|
80
80
|
* Typically used to open the profile or navigate to a user page.
|
|
81
81
|
*/
|
|
82
|
-
onProfileClick
|
|
82
|
+
onProfileClick?: () => void;
|
|
83
83
|
/** A function called when the settings button is clicked. */
|
|
84
84
|
onSettingsClick?: () => void;
|
|
85
85
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProfileBannerInfo.d.ts","sourceRoot":"","sources":["../../../src/compositions/profile-banner-info/ProfileBannerInfo.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAM,KAAK,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAU1D,QAAA,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2CAS3B,CAAC;AAEH,KAAK,yBAAyB,GAAG,YAAY,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAE9E,UAAU,sBAAuB,SAAQ,yBAAyB;IAChE,sEAAsE;IACtE,aAAa,EAAE,OAAO,CAAC;IAEvB;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"ProfileBannerInfo.d.ts","sourceRoot":"","sources":["../../../src/compositions/profile-banner-info/ProfileBannerInfo.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAM,KAAK,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAU1D,QAAA,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2CAS3B,CAAC;AAEH,KAAK,yBAAyB,GAAG,YAAY,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAE9E,UAAU,sBAAuB,SAAQ,yBAAyB;IAChE,sEAAsE;IACtE,aAAa,EAAE,OAAO,CAAC;IAEvB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAE5B;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAEzB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAEzB;;;OAGG;IACH,eAAe,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IAE9B;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,IAAI,CAAC;IAE5B,6DAA6D;IAC7D,eAAe,CAAC,EAAE,MAAM,IAAI,CAAC;CAC9B;AAwBD;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,EAAE,KAAK,CAAC,EAAE,CAAC,sBAAsB,CAoD9D,CAAC"}
|
|
@@ -12,7 +12,7 @@ const profileBannerInfoStyles = tv({
|
|
|
12
12
|
base: ["flex", "flex-col", "gap-2", "items-start"],
|
|
13
13
|
title: ["flex", "gap-1", "items-center", "**:cursor-pointer"],
|
|
14
14
|
icon: ["text-violet-600", "-mt-0.5"],
|
|
15
|
-
|
|
15
|
+
name: ["text-slate-900"],
|
|
16
16
|
detailInfo: ["flex", "gap-4"],
|
|
17
17
|
secondaryInfo: ["text-slate-500"]
|
|
18
18
|
}
|
|
@@ -35,11 +35,17 @@ function timeSince(timestamp) {
|
|
|
35
35
|
return seconds <= 1 ? "just now" : `${seconds} seconds`;
|
|
36
36
|
}
|
|
37
37
|
const memberSincePrefix = "Member since ";
|
|
38
|
-
const ProfileBannerInfo = (
|
|
39
|
-
|
|
38
|
+
const ProfileBannerInfo = ({
|
|
39
|
+
displayName = "New User",
|
|
40
|
+
userName = "newuser",
|
|
41
|
+
location = "Location",
|
|
42
|
+
joinedTimestamp = /* @__PURE__ */ new Date(),
|
|
43
|
+
...props
|
|
44
|
+
}) => {
|
|
45
|
+
const { base, title, icon, name, detailInfo, secondaryInfo } = profileBannerInfoStyles(props);
|
|
40
46
|
return /* @__PURE__ */ jsxs("div", { className: base(), children: [
|
|
41
47
|
/* @__PURE__ */ jsxs("div", { className: title(), children: [
|
|
42
|
-
/* @__PURE__ */ jsx("button", { onClick: props.onProfileClick, className:
|
|
48
|
+
/* @__PURE__ */ jsx("button", { onClick: props.onProfileClick, className: name(), children: /* @__PURE__ */ jsx(Label, { size: "xl", children: displayName }) }),
|
|
43
49
|
props.isCurrentUser && /* @__PURE__ */ jsx("button", { onClick: props.onSettingsClick, children: /* @__PURE__ */ jsx(Settings, { className: icon() }) })
|
|
44
50
|
] }),
|
|
45
51
|
/* @__PURE__ */ jsxs("div", { className: detailInfo(), children: [
|
|
@@ -49,7 +55,7 @@ const ProfileBannerInfo = (props) => {
|
|
|
49
55
|
intent: "secondary",
|
|
50
56
|
icon: Profile,
|
|
51
57
|
onClick: props.onProfileClick,
|
|
52
|
-
children:
|
|
58
|
+
children: userName
|
|
53
59
|
}
|
|
54
60
|
),
|
|
55
61
|
/* @__PURE__ */ jsx(
|
|
@@ -59,7 +65,7 @@ const ProfileBannerInfo = (props) => {
|
|
|
59
65
|
icon: Location,
|
|
60
66
|
onClick: props.onProfileClick,
|
|
61
67
|
className: secondaryInfo(),
|
|
62
|
-
children:
|
|
68
|
+
children: location
|
|
63
69
|
}
|
|
64
70
|
),
|
|
65
71
|
/* @__PURE__ */ jsx(
|
|
@@ -69,7 +75,7 @@ const ProfileBannerInfo = (props) => {
|
|
|
69
75
|
icon: Calendar,
|
|
70
76
|
onClick: props.onProfileClick,
|
|
71
77
|
className: secondaryInfo(),
|
|
72
|
-
children: memberSincePrefix + timeSince(
|
|
78
|
+
children: memberSincePrefix + timeSince(joinedTimestamp)
|
|
73
79
|
}
|
|
74
80
|
)
|
|
75
81
|
] })
|
|
@@ -45,21 +45,21 @@ declare const ResponseStyles: import('tailwind-variants').TVReturnType<{
|
|
|
45
45
|
type ResponseVariants = VariantProps<typeof ResponseStyles>;
|
|
46
46
|
interface ResponseProps extends ResponseVariants {
|
|
47
47
|
/** The display name of the user who created the Response. */
|
|
48
|
-
displayName
|
|
48
|
+
displayName?: string | null;
|
|
49
49
|
/** The username or handle associated with the Response. */
|
|
50
|
-
userName
|
|
50
|
+
userName?: string | null;
|
|
51
51
|
/** The date and time when the Response was created. */
|
|
52
|
-
timestamp
|
|
52
|
+
timestamp?: Date | null;
|
|
53
53
|
/** The main text content of the Response. */
|
|
54
|
-
text
|
|
54
|
+
text?: string | null;
|
|
55
55
|
/** Avatar image URL */
|
|
56
|
-
|
|
56
|
+
avatarSrc?: string | null;
|
|
57
57
|
/** Triggered when the avatar is clicked. */
|
|
58
58
|
onAvatarClick: () => void;
|
|
59
59
|
/** Number of likes the post has received. */
|
|
60
|
-
nbrOfLikes
|
|
60
|
+
nbrOfLikes?: number | null;
|
|
61
61
|
/** Number of comments the post has received. */
|
|
62
|
-
nbrOfComments
|
|
62
|
+
nbrOfComments?: number | null;
|
|
63
63
|
/** Optional image source URL displayed within the Response. */
|
|
64
64
|
imageSrc?: string;
|
|
65
65
|
/** Optional alt text for the Response image, used for accessibility. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Response.d.ts","sourceRoot":"","sources":["../../../src/compositions/response/Response.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAM,KAAK,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAQ1D,QAAA,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2CAYlB,CAAC;AAEH,KAAK,gBAAgB,GAAG,YAAY,CAAC,OAAO,cAAc,CAAC,CAAC;AAE5D,UAAU,aAAc,SAAQ,gBAAgB;IAC9C,6DAA6D;IAC7D,WAAW,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"Response.d.ts","sourceRoot":"","sources":["../../../src/compositions/response/Response.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAM,KAAK,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAQ1D,QAAA,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2CAYlB,CAAC;AAEH,KAAK,gBAAgB,GAAG,YAAY,CAAC,OAAO,cAAc,CAAC,CAAC;AAE5D,UAAU,aAAc,SAAQ,gBAAgB;IAC9C,6DAA6D;IAC7D,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAE5B,2DAA2D;IAC3D,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAEzB,uDAAuD;IACvD,SAAS,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IAExB,6CAA6C;IAC7C,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAErB,uBAAuB;IACvB,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAE1B,4CAA4C;IAC5C,aAAa,EAAE,MAAM,IAAI,CAAC;IAE1B,6CAA6C;IAC7C,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAE3B,gDAAgD;IAChD,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAE9B,+DAA+D;IAC/D,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB,wEAAwE;IACxE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB,yDAAyD;IACzD,cAAc,EAAE,MAAM,IAAI,CAAC;IAE3B,sDAAsD;IACtD,WAAW,EAAE,MAAM,IAAI,CAAC;IAExB,uDAAuD;IACvD,YAAY,EAAE,MAAM,IAAI,CAAC;CAC1B;AAED;;;GAGG;AACH,eAAO,MAAM,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,aAAa,CAoD5C,CAAC"}
|
|
@@ -23,14 +23,18 @@ const ResponseStyles = tv({
|
|
|
23
23
|
action: ["flex", "gap-10", "justify-start", "-ml-3"]
|
|
24
24
|
}
|
|
25
25
|
});
|
|
26
|
-
const Response = (
|
|
26
|
+
const Response = ({
|
|
27
|
+
nbrOfLikes = 0,
|
|
28
|
+
nbrOfComments = 0,
|
|
29
|
+
...props
|
|
30
|
+
}) => {
|
|
27
31
|
const { base, content, text, action } = ResponseStyles(props);
|
|
28
32
|
return /* @__PURE__ */ jsx(PostBase, { className: base(), children: /* @__PURE__ */ jsxs("div", { className: content(), children: [
|
|
29
33
|
/* @__PURE__ */ jsx(
|
|
30
34
|
UserInfo,
|
|
31
35
|
{
|
|
32
36
|
size: "sm",
|
|
33
|
-
src: props.
|
|
37
|
+
src: props.avatarSrc,
|
|
34
38
|
displayName: props.displayName,
|
|
35
39
|
userName: props.userName,
|
|
36
40
|
timestamp: props.timestamp,
|
|
@@ -52,18 +56,12 @@ const Response = (props) => {
|
|
|
52
56
|
Toggle,
|
|
53
57
|
{
|
|
54
58
|
ariaLabel: "Comment",
|
|
55
|
-
labelText:
|
|
56
|
-
pressed:
|
|
59
|
+
labelText: nbrOfComments === 0 ? "Comment" : nbrOfComments === 1 ? "1 Comment" : `${nbrOfComments} Comments`,
|
|
60
|
+
pressed: nbrOfComments !== 0,
|
|
57
61
|
onToggle: props.onCommentClick
|
|
58
62
|
}
|
|
59
63
|
),
|
|
60
|
-
/* @__PURE__ */ jsx(
|
|
61
|
-
LikeToggle,
|
|
62
|
-
{
|
|
63
|
-
likes: props.nbrOfLikes,
|
|
64
|
-
onLikeChange: props.onLikeClick
|
|
65
|
-
}
|
|
66
|
-
),
|
|
64
|
+
/* @__PURE__ */ jsx(LikeToggle, { likes: nbrOfLikes, onLikeChange: props.onLikeClick }),
|
|
67
65
|
/* @__PURE__ */ jsx(
|
|
68
66
|
TimedButton,
|
|
69
67
|
{
|
|
@@ -39,11 +39,11 @@ declare const ResponseCreatorStyles: import('tailwind-variants').TVReturnType<{
|
|
|
39
39
|
type ResponseCreatorVariants = VariantProps<typeof ResponseCreatorStyles>;
|
|
40
40
|
interface ResponseCreatorProps extends ResponseCreatorVariants {
|
|
41
41
|
/** Avatar image URL */
|
|
42
|
-
src
|
|
42
|
+
src?: string | null;
|
|
43
43
|
/** Display name of the user */
|
|
44
|
-
displayName
|
|
44
|
+
displayName?: string | null;
|
|
45
45
|
/** Username of the user */
|
|
46
|
-
userName
|
|
46
|
+
userName?: string | null;
|
|
47
47
|
/**
|
|
48
48
|
* Callback fired when the "Send" button is clicked.
|
|
49
49
|
* Receives the textarea text and the optionally uploaded file.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ResponseCreator.d.ts","sourceRoot":"","sources":["../../../src/compositions/response-creator/ResponseCreator.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAM,KAAK,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAU1D,QAAA,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2CAMzB,CAAC;AAEH,KAAK,uBAAuB,GAAG,YAAY,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAE1E,UAAU,oBAAqB,SAAQ,uBAAuB;IAC5D,uBAAuB;IACvB,GAAG,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"ResponseCreator.d.ts","sourceRoot":"","sources":["../../../src/compositions/response-creator/ResponseCreator.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAM,KAAK,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAU1D,QAAA,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2CAMzB,CAAC;AAEH,KAAK,uBAAuB,GAAG,YAAY,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAE1E,UAAU,oBAAqB,SAAQ,uBAAuB;IAC5D,uBAAuB;IACvB,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAEpB,+BAA+B;IAC/B,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAE5B,2BAA2B;IAC3B,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAEzB;;;OAGG;IACH,WAAW,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,GAAG,IAAI,KAAK,IAAI,CAAC;IAEvD;;OAEG;IACH,aAAa,EAAE,MAAM,IAAI,CAAC;CAC3B;AAED;;;;GAIG;AACH,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CAkD1D,CAAC"}
|
|
@@ -2,7 +2,7 @@ import { VariantProps } from 'tailwind-variants';
|
|
|
2
2
|
declare const userInfoStyles: import('tailwind-variants').TVReturnType<{
|
|
3
3
|
[key: string]: {
|
|
4
4
|
[key: string]: import('tailwind-merge').ClassNameValue | {
|
|
5
|
-
|
|
5
|
+
name?: import('tailwind-merge').ClassNameValue;
|
|
6
6
|
base?: import('tailwind-merge').ClassNameValue;
|
|
7
7
|
userInfo?: import('tailwind-merge').ClassNameValue;
|
|
8
8
|
detailInfo?: import('tailwind-merge').ClassNameValue;
|
|
@@ -12,7 +12,7 @@ declare const userInfoStyles: import('tailwind-variants').TVReturnType<{
|
|
|
12
12
|
} | {
|
|
13
13
|
[x: string]: {
|
|
14
14
|
[x: string]: import('tailwind-merge').ClassNameValue | {
|
|
15
|
-
|
|
15
|
+
name?: import('tailwind-merge').ClassNameValue;
|
|
16
16
|
base?: import('tailwind-merge').ClassNameValue;
|
|
17
17
|
userInfo?: import('tailwind-merge').ClassNameValue;
|
|
18
18
|
detailInfo?: import('tailwind-merge').ClassNameValue;
|
|
@@ -22,13 +22,13 @@ declare const userInfoStyles: import('tailwind-variants').TVReturnType<{
|
|
|
22
22
|
} | {}, {
|
|
23
23
|
base: string[];
|
|
24
24
|
userInfo: string[];
|
|
25
|
-
|
|
25
|
+
name: string[];
|
|
26
26
|
detailInfo: string[];
|
|
27
27
|
timeInfo: string[];
|
|
28
28
|
}, undefined, {
|
|
29
29
|
[key: string]: {
|
|
30
30
|
[key: string]: import('tailwind-merge').ClassNameValue | {
|
|
31
|
-
|
|
31
|
+
name?: import('tailwind-merge').ClassNameValue;
|
|
32
32
|
base?: import('tailwind-merge').ClassNameValue;
|
|
33
33
|
userInfo?: import('tailwind-merge').ClassNameValue;
|
|
34
34
|
detailInfo?: import('tailwind-merge').ClassNameValue;
|
|
@@ -38,13 +38,13 @@ declare const userInfoStyles: import('tailwind-variants').TVReturnType<{
|
|
|
38
38
|
} | {}, {
|
|
39
39
|
base: string[];
|
|
40
40
|
userInfo: string[];
|
|
41
|
-
|
|
41
|
+
name: string[];
|
|
42
42
|
detailInfo: string[];
|
|
43
43
|
timeInfo: string[];
|
|
44
44
|
}, import('tailwind-variants').TVReturnType<unknown, {
|
|
45
45
|
base: string[];
|
|
46
46
|
userInfo: string[];
|
|
47
|
-
|
|
47
|
+
name: string[];
|
|
48
48
|
detailInfo: string[];
|
|
49
49
|
timeInfo: string[];
|
|
50
50
|
}, undefined, unknown, unknown, undefined>>;
|
|
@@ -52,15 +52,15 @@ type UserInfoVariants = VariantProps<typeof userInfoStyles>;
|
|
|
52
52
|
type UserInfoSize = "sm" | "md" | "lg";
|
|
53
53
|
interface UserInfoProps extends UserInfoVariants {
|
|
54
54
|
/** Avatar image URL */
|
|
55
|
-
src?: string;
|
|
55
|
+
src?: string | null;
|
|
56
56
|
/** Size variant of the component */
|
|
57
57
|
size: UserInfoSize;
|
|
58
58
|
/** Display name of the user */
|
|
59
|
-
displayName
|
|
59
|
+
displayName?: string | null;
|
|
60
60
|
/** Username of the user */
|
|
61
|
-
userName
|
|
61
|
+
userName?: string | null;
|
|
62
62
|
/** Timestamp for the user activity */
|
|
63
|
-
timestamp?: Date;
|
|
63
|
+
timestamp?: Date | null;
|
|
64
64
|
/** Click handler for the whole UserInfo component */
|
|
65
65
|
onClick: () => void;
|
|
66
66
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UserInfo.d.ts","sourceRoot":"","sources":["../../../src/compositions/user-info/UserInfo.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAM,KAAK,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAM1D,QAAA,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2CAQlB,CAAC;AAEH,KAAK,gBAAgB,GAAG,YAAY,CAAC,OAAO,cAAc,CAAC,CAAC;AAC5D,KAAK,YAAY,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAEvC,UAAU,aAAc,SAAQ,gBAAgB;IAC9C,uBAAuB;IACvB,GAAG,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"UserInfo.d.ts","sourceRoot":"","sources":["../../../src/compositions/user-info/UserInfo.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAM,KAAK,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAM1D,QAAA,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2CAQlB,CAAC;AAEH,KAAK,gBAAgB,GAAG,YAAY,CAAC,OAAO,cAAc,CAAC,CAAC;AAC5D,KAAK,YAAY,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAEvC,UAAU,aAAc,SAAQ,gBAAgB;IAC9C,uBAAuB;IACvB,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,oCAAoC;IACpC,IAAI,EAAE,YAAY,CAAC;IACnB,+BAA+B;IAC/B,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,2BAA2B;IAC3B,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,sCAAsC;IACtC,SAAS,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IACxB,qDAAqD;IACrD,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAoCD;;;;;;GAMG;AACH,eAAO,MAAM,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,aAAa,CAqC5C,CAAC"}
|
|
@@ -10,7 +10,7 @@ const userInfoStyles = tv({
|
|
|
10
10
|
slots: {
|
|
11
11
|
base: ["flex", "gap-2", "items-center"],
|
|
12
12
|
userInfo: ["flex", "flex-col", "gap-2", "justify-center", "items-start"],
|
|
13
|
-
|
|
13
|
+
name: ["text-slate-900", "**:cursor-pointer"],
|
|
14
14
|
detailInfo: ["flex", "flex", "gap-4"],
|
|
15
15
|
timeInfo: ["text-slate-500"]
|
|
16
16
|
}
|
|
@@ -45,10 +45,15 @@ function getLabelSize(size) {
|
|
|
45
45
|
return "md";
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
|
-
const UserInfo = (
|
|
49
|
-
|
|
48
|
+
const UserInfo = ({
|
|
49
|
+
displayName = "New User",
|
|
50
|
+
userName = "newuser",
|
|
51
|
+
timestamp = /* @__PURE__ */ new Date(),
|
|
52
|
+
...props
|
|
53
|
+
}) => {
|
|
54
|
+
const { base, userInfo, name, detailInfo, timeInfo } = userInfoStyles(props);
|
|
50
55
|
return /* @__PURE__ */ jsxs("div", { className: base(), children: [
|
|
51
|
-
|
|
56
|
+
/* @__PURE__ */ jsx(
|
|
52
57
|
Avatar,
|
|
53
58
|
{
|
|
54
59
|
alt: "Profile",
|
|
@@ -58,25 +63,17 @@ const UserInfo = (props) => {
|
|
|
58
63
|
}
|
|
59
64
|
),
|
|
60
65
|
/* @__PURE__ */ jsxs("div", { className: userInfo(), children: [
|
|
61
|
-
/* @__PURE__ */ jsx("button", { onClick: props.onClick, className:
|
|
66
|
+
/* @__PURE__ */ jsx("button", { onClick: props.onClick, className: name(), children: /* @__PURE__ */ jsx(Label, { size: getLabelSize(props.size), children: displayName }) }),
|
|
62
67
|
/* @__PURE__ */ jsxs("div", { className: detailInfo(), children: [
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
{
|
|
66
|
-
intent: "secondary",
|
|
67
|
-
icon: Profile,
|
|
68
|
-
onClick: props.onClick,
|
|
69
|
-
children: props.userName
|
|
70
|
-
}
|
|
71
|
-
),
|
|
72
|
-
props.timestamp && /* @__PURE__ */ jsx(
|
|
68
|
+
/* @__PURE__ */ jsx(IconButton, { intent: "secondary", icon: Profile, onClick: props.onClick, children: userName }),
|
|
69
|
+
/* @__PURE__ */ jsx(
|
|
73
70
|
IconButton,
|
|
74
71
|
{
|
|
75
72
|
intent: "primary",
|
|
76
73
|
icon: Time,
|
|
77
74
|
className: timeInfo(),
|
|
78
75
|
onClick: props.onClick,
|
|
79
|
-
children: timeSince(
|
|
76
|
+
children: timeSince(timestamp)
|
|
80
77
|
}
|
|
81
78
|
)
|
|
82
79
|
] })
|
|
@@ -9,5 +9,5 @@
|
|
|
9
9
|
* @param {string} text - The input text that may contain hashtags.
|
|
10
10
|
* @returns {(string | React.ReactNode)[]} A list of text segments and `<Keyword>` components.
|
|
11
11
|
*/
|
|
12
|
-
export declare function renderWithHashtags(text?: string): (string | import("react/jsx-runtime").JSX.Element)[];
|
|
12
|
+
export declare function renderWithHashtags(text?: string | null): (string | import("react/jsx-runtime").JSX.Element)[];
|
|
13
13
|
//# sourceMappingURL=keyword.utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"keyword.utils.d.ts","sourceRoot":"","sources":["../../../src/compositions/utils/keyword.utils.tsx"],"names":[],"mappings":"AAEA;;;;;;;;;;GAUG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,GAAE,
|
|
1
|
+
{"version":3,"file":"keyword.utils.d.ts","sourceRoot":"","sources":["../../../src/compositions/utils/keyword.utils.tsx"],"names":[],"mappings":"AAEA;;;;;;;;;;GAUG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,GAAE,MAAM,GAAG,IAAS,wDA0B1D"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@krrli/cm-designsystem",
|
|
3
3
|
"repository": "https://github.com/ost-cas-fea-25-26/cm-designsystem",
|
|
4
|
-
"version": "1.33.
|
|
4
|
+
"version": "1.33.3",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"module": "dist/index.js",
|
|
@@ -62,9 +62,9 @@
|
|
|
62
62
|
"@types/react": "19.2.7",
|
|
63
63
|
"@types/react-dom": "19.2.3",
|
|
64
64
|
"@vitejs/plugin-react": "5.1.2",
|
|
65
|
-
"@vitest/browser": "4.0.
|
|
66
|
-
"@vitest/browser-playwright": "4.0.
|
|
67
|
-
"@vitest/coverage-v8": "4.0.
|
|
65
|
+
"@vitest/browser": "4.0.16",
|
|
66
|
+
"@vitest/browser-playwright": "4.0.16",
|
|
67
|
+
"@vitest/coverage-v8": "4.0.16",
|
|
68
68
|
"eslint": "9.39.2",
|
|
69
69
|
"eslint-config-prettier": "10.1.8",
|
|
70
70
|
"eslint-import-resolver-typescript": "4.4.4",
|
|
@@ -72,12 +72,12 @@
|
|
|
72
72
|
"eslint-plugin-jsx-a11y": "6.10.2",
|
|
73
73
|
"eslint-plugin-react": "7.37.5",
|
|
74
74
|
"eslint-plugin-react-hooks": "7.0.1",
|
|
75
|
-
"eslint-plugin-react-refresh": "0.4.
|
|
75
|
+
"eslint-plugin-react-refresh": "0.4.26",
|
|
76
76
|
"eslint-plugin-storybook": "10.1.9",
|
|
77
77
|
"eslint-plugin-unused-imports": "4.3.0",
|
|
78
78
|
"globals": "16.5.0",
|
|
79
79
|
"jsdom": "27.3.0",
|
|
80
|
-
"knip": "5.
|
|
80
|
+
"knip": "5.75.1",
|
|
81
81
|
"playwright": "1.57.0",
|
|
82
82
|
"prettier": "3.7.4",
|
|
83
83
|
"prettier-plugin-tailwindcss": "0.7.2",
|
|
@@ -91,6 +91,6 @@
|
|
|
91
91
|
"vite": "7.3.0",
|
|
92
92
|
"vite-plugin-dts": "4.5.4",
|
|
93
93
|
"vite-plugin-svgr": "^4.5.0",
|
|
94
|
-
"vitest": "4.0.
|
|
94
|
+
"vitest": "4.0.16"
|
|
95
95
|
}
|
|
96
96
|
}
|