@krrli/cm-designsystem 1.32.0 → 1.32.2
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/assets/fallback.png.js +4 -0
- package/dist/cm-designsystem.css +1944 -1
- package/dist/components/accessible-button/AccessibleButton.js +29 -11
- package/dist/components/avatar/Avatar.js +91 -65
- package/dist/components/branding/BrandingGallery.js +212 -145
- package/dist/components/branding/app-icon-gradient.svg.js +4 -0
- package/dist/components/branding/app-icon-white.svg.js +4 -0
- package/dist/components/branding/hover-logo-default.svg.js +4 -0
- package/dist/components/branding/hover-logo-hovered.svg.js +4 -0
- package/dist/components/branding/logo-inline-gradient.svg.js +4 -0
- package/dist/components/branding/logo-inline-violet.svg.js +4 -0
- package/dist/components/branding/logo-inline-white.svg.js +4 -0
- package/dist/components/branding/logo-stacked-gradient.svg.js +4 -0
- package/dist/components/branding/logo-stacked-violet.svg.js +4 -0
- package/dist/components/branding/logo-stacked-white.svg.js +4 -0
- package/dist/components/branding/superzeichen.svg.js +4 -0
- package/dist/components/button/Button.js +61 -55
- package/dist/components/color/ColorDoc.js +26 -7
- package/dist/components/file-upload/FileUpload.js +129 -66
- package/dist/components/form/Form.js +33 -26
- package/dist/components/icon-button/IconButton.js +33 -29
- package/dist/components/icons/IconBase.js +21 -6
- package/dist/components/icons/generated/ArrowDown.js +15 -4
- package/dist/components/icons/generated/ArrowLeft.js +15 -4
- package/dist/components/icons/generated/ArrowRight.js +15 -4
- package/dist/components/icons/generated/ArrowUp.js +15 -4
- package/dist/components/icons/generated/Calendar.js +15 -4
- package/dist/components/icons/generated/Cancel.js +12 -4
- package/dist/components/icons/generated/Checkmark.js +12 -4
- package/dist/components/icons/generated/Edit.js +9 -4
- package/dist/components/icons/generated/Eye.js +15 -4
- package/dist/components/icons/generated/Fullscreen.js +9 -4
- package/dist/components/icons/generated/HeartFilled.js +15 -4
- package/dist/components/icons/generated/HeartOutline.js +15 -4
- package/dist/components/icons/generated/Location.js +15 -4
- package/dist/components/icons/generated/LogOut.js +12 -4
- package/dist/components/icons/generated/Mumble.js +13 -4
- package/dist/components/icons/generated/Profile.js +12 -4
- package/dist/components/icons/generated/ReplyFilled.js +15 -4
- package/dist/components/icons/generated/ReplyOutline.js +15 -4
- package/dist/components/icons/generated/Repost.js +15 -4
- package/dist/components/icons/generated/Send.js +15 -4
- package/dist/components/icons/generated/Settings.js +15 -4
- package/dist/components/icons/generated/Share.js +12 -4
- package/dist/components/icons/generated/Time.js +12 -4
- package/dist/components/icons/generated/Upload.js +21 -4
- package/dist/components/input/Input.js +67 -41
- package/dist/components/like-toggle/LikeToggle.js +203 -176
- package/dist/components/logo-link/LogoLink.js +56 -34
- package/dist/components/modal/Modal.js +66 -50
- package/dist/components/navi-button/NaviButton.js +42 -30
- package/dist/components/navi-user-button/NaviUserButton.js +39 -29
- package/dist/components/round-button/RoundButton.js +39 -29
- package/dist/components/tabs/TabItem.js +11 -8
- package/dist/components/tabs/Tabs.js +74 -59
- package/dist/components/text-link/TextLink.js +14 -11
- package/dist/components/textarea/Textarea.js +57 -41
- package/dist/components/timed-button/TimedButton.js +116 -102
- package/dist/components/toggle/Toggle.js +91 -62
- package/dist/components/typography/AccessibleTypography.js +12 -9
- package/dist/components/typography/Heading.js +13 -9
- package/dist/components/typography/Label.js +13 -9
- package/dist/components/typography/Paragraph.js +13 -9
- package/dist/components/typography/Placeholder.js +13 -9
- package/dist/components/typography/ValidationMessage.js +14 -9
- package/dist/components/typography/styles.js +53 -46
- package/dist/compositions/image-banner/ImageBanner.js +53 -45
- package/dist/compositions/image-upload-modal/ImageUploadModal.js +44 -20
- package/dist/compositions/post/Post.js +81 -26
- package/dist/compositions/post-base/PostBase.js +23 -24
- package/dist/compositions/post-creator/PostCreator.js +72 -24
- package/dist/compositions/profile-banner/ProfileBanner.js +71 -21
- package/dist/compositions/profile-banner-image/ProfileBannerImage.js +60 -52
- package/dist/compositions/profile-banner-info/ProfileBannerInfo.js +72 -40
- package/dist/compositions/response/Response.js +63 -19
- package/dist/compositions/response-creator/ResponseCreator.js +67 -23
- package/dist/compositions/user-info/UserInfo.js +71 -52
- package/dist/compositions/user-recommendation/UserRecommendation.js +58 -30
- package/dist/index.js +129 -4
- package/package.json +14 -11
- package/dist/components/accessible-button/AccessibleButton.d.ts +0 -32
- package/dist/components/accessible-button/AccessibleButton.test.d.ts +0 -1
- package/dist/components/accessible-button/AccessibleButton.test.js +0 -28
- package/dist/components/avatar/Avatar.d.ts +0 -118
- package/dist/components/branding/BrandingGallery.d.ts +0 -1
- package/dist/components/button/Button.d.ts +0 -66
- package/dist/components/button/Button.test.d.ts +0 -1
- package/dist/components/button/Button.test.js +0 -30
- package/dist/components/color/ColorDoc.d.ts +0 -4
- package/dist/components/file-upload/FileUpload.d.ts +0 -83
- package/dist/components/form/Form.d.ts +0 -54
- package/dist/components/icon-button/IconButton.d.ts +0 -69
- package/dist/components/icon-button/IconButton.test.d.ts +0 -1
- package/dist/components/icon-button/IconButton.test.js +0 -22
- package/dist/components/icons/IconBase.d.ts +0 -5
- package/dist/components/icons/generated/ArrowDown.d.ts +0 -3
- package/dist/components/icons/generated/ArrowLeft.d.ts +0 -3
- package/dist/components/icons/generated/ArrowRight.d.ts +0 -3
- package/dist/components/icons/generated/ArrowUp.d.ts +0 -3
- package/dist/components/icons/generated/Calendar.d.ts +0 -3
- package/dist/components/icons/generated/Cancel.d.ts +0 -3
- package/dist/components/icons/generated/Checkmark.d.ts +0 -3
- package/dist/components/icons/generated/Edit.d.ts +0 -3
- package/dist/components/icons/generated/Eye.d.ts +0 -3
- package/dist/components/icons/generated/Fullscreen.d.ts +0 -3
- package/dist/components/icons/generated/HeartFilled.d.ts +0 -3
- package/dist/components/icons/generated/HeartOutline.d.ts +0 -3
- package/dist/components/icons/generated/Location.d.ts +0 -3
- package/dist/components/icons/generated/LogOut.d.ts +0 -3
- package/dist/components/icons/generated/Mumble.d.ts +0 -3
- package/dist/components/icons/generated/Profile.d.ts +0 -3
- package/dist/components/icons/generated/ReplyFilled.d.ts +0 -3
- package/dist/components/icons/generated/ReplyOutline.d.ts +0 -3
- package/dist/components/icons/generated/Repost.d.ts +0 -3
- package/dist/components/icons/generated/Send.d.ts +0 -3
- package/dist/components/icons/generated/Settings.d.ts +0 -3
- package/dist/components/icons/generated/Share.d.ts +0 -3
- package/dist/components/icons/generated/Time.d.ts +0 -3
- package/dist/components/icons/generated/Upload.d.ts +0 -3
- package/dist/components/icons/generated/index.d.ts +0 -24
- package/dist/components/icons/generated/index.js +0 -24
- package/dist/components/index.d.ts +0 -27
- package/dist/components/index.js +0 -27
- package/dist/components/input/Input.d.ts +0 -61
- package/dist/components/like-toggle/LikeToggle.d.ts +0 -97
- package/dist/components/like-toggle/LikeToggle.test.d.ts +0 -1
- package/dist/components/like-toggle/LikeToggle.test.js +0 -35
- package/dist/components/logo-link/LogoLink.d.ts +0 -11
- package/dist/components/modal/Modal.d.ts +0 -75
- package/dist/components/modal/Modal.test.d.ts +0 -1
- package/dist/components/modal/Modal.test.js +0 -24
- package/dist/components/navi-button/NaviButton.d.ts +0 -49
- package/dist/components/navi-button/NaviButton.test.d.ts +0 -1
- package/dist/components/navi-button/NaviButton.test.js +0 -22
- package/dist/components/navi-user-button/NaviUserButton.d.ts +0 -44
- package/dist/components/round-button/RoundButton.d.ts +0 -44
- package/dist/components/round-button/RoundButton.test.d.ts +0 -1
- package/dist/components/round-button/RoundButton.test.js +0 -22
- package/dist/components/tabs/TabItem.d.ts +0 -11
- package/dist/components/tabs/Tabs.d.ts +0 -67
- package/dist/components/tabs/Tabs.test.d.ts +0 -1
- package/dist/components/tabs/Tabs.test.js +0 -61
- package/dist/components/text-link/TextLink.d.ts +0 -9
- package/dist/components/text-link/TextLink.test.d.ts +0 -1
- package/dist/components/text-link/TextLink.test.js +0 -14
- package/dist/components/textarea/Textarea.d.ts +0 -48
- package/dist/components/timed-button/TimedButton.d.ts +0 -79
- package/dist/components/timed-button/TimedButton.test.d.ts +0 -1
- package/dist/components/timed-button/TimedButton.test.js +0 -36
- package/dist/components/toggle/Toggle.d.ts +0 -62
- package/dist/components/toggle/Toggle.test.d.ts +0 -1
- package/dist/components/toggle/Toggle.test.js +0 -93
- package/dist/components/typography/AccessibleTypography.d.ts +0 -33
- package/dist/components/typography/Heading.d.ts +0 -24
- package/dist/components/typography/Label.d.ts +0 -22
- package/dist/components/typography/Paragraph.d.ts +0 -22
- package/dist/components/typography/Placeholder.d.ts +0 -17
- package/dist/components/typography/ValidationMessage.d.ts +0 -22
- package/dist/components/typography/styles.d.ts +0 -74
- package/dist/compositions/image-banner/ImageBanner.d.ts +0 -54
- package/dist/compositions/image-upload-modal/ImageUploadModal.d.ts +0 -15
- package/dist/compositions/index.d.ts +0 -11
- package/dist/compositions/index.js +0 -11
- package/dist/compositions/post/Post.d.ts +0 -75
- package/dist/compositions/post-base/PostBase.d.ts +0 -41
- package/dist/compositions/post-creator/PostCreator.d.ts +0 -69
- package/dist/compositions/profile-banner/ProfileBanner.d.ts +0 -82
- package/dist/compositions/profile-banner-image/ProfileBannerImage.d.ts +0 -54
- package/dist/compositions/profile-banner-info/ProfileBannerInfo.d.ts +0 -92
- package/dist/compositions/response/Response.d.ts +0 -75
- package/dist/compositions/response-creator/ResponseCreator.d.ts +0 -63
- package/dist/compositions/user-info/UserInfo.d.ts +0 -75
- package/dist/compositions/user-recommendation/UserRecommendation.d.ts +0 -63
- package/dist/favicon.svg +0 -18
- package/dist/index.d.ts +0 -3
- package/dist/index.es.js +0 -8343
- package/dist/logo-inline-gradient.svg +0 -43
- package/dist/setupTests.d.ts +0 -1
- package/dist/setupTests.js +0 -7
|
@@ -1,52 +1,59 @@
|
|
|
1
1
|
import { tv } from "tailwind-variants";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
2
|
+
const headingStyles = tv({
|
|
3
|
+
base: ["tracking-normal"],
|
|
4
|
+
variants: {
|
|
5
|
+
size: {
|
|
6
|
+
"1": ["font-bold", "text-[48px]/[125%]"],
|
|
7
|
+
"2": ["font-bold", "text-[40px]/[125%]"],
|
|
8
|
+
"3": ["font-semibold", "text-[32px]/[125%]"],
|
|
9
|
+
"4": ["font-semibold", "text-[24px]/[125%]"]
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
12
|
});
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
13
|
+
const paragraphStyles = tv({
|
|
14
|
+
base: ["font-medium", "tracking-normal"],
|
|
15
|
+
variants: {
|
|
16
|
+
size: {
|
|
17
|
+
lg: ["text-[24px]/[145%]"],
|
|
18
|
+
md: ["text-[18px]/[140%]"]
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
21
|
});
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
22
|
+
const labelStyles = tv({
|
|
23
|
+
base: ["font-semibold", "tracking-normal"],
|
|
24
|
+
variants: {
|
|
25
|
+
size: {
|
|
26
|
+
xl: ["text-[24px]/[100%]"],
|
|
27
|
+
lg: ["text-[20px]/[100%]"],
|
|
28
|
+
md: ["text-[16px]/[100%]"],
|
|
29
|
+
sm: ["text-[14px]/[100%]"]
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
32
|
});
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
33
|
+
const placeholderStyles = tv({
|
|
34
|
+
base: [
|
|
35
|
+
"font-medium",
|
|
36
|
+
"text-slate-500",
|
|
37
|
+
"text-[16px]/[100%]",
|
|
38
|
+
"tracking-normal",
|
|
39
|
+
"placeholder:font-medium",
|
|
40
|
+
"placeholder:text-slate-300",
|
|
41
|
+
"placeholder:text-[16px]/[100%]",
|
|
42
|
+
"placeholder:tracking-normal"
|
|
43
|
+
]
|
|
44
44
|
});
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
45
|
+
const validationMessageStyles = tv({
|
|
46
|
+
base: ["font-medium", "text-[14px]/[100%]", "tracking-normal"],
|
|
47
|
+
variants: {
|
|
48
|
+
type: {
|
|
49
|
+
error: ["text-error"]
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
52
|
});
|
|
53
|
+
export {
|
|
54
|
+
headingStyles,
|
|
55
|
+
labelStyles,
|
|
56
|
+
paragraphStyles,
|
|
57
|
+
placeholderStyles,
|
|
58
|
+
validationMessageStyles
|
|
59
|
+
};
|
|
@@ -1,50 +1,58 @@
|
|
|
1
|
-
import { jsx
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import * as AspectRatio from "@radix-ui/react-aspect-ratio";
|
|
3
3
|
import { useState } from "react";
|
|
4
|
-
import {
|
|
5
|
-
import { Fullscreen } from "../../components/icons/generated";
|
|
4
|
+
import { tv, cn } from "tailwind-variants";
|
|
5
|
+
import { Fullscreen } from "../../components/icons/generated/Fullscreen.js";
|
|
6
6
|
const ImageBannerStyles = tv({
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
7
|
+
slots: {
|
|
8
|
+
base: ["w-148", "h-80"],
|
|
9
|
+
image: ["h-full", "w-full", "cursor-pointer", "rounded-lg", "object-cover"],
|
|
10
|
+
overlay: [
|
|
11
|
+
"group",
|
|
12
|
+
"absolute",
|
|
13
|
+
"flex",
|
|
14
|
+
"items-center",
|
|
15
|
+
"justify-center",
|
|
16
|
+
"text-white",
|
|
17
|
+
"inset-0",
|
|
18
|
+
"bg-violet-600/0",
|
|
19
|
+
"hover:bg-violet-600/50",
|
|
20
|
+
"transition",
|
|
21
|
+
"duration-500",
|
|
22
|
+
"ease-in-out"
|
|
23
|
+
],
|
|
24
|
+
icon: [
|
|
25
|
+
"w-8",
|
|
26
|
+
"h-8",
|
|
27
|
+
"opacity-0",
|
|
28
|
+
"group-hover:opacity-100",
|
|
29
|
+
"transition",
|
|
30
|
+
"duration-500",
|
|
31
|
+
"group-hover:rotate-0"
|
|
32
|
+
]
|
|
33
|
+
},
|
|
34
|
+
variants: {
|
|
35
|
+
isFallback: {
|
|
36
|
+
true: { image: ["bg-violet-200"] }
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
39
|
});
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
40
|
+
const ImageBanner = (props) => {
|
|
41
|
+
const { base, image, overlay, icon } = ImageBannerStyles(props);
|
|
42
|
+
const [src, setSrc] = useState(props.src);
|
|
43
|
+
return /* @__PURE__ */ jsx("div", { className: base(), children: src ? /* @__PURE__ */ jsxs(AspectRatio.Root, { ratio: 37 / 20, children: [
|
|
44
|
+
/* @__PURE__ */ jsx(
|
|
45
|
+
"img",
|
|
46
|
+
{
|
|
47
|
+
className: image(),
|
|
48
|
+
src,
|
|
49
|
+
alt: props.alt,
|
|
50
|
+
onError: () => setSrc("")
|
|
51
|
+
}
|
|
52
|
+
),
|
|
53
|
+
/* @__PURE__ */ jsx("button", { className: cn(image(), overlay()), onClick: props.onClick, children: /* @__PURE__ */ jsx(Fullscreen, { className: icon() }) })
|
|
54
|
+
] }) : /* @__PURE__ */ jsx("div", { className: image({ isFallback: true }) }) });
|
|
55
|
+
};
|
|
56
|
+
export {
|
|
57
|
+
ImageBanner
|
|
50
58
|
};
|
|
@@ -1,21 +1,45 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef, useState, useImperativeHandle } from "react";
|
|
3
|
+
import { Modal } from "../../components/modal/Modal.js";
|
|
4
|
+
import { FileUpload } from "../../components/file-upload/FileUpload.js";
|
|
5
|
+
import { Button } from "../../components/button/Button.js";
|
|
6
|
+
import { Checkmark } from "../../components/icons/generated/Checkmark.js";
|
|
7
|
+
import { Cancel } from "../../components/icons/generated/Cancel.js";
|
|
8
|
+
const ImageUploadModal = forwardRef((props, ref) => {
|
|
9
|
+
const [open, setOpen] = useState(false);
|
|
10
|
+
const [file, setFile] = useState(null);
|
|
11
|
+
useImperativeHandle(ref, () => ({
|
|
12
|
+
openModal: setOpen
|
|
13
|
+
}));
|
|
14
|
+
return /* @__PURE__ */ jsxs(Modal, { open, onOpenChange: setOpen, title: "Image upload", children: [
|
|
15
|
+
/* @__PURE__ */ jsx(Modal.Body, { children: /* @__PURE__ */ jsx(FileUpload, { onFileSelect: setFile }) }),
|
|
16
|
+
/* @__PURE__ */ jsxs(Modal.Actions, { children: [
|
|
17
|
+
/* @__PURE__ */ jsx(
|
|
18
|
+
Button,
|
|
19
|
+
{
|
|
20
|
+
intent: "primary",
|
|
21
|
+
size: "md",
|
|
22
|
+
icon: Cancel,
|
|
23
|
+
onClick: () => setOpen(false),
|
|
24
|
+
children: "Cancel"
|
|
25
|
+
}
|
|
26
|
+
),
|
|
27
|
+
/* @__PURE__ */ jsx(
|
|
28
|
+
Button,
|
|
29
|
+
{
|
|
30
|
+
intent: "secondary",
|
|
31
|
+
size: "md",
|
|
32
|
+
icon: Checkmark,
|
|
33
|
+
onClick: () => {
|
|
34
|
+
setOpen(false);
|
|
35
|
+
props.onFileChange(file);
|
|
36
|
+
},
|
|
37
|
+
children: "Save"
|
|
38
|
+
}
|
|
39
|
+
)
|
|
40
|
+
] })
|
|
41
|
+
] });
|
|
21
42
|
});
|
|
43
|
+
export {
|
|
44
|
+
ImageUploadModal
|
|
45
|
+
};
|
|
@@ -1,30 +1,85 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
2
|
import { tv } from "tailwind-variants";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
3
|
+
import { ImageBanner } from "../image-banner/ImageBanner.js";
|
|
4
|
+
import { PostBase } from "../post-base/PostBase.js";
|
|
5
|
+
import { UserInfo } from "../user-info/UserInfo.js";
|
|
6
|
+
import { Avatar } from "../../components/avatar/Avatar.js";
|
|
7
|
+
import { Paragraph } from "../../components/typography/Paragraph.js";
|
|
8
|
+
import { Toggle } from "../../components/toggle/Toggle.js";
|
|
9
|
+
import { LikeToggle } from "../../components/like-toggle/LikeToggle.js";
|
|
10
|
+
import { TimedButton } from "../../components/timed-button/TimedButton.js";
|
|
11
|
+
import { Share } from "../../components/icons/generated/Share.js";
|
|
8
12
|
const PostStyles = tv({
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
13
|
+
slots: {
|
|
14
|
+
base: [],
|
|
15
|
+
avatar: ["absolute", "-left-8", "top-6"],
|
|
16
|
+
content: ["flex", "flex-col", "gap-6"],
|
|
17
|
+
text: ["text-slate-900"],
|
|
18
|
+
action: ["flex", "gap-10", "justify-start", "-ml-3"]
|
|
19
|
+
},
|
|
20
|
+
variants: {
|
|
21
|
+
size: {
|
|
22
|
+
lg: { base: ["rounded-b-none"] },
|
|
23
|
+
md: {}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
22
26
|
});
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
*/
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
27
|
+
const Post = (props) => {
|
|
28
|
+
const { base, avatar, content, text, action } = PostStyles(props);
|
|
29
|
+
return /* @__PURE__ */ jsxs(PostBase, { className: base(), children: [
|
|
30
|
+
/* @__PURE__ */ jsx("div", { className: avatar(), children: /* @__PURE__ */ jsx(
|
|
31
|
+
Avatar,
|
|
32
|
+
{
|
|
33
|
+
alt: "Profile",
|
|
34
|
+
size: "md",
|
|
35
|
+
src: props.src,
|
|
36
|
+
onAvatarClick: props.onAvatarClick
|
|
37
|
+
}
|
|
38
|
+
) }),
|
|
39
|
+
/* @__PURE__ */ jsxs("div", { className: content(), children: [
|
|
40
|
+
/* @__PURE__ */ jsx(
|
|
41
|
+
UserInfo,
|
|
42
|
+
{
|
|
43
|
+
size: props.size,
|
|
44
|
+
displayName: props.displayName,
|
|
45
|
+
userName: props.userName,
|
|
46
|
+
timestamp: props.timestamp,
|
|
47
|
+
onClick: props.onAvatarClick
|
|
48
|
+
}
|
|
49
|
+
),
|
|
50
|
+
/* @__PURE__ */ jsx(Paragraph, { size: props.size, className: text(), children: props.text }),
|
|
51
|
+
props.imageSrc && /* @__PURE__ */ jsx(
|
|
52
|
+
ImageBanner,
|
|
53
|
+
{
|
|
54
|
+
src: props.imageSrc,
|
|
55
|
+
alt: props.imageAlt ?? "",
|
|
56
|
+
onClick: () => {
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
),
|
|
60
|
+
/* @__PURE__ */ jsxs("div", { className: action(), children: [
|
|
61
|
+
/* @__PURE__ */ jsx(
|
|
62
|
+
Toggle,
|
|
63
|
+
{
|
|
64
|
+
ariaLabel: "Comment",
|
|
65
|
+
labelText: "Comment",
|
|
66
|
+
onToggle: props.onCommentClick
|
|
67
|
+
}
|
|
68
|
+
),
|
|
69
|
+
/* @__PURE__ */ jsx(LikeToggle, { onLikeChange: props.onLikeClick }),
|
|
70
|
+
/* @__PURE__ */ jsx(
|
|
71
|
+
TimedButton,
|
|
72
|
+
{
|
|
73
|
+
icon: Share,
|
|
74
|
+
label: "Copy Link",
|
|
75
|
+
labelActive: "Link copied",
|
|
76
|
+
onClick: props.onShareClick
|
|
77
|
+
}
|
|
78
|
+
)
|
|
79
|
+
] })
|
|
80
|
+
] })
|
|
81
|
+
] });
|
|
82
|
+
};
|
|
83
|
+
export {
|
|
84
|
+
Post
|
|
30
85
|
};
|
|
@@ -1,27 +1,26 @@
|
|
|
1
|
-
import { jsx
|
|
2
|
-
import {
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { tv, cn } from "tailwind-variants";
|
|
3
3
|
const PostBaseStyles = tv({
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
4
|
+
slots: {
|
|
5
|
+
base: [
|
|
6
|
+
"bg-white",
|
|
7
|
+
"rounded-2xl",
|
|
8
|
+
"pl-12",
|
|
9
|
+
"pr-12",
|
|
10
|
+
"pt-8",
|
|
11
|
+
"pb-8",
|
|
12
|
+
"flex",
|
|
13
|
+
"relative",
|
|
14
|
+
"w-full",
|
|
15
|
+
"hover:ring-2",
|
|
16
|
+
"hover:ring-slate-200"
|
|
17
|
+
]
|
|
18
|
+
}
|
|
19
19
|
});
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
export
|
|
25
|
-
|
|
26
|
-
return _jsx("div", { className: cn(base(), props.className), children: props.children });
|
|
20
|
+
const PostBase = (props) => {
|
|
21
|
+
const { base } = PostBaseStyles(props);
|
|
22
|
+
return /* @__PURE__ */ jsx("div", { className: cn(base(), props.className), children: props.children });
|
|
23
|
+
};
|
|
24
|
+
export {
|
|
25
|
+
PostBase
|
|
27
26
|
};
|
|
@@ -1,29 +1,77 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { jsxs, Fragment, jsx } from "react/jsx-runtime";
|
|
2
2
|
import { Form } from "@radix-ui/react-form";
|
|
3
|
-
import {
|
|
3
|
+
import { useState, useRef } from "react";
|
|
4
4
|
import { tv } from "tailwind-variants";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
5
|
+
import { ImageUploadModal } from "../image-upload-modal/ImageUploadModal.js";
|
|
6
|
+
import { PostBase } from "../post-base/PostBase.js";
|
|
7
|
+
import { Heading } from "../../components/typography/Heading.js";
|
|
8
|
+
import { Textarea } from "../../components/textarea/Textarea.js";
|
|
9
|
+
import { Send } from "../../components/icons/generated/Send.js";
|
|
10
|
+
import { Avatar } from "../../components/avatar/Avatar.js";
|
|
11
|
+
import { Button } from "../../components/button/Button.js";
|
|
12
|
+
import { Upload } from "../../components/icons/generated/Upload.js";
|
|
9
13
|
const PostCreatorStyles = tv({
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
slots: {
|
|
15
|
+
content: ["flex", "flex-col", "gap-4", "w-full"],
|
|
16
|
+
avatar: ["absolute", "-left-8", "top-6"],
|
|
17
|
+
title: ["text-slate-900"],
|
|
18
|
+
input: ["w-full", "h-40"],
|
|
19
|
+
action: ["flex", "gap-4"]
|
|
20
|
+
}
|
|
17
21
|
});
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
22
|
+
const PostCreator = (props) => {
|
|
23
|
+
const { content, avatar, title, input, action } = PostCreatorStyles(props);
|
|
24
|
+
const [file, setFile] = useState(null);
|
|
25
|
+
const [text, setText] = useState("");
|
|
26
|
+
const imageUploadModalRef = useRef(null);
|
|
27
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
28
|
+
/* @__PURE__ */ jsxs(PostBase, { children: [
|
|
29
|
+
/* @__PURE__ */ jsx("div", { className: avatar(), children: /* @__PURE__ */ jsx(
|
|
30
|
+
Avatar,
|
|
31
|
+
{
|
|
32
|
+
alt: "Profile",
|
|
33
|
+
size: "md",
|
|
34
|
+
src: props.src,
|
|
35
|
+
onAvatarClick: props.onAvatarClick
|
|
36
|
+
}
|
|
37
|
+
) }),
|
|
38
|
+
/* @__PURE__ */ jsxs(Form, { className: content(), children: [
|
|
39
|
+
/* @__PURE__ */ jsx(Heading, { size: "4", as: "h4", className: title(), children: "Hey, what's up?" }),
|
|
40
|
+
/* @__PURE__ */ jsx("div", { className: input(), children: /* @__PURE__ */ jsx(
|
|
41
|
+
Textarea,
|
|
42
|
+
{
|
|
43
|
+
name: "post",
|
|
44
|
+
placeholder: "Your opinion matters!",
|
|
45
|
+
onChange: setText
|
|
46
|
+
}
|
|
47
|
+
) }),
|
|
48
|
+
/* @__PURE__ */ jsxs("div", { className: action(), children: [
|
|
49
|
+
/* @__PURE__ */ jsx(
|
|
50
|
+
Button,
|
|
51
|
+
{
|
|
52
|
+
intent: "primary",
|
|
53
|
+
size: "md",
|
|
54
|
+
icon: Upload,
|
|
55
|
+
onClick: () => imageUploadModalRef.current?.openModal(true),
|
|
56
|
+
children: "Picture upload"
|
|
57
|
+
}
|
|
58
|
+
),
|
|
59
|
+
/* @__PURE__ */ jsx(
|
|
60
|
+
Button,
|
|
61
|
+
{
|
|
62
|
+
intent: "secondary",
|
|
63
|
+
size: "md",
|
|
64
|
+
icon: Send,
|
|
65
|
+
onClick: () => props.onSendClick(text, file),
|
|
66
|
+
children: "Send"
|
|
67
|
+
}
|
|
68
|
+
)
|
|
69
|
+
] })
|
|
70
|
+
] })
|
|
71
|
+
] }),
|
|
72
|
+
/* @__PURE__ */ jsx(ImageUploadModal, { ref: imageUploadModalRef, onFileChange: setFile })
|
|
73
|
+
] });
|
|
74
|
+
};
|
|
75
|
+
export {
|
|
76
|
+
PostCreator
|
|
29
77
|
};
|
|
@@ -1,26 +1,76 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { jsxs, Fragment, jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useRef } from "react";
|
|
3
3
|
import { tv } from "tailwind-variants";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
4
|
+
import { ImageUploadModal } from "../image-upload-modal/ImageUploadModal.js";
|
|
5
|
+
import { ProfileBannerImage } from "../profile-banner-image/ProfileBannerImage.js";
|
|
6
|
+
import { ProfileBannerInfo } from "../profile-banner-info/ProfileBannerInfo.js";
|
|
7
|
+
import { Avatar } from "../../components/avatar/Avatar.js";
|
|
8
|
+
import { Paragraph } from "../../components/typography/Paragraph.js";
|
|
8
9
|
const ProfileBannerStyles = tv({
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
slots: {
|
|
11
|
+
base: ["flex", "flex-col", "gap-6", "w-170", "h-80", "relative"],
|
|
12
|
+
avatar: ["absolute", "-bottom-20", "right-6"],
|
|
13
|
+
info: ["flex", "flex-col", "gap-3"],
|
|
14
|
+
description: ["text-slate-500"]
|
|
15
|
+
}
|
|
15
16
|
});
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
17
|
+
const ProfileBanner = (props) => {
|
|
18
|
+
const { base, avatar, info, description } = ProfileBannerStyles(props);
|
|
19
|
+
const profileImageUploadModalRef = useRef(null);
|
|
20
|
+
const avatarImageUploadModalRef = useRef(null);
|
|
21
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
22
|
+
/* @__PURE__ */ jsxs("div", { className: base(), children: [
|
|
23
|
+
/* @__PURE__ */ jsx(
|
|
24
|
+
ProfileBannerImage,
|
|
25
|
+
{
|
|
26
|
+
src: props.imageSrc,
|
|
27
|
+
alt: props.imageAlt,
|
|
28
|
+
onClick: () => profileImageUploadModalRef.current?.openModal(true)
|
|
29
|
+
}
|
|
30
|
+
),
|
|
31
|
+
/* @__PURE__ */ jsx("div", { className: avatar(), children: /* @__PURE__ */ jsx(
|
|
32
|
+
Avatar,
|
|
33
|
+
{
|
|
34
|
+
src: props.avatarSrc,
|
|
35
|
+
alt: props.avatarAlt,
|
|
36
|
+
size: "xl",
|
|
37
|
+
onActionClick: props.isCurrentUser ? () => avatarImageUploadModalRef.current?.openModal(true) : void 0
|
|
38
|
+
}
|
|
39
|
+
) }),
|
|
40
|
+
/* @__PURE__ */ jsxs("div", { className: info(), children: [
|
|
41
|
+
/* @__PURE__ */ jsx(
|
|
42
|
+
ProfileBannerInfo,
|
|
43
|
+
{
|
|
44
|
+
isCurrentUser: props.isCurrentUser,
|
|
45
|
+
displayName: props.displayName,
|
|
46
|
+
userName: props.userName,
|
|
47
|
+
location: props.location,
|
|
48
|
+
joinedTimestamp: props.joinedTimestamp,
|
|
49
|
+
onProfileClick: () => {
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
),
|
|
53
|
+
/* @__PURE__ */ jsx(Paragraph, { size: "md", className: description(), children: props.description })
|
|
54
|
+
] })
|
|
55
|
+
] }),
|
|
56
|
+
/* @__PURE__ */ jsx(
|
|
57
|
+
ImageUploadModal,
|
|
58
|
+
{
|
|
59
|
+
ref: profileImageUploadModalRef,
|
|
60
|
+
onFileChange: props.onProfileImageChange ?? (() => {
|
|
61
|
+
})
|
|
62
|
+
}
|
|
63
|
+
),
|
|
64
|
+
/* @__PURE__ */ jsx(
|
|
65
|
+
ImageUploadModal,
|
|
66
|
+
{
|
|
67
|
+
ref: avatarImageUploadModalRef,
|
|
68
|
+
onFileChange: props.onAvatarImageChange ?? (() => {
|
|
69
|
+
})
|
|
70
|
+
}
|
|
71
|
+
)
|
|
72
|
+
] });
|
|
73
|
+
};
|
|
74
|
+
export {
|
|
75
|
+
ProfileBanner
|
|
26
76
|
};
|