@krrli/cm-designsystem 1.32.1 → 1.32.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/assets/fallback.png.js +4 -0
- package/dist/cm-designsystem.css +1944 -1
- package/dist/components/accessible-button/AccessibleButton.d.ts +1 -0
- package/dist/components/accessible-button/AccessibleButton.d.ts.map +1 -0
- package/dist/components/accessible-button/AccessibleButton.js +29 -11
- package/dist/components/avatar/Avatar.d.ts +4 -3
- package/dist/components/avatar/Avatar.d.ts.map +1 -0
- package/dist/components/avatar/Avatar.js +91 -65
- package/dist/components/branding/BrandingGallery.d.ts +1 -0
- package/dist/components/branding/BrandingGallery.d.ts.map +1 -0
- 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.d.ts +6 -5
- package/dist/components/button/Button.d.ts.map +1 -0
- package/dist/components/button/Button.js +61 -55
- package/dist/components/color/ColorDoc.d.ts +1 -0
- package/dist/components/color/ColorDoc.d.ts.map +1 -0
- package/dist/components/color/ColorDoc.js +26 -7
- package/dist/components/file-upload/FileUpload.d.ts +34 -33
- package/dist/components/file-upload/FileUpload.d.ts.map +1 -0
- package/dist/components/file-upload/FileUpload.js +129 -66
- package/dist/components/form/Form.d.ts +14 -13
- package/dist/components/form/Form.d.ts.map +1 -0
- package/dist/components/form/Form.js +33 -26
- package/dist/components/icon-button/IconButton.d.ts +7 -6
- package/dist/components/icon-button/IconButton.d.ts.map +1 -0
- package/dist/components/icon-button/IconButton.js +33 -29
- package/dist/components/icons/IconBase.d.ts +1 -0
- package/dist/components/icons/IconBase.d.ts.map +1 -0
- package/dist/components/icons/IconBase.js +21 -6
- package/dist/components/icons/generated/ArrowDown.d.ts +2 -1
- package/dist/components/icons/generated/ArrowDown.d.ts.map +1 -0
- package/dist/components/icons/generated/ArrowDown.js +15 -4
- package/dist/components/icons/generated/ArrowLeft.d.ts +2 -1
- package/dist/components/icons/generated/ArrowLeft.d.ts.map +1 -0
- package/dist/components/icons/generated/ArrowLeft.js +15 -4
- package/dist/components/icons/generated/ArrowRight.d.ts +2 -1
- package/dist/components/icons/generated/ArrowRight.d.ts.map +1 -0
- package/dist/components/icons/generated/ArrowRight.js +15 -4
- package/dist/components/icons/generated/ArrowUp.d.ts +2 -1
- package/dist/components/icons/generated/ArrowUp.d.ts.map +1 -0
- package/dist/components/icons/generated/ArrowUp.js +15 -4
- package/dist/components/icons/generated/Calendar.d.ts +2 -1
- package/dist/components/icons/generated/Calendar.d.ts.map +1 -0
- package/dist/components/icons/generated/Calendar.js +15 -4
- package/dist/components/icons/generated/Cancel.d.ts +2 -1
- package/dist/components/icons/generated/Cancel.d.ts.map +1 -0
- package/dist/components/icons/generated/Cancel.js +12 -4
- package/dist/components/icons/generated/Checkmark.d.ts +2 -1
- package/dist/components/icons/generated/Checkmark.d.ts.map +1 -0
- package/dist/components/icons/generated/Checkmark.js +12 -4
- package/dist/components/icons/generated/Edit.d.ts +2 -1
- package/dist/components/icons/generated/Edit.d.ts.map +1 -0
- package/dist/components/icons/generated/Edit.js +9 -4
- package/dist/components/icons/generated/Eye.d.ts +2 -1
- package/dist/components/icons/generated/Eye.d.ts.map +1 -0
- package/dist/components/icons/generated/Eye.js +15 -4
- package/dist/components/icons/generated/Fullscreen.d.ts +2 -1
- package/dist/components/icons/generated/Fullscreen.d.ts.map +1 -0
- package/dist/components/icons/generated/Fullscreen.js +9 -4
- package/dist/components/icons/generated/HeartFilled.d.ts +2 -1
- package/dist/components/icons/generated/HeartFilled.d.ts.map +1 -0
- package/dist/components/icons/generated/HeartFilled.js +15 -4
- package/dist/components/icons/generated/HeartOutline.d.ts +2 -1
- package/dist/components/icons/generated/HeartOutline.d.ts.map +1 -0
- package/dist/components/icons/generated/HeartOutline.js +15 -4
- package/dist/components/icons/generated/Location.d.ts +2 -1
- package/dist/components/icons/generated/Location.d.ts.map +1 -0
- package/dist/components/icons/generated/Location.js +15 -4
- package/dist/components/icons/generated/LogOut.d.ts +2 -1
- package/dist/components/icons/generated/LogOut.d.ts.map +1 -0
- package/dist/components/icons/generated/LogOut.js +12 -4
- package/dist/components/icons/generated/Mumble.d.ts +2 -1
- package/dist/components/icons/generated/Mumble.d.ts.map +1 -0
- package/dist/components/icons/generated/Mumble.js +13 -4
- package/dist/components/icons/generated/Profile.d.ts +2 -1
- package/dist/components/icons/generated/Profile.d.ts.map +1 -0
- package/dist/components/icons/generated/Profile.js +12 -4
- package/dist/components/icons/generated/ReplyFilled.d.ts +2 -1
- package/dist/components/icons/generated/ReplyFilled.d.ts.map +1 -0
- package/dist/components/icons/generated/ReplyFilled.js +15 -4
- package/dist/components/icons/generated/ReplyOutline.d.ts +2 -1
- package/dist/components/icons/generated/ReplyOutline.d.ts.map +1 -0
- package/dist/components/icons/generated/ReplyOutline.js +15 -4
- package/dist/components/icons/generated/Repost.d.ts +2 -1
- package/dist/components/icons/generated/Repost.d.ts.map +1 -0
- package/dist/components/icons/generated/Repost.js +15 -4
- package/dist/components/icons/generated/Send.d.ts +2 -1
- package/dist/components/icons/generated/Send.d.ts.map +1 -0
- package/dist/components/icons/generated/Send.js +15 -4
- package/dist/components/icons/generated/Settings.d.ts +2 -1
- package/dist/components/icons/generated/Settings.d.ts.map +1 -0
- package/dist/components/icons/generated/Settings.js +15 -4
- package/dist/components/icons/generated/Share.d.ts +2 -1
- package/dist/components/icons/generated/Share.d.ts.map +1 -0
- package/dist/components/icons/generated/Share.js +12 -4
- package/dist/components/icons/generated/Time.d.ts +2 -1
- package/dist/components/icons/generated/Time.d.ts.map +1 -0
- package/dist/components/icons/generated/Time.js +12 -4
- package/dist/components/icons/generated/Upload.d.ts +2 -1
- package/dist/components/icons/generated/Upload.d.ts.map +1 -0
- package/dist/components/icons/generated/Upload.js +21 -4
- package/dist/components/icons/generated/index.d.ts +25 -24
- package/dist/components/icons/generated/index.d.ts.map +1 -0
- package/dist/components/index.d.ts +28 -27
- package/dist/components/index.d.ts.map +1 -0
- package/dist/components/input/Input.d.ts +6 -5
- package/dist/components/input/Input.d.ts.map +1 -0
- package/dist/components/input/Input.js +67 -41
- package/dist/components/like-toggle/LikeToggle.d.ts +4 -3
- package/dist/components/like-toggle/LikeToggle.d.ts.map +1 -0
- package/dist/components/like-toggle/LikeToggle.js +203 -176
- package/dist/components/logo-link/LogoLink.d.ts +1 -0
- package/dist/components/logo-link/LogoLink.d.ts.map +1 -0
- package/dist/components/logo-link/LogoLink.js +56 -34
- package/dist/components/modal/Modal.d.ts +23 -22
- package/dist/components/modal/Modal.d.ts.map +1 -0
- package/dist/components/modal/Modal.js +66 -50
- package/dist/components/navi-button/NaviButton.d.ts +7 -6
- package/dist/components/navi-button/NaviButton.d.ts.map +1 -0
- package/dist/components/navi-button/NaviButton.js +42 -30
- package/dist/components/navi-user-button/NaviUserButton.d.ts +5 -4
- package/dist/components/navi-user-button/NaviUserButton.d.ts.map +1 -0
- package/dist/components/navi-user-button/NaviUserButton.js +39 -29
- package/dist/components/round-button/RoundButton.d.ts +6 -5
- package/dist/components/round-button/RoundButton.d.ts.map +1 -0
- package/dist/components/round-button/RoundButton.js +39 -29
- package/dist/components/tabs/TabItem.d.ts +4 -3
- package/dist/components/tabs/TabItem.d.ts.map +1 -0
- package/dist/components/tabs/TabItem.js +11 -8
- package/dist/components/tabs/Tabs.d.ts +6 -5
- package/dist/components/tabs/Tabs.d.ts.map +1 -0
- package/dist/components/tabs/Tabs.js +74 -59
- package/dist/components/text-link/TextLink.d.ts +3 -2
- package/dist/components/text-link/TextLink.d.ts.map +1 -0
- package/dist/components/text-link/TextLink.js +14 -11
- package/dist/components/textarea/Textarea.d.ts +16 -15
- package/dist/components/textarea/Textarea.d.ts.map +1 -0
- package/dist/components/textarea/Textarea.js +57 -41
- package/dist/components/timed-button/TimedButton.d.ts +6 -5
- package/dist/components/timed-button/TimedButton.d.ts.map +1 -0
- package/dist/components/timed-button/TimedButton.js +116 -102
- package/dist/components/toggle/Toggle.d.ts +4 -3
- package/dist/components/toggle/Toggle.d.ts.map +1 -0
- package/dist/components/toggle/Toggle.js +91 -62
- package/dist/components/typography/AccessibleTypography.d.ts +2 -1
- package/dist/components/typography/AccessibleTypography.d.ts.map +1 -0
- package/dist/components/typography/AccessibleTypography.js +12 -9
- package/dist/components/typography/Heading.d.ts +5 -4
- package/dist/components/typography/Heading.d.ts.map +1 -0
- package/dist/components/typography/Heading.js +13 -9
- package/dist/components/typography/Label.d.ts +4 -3
- package/dist/components/typography/Label.d.ts.map +1 -0
- package/dist/components/typography/Label.js +13 -9
- package/dist/components/typography/Paragraph.d.ts +4 -3
- package/dist/components/typography/Paragraph.d.ts.map +1 -0
- package/dist/components/typography/Paragraph.js +13 -9
- package/dist/components/typography/Placeholder.d.ts +4 -3
- package/dist/components/typography/Placeholder.d.ts.map +1 -0
- package/dist/components/typography/Placeholder.js +13 -9
- package/dist/components/typography/ValidationMessage.d.ts +4 -3
- package/dist/components/typography/ValidationMessage.d.ts.map +1 -0
- package/dist/components/typography/ValidationMessage.js +14 -9
- package/dist/components/typography/styles.d.ts +10 -9
- package/dist/components/typography/styles.d.ts.map +1 -0
- package/dist/components/typography/styles.js +53 -46
- package/dist/compositions/image-banner/ImageBanner.d.ts +4 -3
- package/dist/compositions/image-banner/ImageBanner.d.ts.map +1 -0
- package/dist/compositions/image-banner/ImageBanner.js +53 -45
- package/dist/compositions/image-upload-modal/ImageUploadModal.d.ts +2 -1
- package/dist/compositions/image-upload-modal/ImageUploadModal.d.ts.map +1 -0
- package/dist/compositions/image-upload-modal/ImageUploadModal.js +44 -20
- package/dist/compositions/index.d.ts +12 -11
- package/dist/compositions/index.d.ts.map +1 -0
- package/dist/compositions/post/Post.d.ts +4 -3
- package/dist/compositions/post/Post.d.ts.map +1 -0
- package/dist/compositions/post/Post.js +81 -26
- package/dist/compositions/post-base/PostBase.d.ts +10 -9
- package/dist/compositions/post-base/PostBase.d.ts.map +1 -0
- package/dist/compositions/post-base/PostBase.js +23 -24
- package/dist/compositions/post-creator/PostCreator.d.ts +22 -21
- package/dist/compositions/post-creator/PostCreator.d.ts.map +1 -0
- package/dist/compositions/post-creator/PostCreator.js +72 -24
- package/dist/compositions/profile-banner/ProfileBanner.d.ts +19 -18
- package/dist/compositions/profile-banner/ProfileBanner.d.ts.map +1 -0
- package/dist/compositions/profile-banner/ProfileBanner.js +71 -21
- package/dist/compositions/profile-banner-image/ProfileBannerImage.d.ts +4 -3
- package/dist/compositions/profile-banner-image/ProfileBannerImage.d.ts.map +1 -0
- package/dist/compositions/profile-banner-image/ProfileBannerImage.js +60 -52
- package/dist/compositions/profile-banner-info/ProfileBannerInfo.d.ts +25 -24
- package/dist/compositions/profile-banner-info/ProfileBannerInfo.d.ts.map +1 -0
- package/dist/compositions/profile-banner-info/ProfileBannerInfo.js +72 -40
- package/dist/compositions/response/Response.d.ts +19 -18
- package/dist/compositions/response/Response.d.ts.map +1 -0
- package/dist/compositions/response/Response.js +63 -19
- package/dist/compositions/response-creator/ResponseCreator.d.ts +16 -15
- package/dist/compositions/response-creator/ResponseCreator.d.ts.map +1 -0
- package/dist/compositions/response-creator/ResponseCreator.js +67 -23
- package/dist/compositions/user-info/UserInfo.d.ts +22 -21
- package/dist/compositions/user-info/UserInfo.d.ts.map +1 -0
- package/dist/compositions/user-info/UserInfo.js +71 -52
- package/dist/compositions/user-recommendation/UserRecommendation.d.ts +16 -15
- package/dist/compositions/user-recommendation/UserRecommendation.d.ts.map +1 -0
- package/dist/compositions/user-recommendation/UserRecommendation.js +58 -30
- package/dist/index.d.ts +3 -3
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +129 -4
- package/dist/setupTests.d.ts +1 -1
- package/dist/setupTests.d.ts.map +1 -0
- package/package.json +16 -14
- package/dist/components/accessible-button/AccessibleButton.test.d.ts +0 -1
- package/dist/components/accessible-button/AccessibleButton.test.js +0 -28
- package/dist/components/button/Button.test.d.ts +0 -1
- package/dist/components/button/Button.test.js +0 -30
- 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/generated/index.js +0 -24
- package/dist/components/index.js +0 -27
- package/dist/components/like-toggle/LikeToggle.test.d.ts +0 -1
- package/dist/components/like-toggle/LikeToggle.test.js +0 -35
- 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.test.d.ts +0 -1
- package/dist/components/navi-button/NaviButton.test.js +0 -22
- 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/Tabs.test.d.ts +0 -1
- package/dist/components/tabs/Tabs.test.js +0 -61
- package/dist/components/text-link/TextLink.test.d.ts +0 -1
- package/dist/components/text-link/TextLink.test.js +0 -14
- 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.test.d.ts +0 -1
- package/dist/components/toggle/Toggle.test.js +0 -93
- package/dist/compositions/index.js +0 -11
- package/dist/favicon.svg +0 -18
- package/dist/index.cjs.js +0 -50
- package/dist/index.es.js +0 -8343
- package/dist/logo-inline-gradient.svg +0 -43
- package/dist/setupTests.js +0 -7
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ImageBanner.d.ts","sourceRoot":"","sources":["../../../src/compositions/image-banner/ImageBanner.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAU,KAAK,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAG9D,QAAA,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2CAiCrB,CAAC;AAEH,KAAK,mBAAmB,GAAG,YAAY,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAElE,UAAU,gBAAiB,SAAQ,mBAAmB;IACpD,uBAAuB;IACvB,GAAG,EAAE,MAAM,CAAC;IAEZ;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;IAEZ,wDAAwD;IACxD,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED;;;;;GAKG;AACH,eAAO,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,gBAAgB,CA0BlD,CAAC"}
|
|
@@ -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
|
};
|
|
@@ -11,5 +11,6 @@ export type ImageUploadModalRef = {
|
|
|
11
11
|
*
|
|
12
12
|
* Renders a post creation component.
|
|
13
13
|
*/
|
|
14
|
-
export declare const ImageUploadModal: import(
|
|
14
|
+
export declare const ImageUploadModal: import('react').ForwardRefExoticComponent<ImageUploadModalProps & import('react').RefAttributes<ImageUploadModalRef>>;
|
|
15
15
|
export {};
|
|
16
|
+
//# sourceMappingURL=ImageUploadModal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ImageUploadModal.d.ts","sourceRoot":"","sources":["../../../src/compositions/image-upload-modal/ImageUploadModal.tsx"],"names":[],"mappings":"AAIA,UAAU,qBAAqB;IAC7B,4FAA4F;IAC5F,YAAY,EAAE,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,KAAK,IAAI,CAAC;CAC3C;AAED,MAAM,MAAM,mBAAmB,GAAG;IAChC,sFAAsF;IACtF,SAAS,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;CACpC,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,uHAwC3B,CAAC"}
|
|
@@ -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,11 +1,12 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
3
|
-
export * from
|
|
4
|
-
export * from
|
|
5
|
-
export * from
|
|
6
|
-
export * from
|
|
7
|
-
export * from
|
|
8
|
-
export * from
|
|
9
|
-
export * from
|
|
10
|
-
export * from
|
|
11
|
-
export * from
|
|
1
|
+
export * from './image-banner/ImageBanner';
|
|
2
|
+
export * from './image-upload-modal/ImageUploadModal';
|
|
3
|
+
export * from './post/Post';
|
|
4
|
+
export * from './post-creator/PostCreator';
|
|
5
|
+
export * from './profile-banner/ProfileBanner';
|
|
6
|
+
export * from './profile-banner-image/ProfileBannerImage';
|
|
7
|
+
export * from './profile-banner-info/ProfileBannerInfo';
|
|
8
|
+
export * from './response/Response';
|
|
9
|
+
export * from './response-creator/ResponseCreator';
|
|
10
|
+
export * from './user-info/UserInfo';
|
|
11
|
+
export * from './user-recommendation/UserRecommendation';
|
|
12
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/compositions/index.ts"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,CAAC;AAC3C,cAAc,uCAAuC,CAAC;AACtD,cAAc,aAAa,CAAC;AAC5B,cAAc,4BAA4B,CAAC;AAC3C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,2CAA2C,CAAC;AAC1D,cAAc,yCAAyC,CAAC;AACxD,cAAc,qBAAqB,CAAC;AACpC,cAAc,oCAAoC,CAAC;AACnD,cAAc,sBAAsB,CAAC;AACrC,cAAc,0CAA0C,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
declare const PostStyles: import(
|
|
1
|
+
import { VariantProps } from 'tailwind-variants';
|
|
2
|
+
declare const PostStyles: import('tailwind-variants').TVReturnType<{
|
|
3
3
|
size: {
|
|
4
4
|
lg: {
|
|
5
5
|
base: string[];
|
|
@@ -25,7 +25,7 @@ declare const PostStyles: import("tailwind-variants").TVReturnType<{
|
|
|
25
25
|
content: string[];
|
|
26
26
|
text: string[];
|
|
27
27
|
action: string[];
|
|
28
|
-
}, import(
|
|
28
|
+
}, import('tailwind-variants').TVReturnType<{
|
|
29
29
|
size: {
|
|
30
30
|
lg: {
|
|
31
31
|
base: string[];
|
|
@@ -73,3 +73,4 @@ interface PostProps extends PostVariants {
|
|
|
73
73
|
*/
|
|
74
74
|
export declare const Post: React.FC<PostProps>;
|
|
75
75
|
export {};
|
|
76
|
+
//# sourceMappingURL=Post.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Post.d.ts","sourceRoot":"","sources":["../../../src/compositions/post/Post.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAM,KAAK,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAa1D,QAAA,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2CAcd,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,CAAC;IAEpB,uDAAuD;IACvD,QAAQ,EAAE,MAAM,CAAC;IAEjB,mDAAmD;IACnD,SAAS,EAAE,IAAI,CAAC;IAEhB,yCAAyC;IACzC,IAAI,EAAE,MAAM,CAAC;IAEb,uBAAuB;IACvB,GAAG,EAAE,MAAM,CAAC;IAEZ,4CAA4C;IAC5C,aAAa,EAAE,MAAM,IAAI,CAAC;IAE1B,2DAA2D;IAC3D,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB,oEAAoE;IACpE,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,IAAI,EAAE,KAAK,CAAC,EAAE,CAAC,SAAS,CAiDpC,CAAC"}
|
|
@@ -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,27 @@
|
|
|
1
|
-
import {
|
|
2
|
-
declare const PostBaseStyles: import(
|
|
1
|
+
import { VariantProps } from 'tailwind-variants';
|
|
2
|
+
declare const PostBaseStyles: import('tailwind-variants').TVReturnType<{
|
|
3
3
|
[key: string]: {
|
|
4
|
-
[key: string]: import(
|
|
5
|
-
base?: import(
|
|
4
|
+
[key: string]: import('tailwind-merge').ClassNameValue | {
|
|
5
|
+
base?: import('tailwind-merge').ClassNameValue;
|
|
6
6
|
};
|
|
7
7
|
};
|
|
8
8
|
} | {
|
|
9
9
|
[x: string]: {
|
|
10
|
-
[x: string]: import(
|
|
11
|
-
base?: import(
|
|
10
|
+
[x: string]: import('tailwind-merge').ClassNameValue | {
|
|
11
|
+
base?: import('tailwind-merge').ClassNameValue;
|
|
12
12
|
};
|
|
13
13
|
};
|
|
14
14
|
} | {}, {
|
|
15
15
|
base: string[];
|
|
16
16
|
}, undefined, {
|
|
17
17
|
[key: string]: {
|
|
18
|
-
[key: string]: import(
|
|
19
|
-
base?: import(
|
|
18
|
+
[key: string]: import('tailwind-merge').ClassNameValue | {
|
|
19
|
+
base?: import('tailwind-merge').ClassNameValue;
|
|
20
20
|
};
|
|
21
21
|
};
|
|
22
22
|
} | {}, {
|
|
23
23
|
base: string[];
|
|
24
|
-
}, import(
|
|
24
|
+
}, import('tailwind-variants').TVReturnType<unknown, {
|
|
25
25
|
base: string[];
|
|
26
26
|
}, undefined, unknown, unknown, undefined>>;
|
|
27
27
|
type PostBaseVariants = VariantProps<typeof PostBaseStyles>;
|
|
@@ -39,3 +39,4 @@ export interface PostBaseProps extends PostBaseVariants {
|
|
|
39
39
|
*/
|
|
40
40
|
export declare const PostBase: React.FC<PostBaseProps>;
|
|
41
41
|
export {};
|
|
42
|
+
//# sourceMappingURL=PostBase.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PostBase.d.ts","sourceRoot":"","sources":["../../../src/compositions/post-base/PostBase.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAU,KAAK,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAE9D,QAAA,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;2CAgBlB,CAAC;AAEH,KAAK,gBAAgB,GAAG,YAAY,CAAC,OAAO,cAAc,CAAC,CAAC;AAE5D,MAAM,WAAW,aAAc,SAAQ,gBAAgB;IACrD;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,2DAA2D;IAC3D,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAED;;;GAGG;AACH,eAAO,MAAM,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,aAAa,CAI5C,CAAC"}
|
|
@@ -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,22 +1,22 @@
|
|
|
1
|
-
import {
|
|
2
|
-
declare const PostCreatorStyles: import(
|
|
1
|
+
import { VariantProps } from 'tailwind-variants';
|
|
2
|
+
declare const PostCreatorStyles: import('tailwind-variants').TVReturnType<{
|
|
3
3
|
[key: string]: {
|
|
4
|
-
[key: string]: import(
|
|
5
|
-
input?: import(
|
|
6
|
-
title?: import(
|
|
7
|
-
avatar?: import(
|
|
8
|
-
action?: import(
|
|
9
|
-
content?: import(
|
|
4
|
+
[key: string]: import('tailwind-merge').ClassNameValue | {
|
|
5
|
+
input?: import('tailwind-merge').ClassNameValue;
|
|
6
|
+
title?: import('tailwind-merge').ClassNameValue;
|
|
7
|
+
avatar?: import('tailwind-merge').ClassNameValue;
|
|
8
|
+
action?: import('tailwind-merge').ClassNameValue;
|
|
9
|
+
content?: import('tailwind-merge').ClassNameValue;
|
|
10
10
|
};
|
|
11
11
|
};
|
|
12
12
|
} | {
|
|
13
13
|
[x: string]: {
|
|
14
|
-
[x: string]: import(
|
|
15
|
-
input?: import(
|
|
16
|
-
title?: import(
|
|
17
|
-
avatar?: import(
|
|
18
|
-
action?: import(
|
|
19
|
-
content?: import(
|
|
14
|
+
[x: string]: import('tailwind-merge').ClassNameValue | {
|
|
15
|
+
input?: import('tailwind-merge').ClassNameValue;
|
|
16
|
+
title?: import('tailwind-merge').ClassNameValue;
|
|
17
|
+
avatar?: import('tailwind-merge').ClassNameValue;
|
|
18
|
+
action?: import('tailwind-merge').ClassNameValue;
|
|
19
|
+
content?: import('tailwind-merge').ClassNameValue;
|
|
20
20
|
};
|
|
21
21
|
};
|
|
22
22
|
} | {}, {
|
|
@@ -27,12 +27,12 @@ declare const PostCreatorStyles: import("tailwind-variants").TVReturnType<{
|
|
|
27
27
|
action: string[];
|
|
28
28
|
}, undefined, {
|
|
29
29
|
[key: string]: {
|
|
30
|
-
[key: string]: import(
|
|
31
|
-
input?: import(
|
|
32
|
-
title?: import(
|
|
33
|
-
avatar?: import(
|
|
34
|
-
action?: import(
|
|
35
|
-
content?: import(
|
|
30
|
+
[key: string]: import('tailwind-merge').ClassNameValue | {
|
|
31
|
+
input?: import('tailwind-merge').ClassNameValue;
|
|
32
|
+
title?: import('tailwind-merge').ClassNameValue;
|
|
33
|
+
avatar?: import('tailwind-merge').ClassNameValue;
|
|
34
|
+
action?: import('tailwind-merge').ClassNameValue;
|
|
35
|
+
content?: import('tailwind-merge').ClassNameValue;
|
|
36
36
|
};
|
|
37
37
|
};
|
|
38
38
|
} | {}, {
|
|
@@ -41,7 +41,7 @@ declare const PostCreatorStyles: import("tailwind-variants").TVReturnType<{
|
|
|
41
41
|
title: string[];
|
|
42
42
|
input: string[];
|
|
43
43
|
action: string[];
|
|
44
|
-
}, import(
|
|
44
|
+
}, import('tailwind-variants').TVReturnType<unknown, {
|
|
45
45
|
content: string[];
|
|
46
46
|
avatar: string[];
|
|
47
47
|
title: string[];
|
|
@@ -67,3 +67,4 @@ interface PostCreatorProps extends PostCreatorVariants {
|
|
|
67
67
|
*/
|
|
68
68
|
export declare const PostCreator: React.FC<PostCreatorProps>;
|
|
69
69
|
export {};
|
|
70
|
+
//# sourceMappingURL=PostCreator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PostCreator.d.ts","sourceRoot":"","sources":["../../../src/compositions/post-creator/PostCreator.tsx"],"names":[],"mappings":"AAEA,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,CAAC;IAEZ,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"}
|
|
@@ -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
|
};
|