@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,48 +1,64 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
2
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
3
3
|
import * as RadixForm from "@radix-ui/react-form";
|
|
4
4
|
import { useState } from "react";
|
|
5
5
|
import { tv } from "tailwind-variants";
|
|
6
|
-
import { Label } from "../typography/Label";
|
|
7
|
-
import { ValidationMessage } from "../typography/ValidationMessage";
|
|
6
|
+
import { Label } from "../typography/Label.js";
|
|
7
|
+
import { ValidationMessage } from "../typography/ValidationMessage.js";
|
|
8
8
|
const textareaStyles = tv({
|
|
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
|
-
|
|
39
|
-
|
|
40
|
-
|
|
9
|
+
slots: {
|
|
10
|
+
base: ["flex", "flex-col", "gap-1", "w-full", "h-full"],
|
|
11
|
+
control: [
|
|
12
|
+
"w-full",
|
|
13
|
+
"h-full",
|
|
14
|
+
"ring",
|
|
15
|
+
"hover:ring-2",
|
|
16
|
+
"focus:ring-2",
|
|
17
|
+
"ring-slate-200",
|
|
18
|
+
"hover:ring-slate-300",
|
|
19
|
+
"focus:ring-violet-600",
|
|
20
|
+
"focus-visible:ring-violet-600",
|
|
21
|
+
"focus-within:ring-violet-600",
|
|
22
|
+
"focus-visible:outline-none",
|
|
23
|
+
"bg-slate-100",
|
|
24
|
+
"rounded-lg",
|
|
25
|
+
"p-4",
|
|
26
|
+
"transition",
|
|
27
|
+
"duration-300",
|
|
28
|
+
"ease-in-out",
|
|
29
|
+
"font-medium",
|
|
30
|
+
"text-slate-900",
|
|
31
|
+
"text-[20px]/[135%]",
|
|
32
|
+
"tracking-normal",
|
|
33
|
+
"placeholder:font-medium",
|
|
34
|
+
"placeholder:text-slate-500",
|
|
35
|
+
"placeholder:text-[20px]/[135%]",
|
|
36
|
+
"placeholder:tracking-normal",
|
|
37
|
+
"resize-none"
|
|
38
|
+
],
|
|
39
|
+
message: ["text-error"]
|
|
40
|
+
}
|
|
41
41
|
});
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
42
|
+
const Textarea = ({ isRequired = false, ...props }) => {
|
|
43
|
+
const { base, control, message } = textareaStyles({
|
|
44
|
+
...props
|
|
45
|
+
});
|
|
46
|
+
const [value, setValue] = useState("");
|
|
47
|
+
return /* @__PURE__ */ jsxs(RadixForm.Field, { name: props.name, className: base(props), children: [
|
|
48
|
+
props.label && /* @__PURE__ */ jsx(RadixForm.Label, { children: /* @__PURE__ */ jsx(Label, { size: "md", children: props.label }) }),
|
|
49
|
+
/* @__PURE__ */ jsx(RadixForm.Control, { asChild: true, children: /* @__PURE__ */ jsx(
|
|
50
|
+
"textarea",
|
|
51
|
+
{
|
|
52
|
+
className: control(props),
|
|
53
|
+
required: isRequired,
|
|
54
|
+
placeholder: props.placeholder,
|
|
55
|
+
onChange: (e) => setValue(e.target.value),
|
|
56
|
+
onBlur: () => props.onChange(value)
|
|
57
|
+
}
|
|
58
|
+
) }),
|
|
59
|
+
/* @__PURE__ */ jsx("div", { className: message(props), children: isRequired && /* @__PURE__ */ jsx(RadixForm.Message, { match: "valueMissing", children: /* @__PURE__ */ jsx(ValidationMessage, { children: `${props.name} is required` }) }) })
|
|
60
|
+
] });
|
|
61
|
+
};
|
|
62
|
+
export {
|
|
63
|
+
Textarea
|
|
48
64
|
};
|
|
@@ -1,109 +1,123 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { AccessibleButton
|
|
5
|
-
import { Label } from "../typography/Label";
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useState, useRef, useEffect } from "react";
|
|
3
|
+
import { tv, cn } from "tailwind-variants";
|
|
4
|
+
import { AccessibleButton } from "../accessible-button/AccessibleButton.js";
|
|
5
|
+
import { Label } from "../typography/Label.js";
|
|
6
6
|
const timedButtonStyles = tv({
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
7
|
+
slots: {
|
|
8
|
+
base: [
|
|
9
|
+
"inline-flex",
|
|
10
|
+
"items-center",
|
|
11
|
+
"justify-center",
|
|
12
|
+
"gap-2",
|
|
13
|
+
"h-8",
|
|
14
|
+
"px-3",
|
|
15
|
+
"py-2",
|
|
16
|
+
"rounded-full",
|
|
17
|
+
"focus-visible:outline-none",
|
|
18
|
+
"focus-visible:ring-2",
|
|
19
|
+
"focus-visible:ring-offset-2",
|
|
20
|
+
"disabled:opacity-50",
|
|
21
|
+
"disabled:pointer-events-none",
|
|
22
|
+
"hover:bg-slate-100",
|
|
23
|
+
"overflow-hidden"
|
|
24
|
+
],
|
|
25
|
+
icon: ["w-4", "h-4", "inline-flex"],
|
|
26
|
+
label: ["transition-opacity", "duration-350", "ease-in-out"]
|
|
27
|
+
},
|
|
28
|
+
variants: {
|
|
29
|
+
pressed: {
|
|
30
|
+
false: {},
|
|
31
|
+
true: {
|
|
32
|
+
base: ["bg-slate-100"]
|
|
33
|
+
}
|
|
27
34
|
},
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
35
|
+
animating: {
|
|
36
|
+
true: {},
|
|
37
|
+
false: {}
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
compoundVariants: [
|
|
41
|
+
{
|
|
42
|
+
pressed: true,
|
|
43
|
+
animating: true,
|
|
44
|
+
class: {
|
|
45
|
+
label: ["opacity-0"]
|
|
46
|
+
}
|
|
39
47
|
},
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
},
|
|
47
|
-
},
|
|
48
|
-
{
|
|
49
|
-
pressed: true,
|
|
50
|
-
animating: false,
|
|
51
|
-
class: {
|
|
52
|
-
label: ["opacity-100"],
|
|
53
|
-
},
|
|
54
|
-
},
|
|
55
|
-
{
|
|
56
|
-
pressed: false,
|
|
57
|
-
animating: true,
|
|
58
|
-
class: {
|
|
59
|
-
label: ["opacity-0"],
|
|
60
|
-
},
|
|
61
|
-
},
|
|
62
|
-
{
|
|
63
|
-
pressed: false,
|
|
64
|
-
animating: false,
|
|
65
|
-
class: {
|
|
66
|
-
label: ["opacity-100"],
|
|
67
|
-
},
|
|
68
|
-
},
|
|
69
|
-
],
|
|
70
|
-
defaultVariants: {
|
|
71
|
-
pressed: false,
|
|
72
|
-
animating: false,
|
|
48
|
+
{
|
|
49
|
+
pressed: true,
|
|
50
|
+
animating: false,
|
|
51
|
+
class: {
|
|
52
|
+
label: ["opacity-100"]
|
|
53
|
+
}
|
|
73
54
|
},
|
|
55
|
+
{
|
|
56
|
+
pressed: false,
|
|
57
|
+
animating: true,
|
|
58
|
+
class: {
|
|
59
|
+
label: ["opacity-0"]
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
pressed: false,
|
|
64
|
+
animating: false,
|
|
65
|
+
class: {
|
|
66
|
+
label: ["opacity-100"]
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
],
|
|
70
|
+
defaultVariants: {
|
|
71
|
+
pressed: false,
|
|
72
|
+
animating: false
|
|
73
|
+
}
|
|
74
74
|
});
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
setPressed(true);
|
|
93
|
-
setAnimating(true);
|
|
94
|
-
onClick?.();
|
|
95
|
-
// Hover -> Pressed: Dissolve über 350ms
|
|
96
|
-
const timeout1 = setTimeout(() => setAnimating(false), 350);
|
|
97
|
-
timeoutsRef.current.push(timeout1);
|
|
98
|
-
// Nach 1s Verzögerung -> zurück zu Default
|
|
99
|
-
const timeout2 = setTimeout(() => {
|
|
100
|
-
setPressed(false);
|
|
101
|
-
setAnimating(true);
|
|
102
|
-
// Dissolve zurück
|
|
103
|
-
const timeout3 = setTimeout(() => setAnimating(false), 350);
|
|
104
|
-
timeoutsRef.current.push(timeout3);
|
|
105
|
-
}, 1000);
|
|
106
|
-
timeoutsRef.current.push(timeout2);
|
|
75
|
+
const TimedButton = ({
|
|
76
|
+
className,
|
|
77
|
+
onClick,
|
|
78
|
+
...props
|
|
79
|
+
}) => {
|
|
80
|
+
const [pressed, setPressed] = useState(false);
|
|
81
|
+
const [animating, setAnimating] = useState(false);
|
|
82
|
+
const timeoutsRef = useRef([]);
|
|
83
|
+
const {
|
|
84
|
+
base,
|
|
85
|
+
icon: iconClass,
|
|
86
|
+
label: labelClass
|
|
87
|
+
} = timedButtonStyles({ pressed, animating });
|
|
88
|
+
useEffect(() => {
|
|
89
|
+
return () => {
|
|
90
|
+
timeoutsRef.current.forEach((timeout) => clearTimeout(timeout));
|
|
91
|
+
timeoutsRef.current = [];
|
|
107
92
|
};
|
|
108
|
-
|
|
93
|
+
}, []);
|
|
94
|
+
const handleClick = () => {
|
|
95
|
+
setPressed(true);
|
|
96
|
+
setAnimating(true);
|
|
97
|
+
onClick?.();
|
|
98
|
+
const timeout1 = setTimeout(() => setAnimating(false), 350);
|
|
99
|
+
timeoutsRef.current.push(timeout1);
|
|
100
|
+
const timeout2 = setTimeout(() => {
|
|
101
|
+
setPressed(false);
|
|
102
|
+
setAnimating(true);
|
|
103
|
+
const timeout3 = setTimeout(() => setAnimating(false), 350);
|
|
104
|
+
timeoutsRef.current.push(timeout3);
|
|
105
|
+
}, 1e3);
|
|
106
|
+
timeoutsRef.current.push(timeout2);
|
|
107
|
+
};
|
|
108
|
+
return /* @__PURE__ */ jsxs(
|
|
109
|
+
AccessibleButton,
|
|
110
|
+
{
|
|
111
|
+
className: cn(base(props), className),
|
|
112
|
+
onClick: handleClick,
|
|
113
|
+
...props,
|
|
114
|
+
children: [
|
|
115
|
+
props.icon && /* @__PURE__ */ jsx(props.icon, { className: iconClass(), "aria-hidden": "true" }),
|
|
116
|
+
/* @__PURE__ */ jsx(Label, { as: "span", size: "md", className: labelClass(), children: pressed ? props.labelActive : props.label })
|
|
117
|
+
]
|
|
118
|
+
}
|
|
119
|
+
);
|
|
120
|
+
};
|
|
121
|
+
export {
|
|
122
|
+
TimedButton
|
|
109
123
|
};
|
|
@@ -1,69 +1,98 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
2
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
3
3
|
import * as RadixToggle from "@radix-ui/react-toggle";
|
|
4
4
|
import { tv } from "tailwind-variants";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
5
|
+
import { Label } from "../typography/Label.js";
|
|
6
|
+
import { ReplyFilled } from "../icons/generated/ReplyFilled.js";
|
|
7
|
+
import { ReplyOutline } from "../icons/generated/ReplyOutline.js";
|
|
7
8
|
const toggleStyles = tv({
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
9
|
+
slots: {
|
|
10
|
+
base: [
|
|
11
|
+
"inline-flex",
|
|
12
|
+
"items-center",
|
|
13
|
+
"justify-center",
|
|
14
|
+
"gap-2",
|
|
15
|
+
"h-8",
|
|
16
|
+
"px-3",
|
|
17
|
+
"py-2",
|
|
18
|
+
"rounded-full",
|
|
19
|
+
"transition-all",
|
|
20
|
+
"duration-150",
|
|
21
|
+
"ease-in-out",
|
|
22
|
+
"focus-visible:outline-none",
|
|
23
|
+
"focus-visible:ring-2",
|
|
24
|
+
"focus-visible:ring-offset-2",
|
|
25
|
+
"disabled:opacity-50",
|
|
26
|
+
"disabled:pointer-events-none",
|
|
27
|
+
"cursor-pointer"
|
|
28
|
+
],
|
|
29
|
+
icon: ["inline-flex"],
|
|
30
|
+
label: []
|
|
31
|
+
},
|
|
32
|
+
variants: {
|
|
33
|
+
pressed: {
|
|
34
|
+
true: {
|
|
35
|
+
base: ["hover:bg-violet-50", "hover:text-violet-600"],
|
|
36
|
+
icon: [
|
|
37
|
+
"text-violet-600",
|
|
38
|
+
"hover:transition-all",
|
|
39
|
+
"hover:duration-300",
|
|
40
|
+
"hover:ease-out"
|
|
27
41
|
],
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
"hover:transition-all",
|
|
53
|
-
"hover:duration-350",
|
|
54
|
-
"hover:ease-in-out",
|
|
55
|
-
],
|
|
56
|
-
label: [
|
|
57
|
-
"text-inherit",
|
|
58
|
-
"hover:transition-all",
|
|
59
|
-
"hover:duration-350",
|
|
60
|
-
"hover:ease-in-out",
|
|
61
|
-
],
|
|
62
|
-
},
|
|
63
|
-
},
|
|
64
|
-
},
|
|
42
|
+
label: [
|
|
43
|
+
"text-inherit",
|
|
44
|
+
"hover:transition-all",
|
|
45
|
+
"hover:duration-300",
|
|
46
|
+
"hover:ease-out"
|
|
47
|
+
]
|
|
48
|
+
},
|
|
49
|
+
false: {
|
|
50
|
+
base: ["hover:bg-violet-50", "hover:text-violet-600"],
|
|
51
|
+
icon: [
|
|
52
|
+
"text-inherit",
|
|
53
|
+
"hover:transition-all",
|
|
54
|
+
"hover:duration-350",
|
|
55
|
+
"hover:ease-in-out"
|
|
56
|
+
],
|
|
57
|
+
label: [
|
|
58
|
+
"text-inherit",
|
|
59
|
+
"hover:transition-all",
|
|
60
|
+
"hover:duration-350",
|
|
61
|
+
"hover:ease-in-out"
|
|
62
|
+
]
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
65
66
|
});
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
67
|
+
const Toggle = ({
|
|
68
|
+
ariaLabel,
|
|
69
|
+
labelText,
|
|
70
|
+
pressed = false,
|
|
71
|
+
onToggle
|
|
72
|
+
}) => {
|
|
73
|
+
const { base, icon, label: labelSlot } = toggleStyles({ pressed });
|
|
74
|
+
return /* @__PURE__ */ jsxs(
|
|
75
|
+
RadixToggle.Root,
|
|
76
|
+
{
|
|
77
|
+
"aria-label": ariaLabel,
|
|
78
|
+
className: base(),
|
|
79
|
+
pressed,
|
|
80
|
+
onPressedChange: onToggle,
|
|
81
|
+
children: [
|
|
82
|
+
/* @__PURE__ */ jsx(
|
|
83
|
+
"span",
|
|
84
|
+
{
|
|
85
|
+
className: icon(),
|
|
86
|
+
"aria-hidden": "true",
|
|
87
|
+
"aria-label": pressed ? "ReplyFilled" : "ReplyOutline",
|
|
88
|
+
children: pressed ? /* @__PURE__ */ jsx(ReplyFilled, {}) : /* @__PURE__ */ jsx(ReplyOutline, {})
|
|
89
|
+
}
|
|
90
|
+
),
|
|
91
|
+
/* @__PURE__ */ jsx("span", { className: labelSlot(), children: /* @__PURE__ */ jsx(Label, { as: "span", size: "md", children: labelText }) })
|
|
92
|
+
]
|
|
93
|
+
}
|
|
94
|
+
);
|
|
95
|
+
};
|
|
96
|
+
export {
|
|
97
|
+
Toggle
|
|
69
98
|
};
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import { createElement } from "react";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
2
|
+
const AccessibleTypography = (props) => {
|
|
3
|
+
return createElement(
|
|
4
|
+
props.as ?? "span",
|
|
5
|
+
{
|
|
6
|
+
className: props.className,
|
|
7
|
+
"aria-label": props.ariaLabel
|
|
8
|
+
},
|
|
9
|
+
props.children
|
|
10
|
+
);
|
|
11
|
+
};
|
|
12
|
+
export {
|
|
13
|
+
AccessibleTypography
|
|
11
14
|
};
|
|
@@ -1,11 +1,15 @@
|
|
|
1
|
-
import { jsx
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { cn } from "tailwind-variants";
|
|
3
|
-
import { AccessibleTypography
|
|
4
|
-
import { headingStyles } from "./styles";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
3
|
+
import { AccessibleTypography } from "./AccessibleTypography.js";
|
|
4
|
+
import { headingStyles } from "./styles.js";
|
|
5
|
+
const Heading = ({
|
|
6
|
+
as,
|
|
7
|
+
className,
|
|
8
|
+
...props
|
|
9
|
+
}) => {
|
|
10
|
+
const styles = cn(headingStyles(props), className);
|
|
11
|
+
return /* @__PURE__ */ jsx(AccessibleTypography, { as, className: styles, ...props });
|
|
12
|
+
};
|
|
13
|
+
export {
|
|
14
|
+
Heading
|
|
11
15
|
};
|
|
@@ -1,11 +1,15 @@
|
|
|
1
|
-
import { jsx
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { cn } from "tailwind-variants";
|
|
3
|
-
import { AccessibleTypography
|
|
4
|
-
import { labelStyles } from "./styles";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
3
|
+
import { AccessibleTypography } from "./AccessibleTypography.js";
|
|
4
|
+
import { labelStyles } from "./styles.js";
|
|
5
|
+
const Label = ({
|
|
6
|
+
as = "label",
|
|
7
|
+
className,
|
|
8
|
+
...props
|
|
9
|
+
}) => {
|
|
10
|
+
const styles = cn(labelStyles(props), className);
|
|
11
|
+
return /* @__PURE__ */ jsx(AccessibleTypography, { as, className: styles, ...props });
|
|
12
|
+
};
|
|
13
|
+
export {
|
|
14
|
+
Label
|
|
11
15
|
};
|
|
@@ -1,11 +1,15 @@
|
|
|
1
|
-
import { jsx
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { cn } from "tailwind-variants";
|
|
3
|
-
import { AccessibleTypography
|
|
4
|
-
import { paragraphStyles } from "./styles";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
3
|
+
import { AccessibleTypography } from "./AccessibleTypography.js";
|
|
4
|
+
import { paragraphStyles } from "./styles.js";
|
|
5
|
+
const Paragraph = ({
|
|
6
|
+
as = "p",
|
|
7
|
+
className,
|
|
8
|
+
...props
|
|
9
|
+
}) => {
|
|
10
|
+
const styles = cn(paragraphStyles(props), className);
|
|
11
|
+
return /* @__PURE__ */ jsx(AccessibleTypography, { as, className: styles, ...props });
|
|
12
|
+
};
|
|
13
|
+
export {
|
|
14
|
+
Paragraph
|
|
11
15
|
};
|
|
@@ -1,11 +1,15 @@
|
|
|
1
|
-
import { jsx
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { cn } from "tailwind-variants";
|
|
3
|
-
import { AccessibleTypography
|
|
4
|
-
import { placeholderStyles } from "./styles";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
3
|
+
import { AccessibleTypography } from "./AccessibleTypography.js";
|
|
4
|
+
import { placeholderStyles } from "./styles.js";
|
|
5
|
+
const Placeholder = ({
|
|
6
|
+
as = "span",
|
|
7
|
+
className,
|
|
8
|
+
...props
|
|
9
|
+
}) => {
|
|
10
|
+
const styles = cn(placeholderStyles(props), className);
|
|
11
|
+
return /* @__PURE__ */ jsx(AccessibleTypography, { as, className: styles, ...props });
|
|
12
|
+
};
|
|
13
|
+
export {
|
|
14
|
+
Placeholder
|
|
11
15
|
};
|
|
@@ -1,11 +1,16 @@
|
|
|
1
|
-
import { jsx
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { cn } from "tailwind-variants";
|
|
3
|
-
import { AccessibleTypography
|
|
4
|
-
import { validationMessageStyles } from "./styles";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
3
|
+
import { AccessibleTypography } from "./AccessibleTypography.js";
|
|
4
|
+
import { validationMessageStyles } from "./styles.js";
|
|
5
|
+
const ValidationMessage = ({
|
|
6
|
+
as = "span",
|
|
7
|
+
type = "error",
|
|
8
|
+
className,
|
|
9
|
+
...props
|
|
10
|
+
}) => {
|
|
11
|
+
const styles = cn(validationMessageStyles({ type, ...props }), className);
|
|
12
|
+
return /* @__PURE__ */ jsx(AccessibleTypography, { as, className: styles, ...props });
|
|
13
|
+
};
|
|
14
|
+
export {
|
|
15
|
+
ValidationMessage
|
|
11
16
|
};
|