@krrli/cm-designsystem 1.32.1 → 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 -12
- 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.cjs.js +0 -50
- 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,62 +1,78 @@
|
|
|
1
|
-
import { jsx
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import * as RadixDialog from "@radix-ui/react-dialog";
|
|
3
3
|
import React from "react";
|
|
4
4
|
import { tv } from "tailwind-variants";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
5
|
+
import { Heading } from "../typography/Heading.js";
|
|
6
|
+
import { Cancel } from "../icons/generated/Cancel.js";
|
|
7
7
|
const modalStyles = tv({
|
|
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
|
-
|
|
8
|
+
slots: {
|
|
9
|
+
overlay: ["fixed", "inset-0", "bg-black/20"],
|
|
10
|
+
content: [
|
|
11
|
+
"fixed",
|
|
12
|
+
"top-1/2",
|
|
13
|
+
"left-1/2",
|
|
14
|
+
"w-123",
|
|
15
|
+
"-translate-x-1/2",
|
|
16
|
+
"-translate-y-1/2",
|
|
17
|
+
"rounded-2xl",
|
|
18
|
+
"bg-white"
|
|
19
|
+
],
|
|
20
|
+
title: [
|
|
21
|
+
"flex",
|
|
22
|
+
"justify-between",
|
|
23
|
+
"rounded-t-2xl",
|
|
24
|
+
"bg-violet-600",
|
|
25
|
+
"pt-6",
|
|
26
|
+
"pr-8",
|
|
27
|
+
"pb-6",
|
|
28
|
+
"pl-8",
|
|
29
|
+
"text-white"
|
|
30
|
+
],
|
|
31
|
+
container: ["flex", "flex-col", "items-center", "gap-12", "p-8"],
|
|
32
|
+
actions: ["flex", "items-center", "gap-4", "w-full"]
|
|
33
|
+
}
|
|
34
34
|
});
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
35
|
+
const Modal = (props) => {
|
|
36
|
+
let modalBody = null;
|
|
37
|
+
let modalActions = null;
|
|
38
|
+
React.Children.forEach(props.children, (child) => {
|
|
39
|
+
if (!React.isValidElement(child)) return;
|
|
40
|
+
switch (child.type) {
|
|
41
|
+
case ModalBody:
|
|
42
|
+
modalBody = child;
|
|
43
|
+
break;
|
|
44
|
+
case ModalActions:
|
|
45
|
+
modalActions = child;
|
|
46
|
+
break;
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
const { overlay, content, title, container, actions } = modalStyles(props);
|
|
50
|
+
return /* @__PURE__ */ jsx(RadixDialog.Root, { open: props.open, onOpenChange: props.onOpenChange, children: /* @__PURE__ */ jsxs(RadixDialog.Portal, { children: [
|
|
51
|
+
/* @__PURE__ */ jsx(RadixDialog.Overlay, { className: overlay() }),
|
|
52
|
+
/* @__PURE__ */ jsxs(RadixDialog.Content, { className: content(), children: [
|
|
53
|
+
/* @__PURE__ */ jsxs(RadixDialog.Title, { className: title(), children: [
|
|
54
|
+
/* @__PURE__ */ jsx(Heading, { as: "span", size: "3", children: props.title }),
|
|
55
|
+
/* @__PURE__ */ jsx(RadixDialog.Close, { children: /* @__PURE__ */ jsx(Cancel, {}) })
|
|
56
|
+
] }),
|
|
57
|
+
/* @__PURE__ */ jsxs("div", { className: container(), children: [
|
|
58
|
+
modalBody,
|
|
59
|
+
/* @__PURE__ */ jsx("div", { className: actions(), children: modalActions })
|
|
60
|
+
] })
|
|
61
|
+
] })
|
|
62
|
+
] }) });
|
|
52
63
|
};
|
|
53
64
|
ModalBody.displayName = "ModalBody";
|
|
54
|
-
|
|
55
|
-
|
|
65
|
+
function ModalBody({ children }) {
|
|
66
|
+
return children;
|
|
56
67
|
}
|
|
57
68
|
ModalActions.displayName = "ModalActions";
|
|
58
|
-
|
|
59
|
-
|
|
69
|
+
function ModalActions({ children }) {
|
|
70
|
+
return children;
|
|
60
71
|
}
|
|
61
72
|
Modal.Body = ModalBody;
|
|
62
73
|
Modal.Actions = ModalActions;
|
|
74
|
+
export {
|
|
75
|
+
Modal,
|
|
76
|
+
ModalActions,
|
|
77
|
+
ModalBody
|
|
78
|
+
};
|
|
@@ -1,34 +1,46 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import React from "react";
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
3
2
|
import { cn, tv } from "tailwind-variants";
|
|
4
|
-
import { AccessibleButton
|
|
5
|
-
import { Label } from "../typography/Label";
|
|
3
|
+
import { AccessibleButton } from "../accessible-button/AccessibleButton.js";
|
|
4
|
+
import { Label } from "../typography/Label.js";
|
|
6
5
|
const naviButtonStyles = tv({
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
6
|
+
base: [
|
|
7
|
+
"flex",
|
|
8
|
+
"flex-col",
|
|
9
|
+
"gap-1",
|
|
10
|
+
"transition",
|
|
11
|
+
"duration-300",
|
|
12
|
+
"ease-in-out",
|
|
13
|
+
"text-white",
|
|
14
|
+
"rounded-lg",
|
|
15
|
+
"items-center",
|
|
16
|
+
"pt-3",
|
|
17
|
+
"pb-3",
|
|
18
|
+
"pl-2",
|
|
19
|
+
"pr-2"
|
|
20
|
+
],
|
|
21
|
+
variants: {
|
|
22
|
+
intent: {
|
|
23
|
+
secondary: ["bg-violet-600", "hover:bg-violet-700"]
|
|
24
|
+
}
|
|
25
|
+
}
|
|
27
26
|
});
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
27
|
+
const NaviButton = ({
|
|
28
|
+
intent = "secondary",
|
|
29
|
+
className,
|
|
30
|
+
...props
|
|
31
|
+
}) => {
|
|
32
|
+
return /* @__PURE__ */ jsxs(
|
|
33
|
+
AccessibleButton,
|
|
34
|
+
{
|
|
35
|
+
className: cn(naviButtonStyles({ intent, ...props }), className),
|
|
36
|
+
...props,
|
|
37
|
+
children: [
|
|
38
|
+
props.icon && /* @__PURE__ */ jsx(props.icon, { className: props.iconClassName }),
|
|
39
|
+
/* @__PURE__ */ jsx(Label, { as: "span", size: "md", children: props.children })
|
|
40
|
+
]
|
|
41
|
+
}
|
|
42
|
+
);
|
|
43
|
+
};
|
|
44
|
+
export {
|
|
45
|
+
NaviButton
|
|
34
46
|
};
|
|
@@ -1,33 +1,43 @@
|
|
|
1
|
-
import { jsx
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { cn, tv } from "tailwind-variants";
|
|
3
|
-
import { AccessibleButton
|
|
4
|
-
import { Avatar } from "../avatar/Avatar";
|
|
3
|
+
import { AccessibleButton } from "../accessible-button/AccessibleButton.js";
|
|
4
|
+
import { Avatar } from "../avatar/Avatar.js";
|
|
5
5
|
const naviUserButtonStyles = tv({
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
6
|
+
base: [
|
|
7
|
+
"flex",
|
|
8
|
+
"flex-col",
|
|
9
|
+
"gap-1",
|
|
10
|
+
"transition",
|
|
11
|
+
"duration-300",
|
|
12
|
+
"ease-in-out",
|
|
13
|
+
"text-white",
|
|
14
|
+
"rounded-lg",
|
|
15
|
+
"items-center",
|
|
16
|
+
"pt-3",
|
|
17
|
+
"pb-3",
|
|
18
|
+
"pl-2",
|
|
19
|
+
"pr-2"
|
|
20
|
+
],
|
|
21
|
+
variants: {
|
|
22
|
+
intent: {
|
|
23
|
+
secondary: ["bg-violet-600", "hover:bg-violet-700"]
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
26
|
});
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
27
|
+
const NaviUserButton = ({
|
|
28
|
+
intent = "secondary",
|
|
29
|
+
className,
|
|
30
|
+
...props
|
|
31
|
+
}) => {
|
|
32
|
+
return /* @__PURE__ */ jsx(
|
|
33
|
+
AccessibleButton,
|
|
34
|
+
{
|
|
35
|
+
className: cn(naviUserButtonStyles({ intent, ...props }), className),
|
|
36
|
+
...props,
|
|
37
|
+
children: /* @__PURE__ */ jsx(Avatar, { alt: props.alt, size: "sm", src: props.src })
|
|
38
|
+
}
|
|
39
|
+
);
|
|
40
|
+
};
|
|
41
|
+
export {
|
|
42
|
+
NaviUserButton
|
|
33
43
|
};
|
|
@@ -1,33 +1,43 @@
|
|
|
1
|
-
import { jsx
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { cn, tv } from "tailwind-variants";
|
|
3
|
-
import { AccessibleButton
|
|
3
|
+
import { AccessibleButton } from "../accessible-button/AccessibleButton.js";
|
|
4
4
|
const roundButtonStyles = tv({
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
5
|
+
base: [
|
|
6
|
+
"text-white",
|
|
7
|
+
"rounded-full",
|
|
8
|
+
"hover:ring-3",
|
|
9
|
+
"active:ring-4",
|
|
10
|
+
"transition",
|
|
11
|
+
"duration-350",
|
|
12
|
+
"active:duration-300",
|
|
13
|
+
"ease-in-out",
|
|
14
|
+
"p-4"
|
|
15
|
+
],
|
|
16
|
+
variants: {
|
|
17
|
+
intent: {
|
|
18
|
+
primary: [
|
|
19
|
+
"bg-slate-600",
|
|
20
|
+
"hover:bg-slate-700",
|
|
21
|
+
"hover:ring-slate-100",
|
|
22
|
+
"active:ring-violet-200"
|
|
23
|
+
]
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
26
|
});
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
27
|
+
const RoundButton = ({
|
|
28
|
+
intent = "primary",
|
|
29
|
+
className,
|
|
30
|
+
...props
|
|
31
|
+
}) => {
|
|
32
|
+
return /* @__PURE__ */ jsx(
|
|
33
|
+
AccessibleButton,
|
|
34
|
+
{
|
|
35
|
+
className: cn(roundButtonStyles({ intent }), className),
|
|
36
|
+
...props,
|
|
37
|
+
children: /* @__PURE__ */ jsx(props.icon, {})
|
|
38
|
+
}
|
|
39
|
+
);
|
|
40
|
+
};
|
|
41
|
+
export {
|
|
42
|
+
RoundButton
|
|
33
43
|
};
|
|
@@ -1,13 +1,16 @@
|
|
|
1
|
-
import { jsx
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import * as RadixTabs from "@radix-ui/react-tabs";
|
|
3
3
|
import React from "react";
|
|
4
4
|
import { tv } from "tailwind-variants";
|
|
5
5
|
const tabItemStyles = tv({});
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
6
|
+
const TabItem = (props) => {
|
|
7
|
+
return /* @__PURE__ */ jsx(RadixTabs.Content, { value: props.value, className: tabItemStyles(props), children: React.Children.map(props.children, (child, index) => {
|
|
8
|
+
if (React.isValidElement(child)) {
|
|
9
|
+
return React.cloneElement(child, { key: props.value || index });
|
|
10
|
+
}
|
|
11
|
+
return child;
|
|
12
|
+
}) });
|
|
13
|
+
};
|
|
14
|
+
export {
|
|
15
|
+
TabItem
|
|
13
16
|
};
|
|
@@ -1,67 +1,82 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
2
|
import * as RadixTabs from "@radix-ui/react-tabs";
|
|
3
3
|
import React from "react";
|
|
4
4
|
import { tv } from "tailwind-variants";
|
|
5
|
-
import { Label } from "../typography/Label";
|
|
5
|
+
import { Label } from "../typography/Label.js";
|
|
6
6
|
const tabStyles = tv({
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
slots: {
|
|
8
|
+
list: ["bg-slate-200", "rounded-lg", "p-1", "flex", "gap-2", "group"],
|
|
9
|
+
trigger: ["pt-2", "pb-2", "pr-3", "pl-3", "rounded-md"]
|
|
10
|
+
},
|
|
11
|
+
variants: {
|
|
12
|
+
selected: {
|
|
13
|
+
false: {
|
|
14
|
+
trigger: ["bg-slate-200", "group-hover:text-slate-800"]
|
|
15
|
+
},
|
|
16
|
+
true: {
|
|
17
|
+
trigger: ["bg-white", "text-violet-600"]
|
|
18
|
+
}
|
|
10
19
|
},
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
},
|
|
20
|
+
effect: {
|
|
21
|
+
first: {},
|
|
22
|
+
middle: {},
|
|
23
|
+
last: {}
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
compoundVariants: [
|
|
27
|
+
{
|
|
28
|
+
selected: true,
|
|
29
|
+
effect: "first",
|
|
30
|
+
class: {
|
|
31
|
+
trigger: ["group-hover:pr-6"]
|
|
32
|
+
}
|
|
25
33
|
},
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
{
|
|
42
|
-
selected: true,
|
|
43
|
-
effect: "last",
|
|
44
|
-
class: {
|
|
45
|
-
trigger: ["group-hover:pl-6"],
|
|
46
|
-
},
|
|
47
|
-
},
|
|
48
|
-
],
|
|
34
|
+
{
|
|
35
|
+
selected: true,
|
|
36
|
+
effect: "middle",
|
|
37
|
+
class: {
|
|
38
|
+
trigger: ["group-hover:pr-6", "group-hover:pl-6"]
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
selected: true,
|
|
43
|
+
effect: "last",
|
|
44
|
+
class: {
|
|
45
|
+
trigger: ["group-hover:pl-6"]
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
]
|
|
49
49
|
});
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
50
|
+
const Tabs = (props) => {
|
|
51
|
+
const { list, trigger } = tabStyles(props);
|
|
52
|
+
const [currentSelection, setSelection] = React.useState(props.value);
|
|
53
|
+
const getEffectVariant = (index, max) => index === 0 ? "first" : max === index ? "last" : "middle";
|
|
54
|
+
const onClick = (value) => {
|
|
55
|
+
setSelection(value);
|
|
56
|
+
props.onChange?.(value);
|
|
57
|
+
};
|
|
58
|
+
return /* @__PURE__ */ jsxs(RadixTabs.Root, { defaultValue: props.value, children: [
|
|
59
|
+
/* @__PURE__ */ jsx(RadixTabs.List, { className: list(), children: props.children.map((child, index) => /* @__PURE__ */ jsx(
|
|
60
|
+
RadixTabs.Trigger,
|
|
61
|
+
{
|
|
62
|
+
value: child.props.value,
|
|
63
|
+
className: trigger({
|
|
64
|
+
selected: child.props.value === currentSelection,
|
|
65
|
+
effect: getEffectVariant(index, props.children.length - 1)
|
|
66
|
+
}),
|
|
67
|
+
onClick: () => onClick(child.props.value),
|
|
68
|
+
children: /* @__PURE__ */ jsx(Label, { size: "lg", children: child.props.label })
|
|
69
|
+
},
|
|
70
|
+
child.props.value
|
|
71
|
+
)) }),
|
|
72
|
+
React.Children.map(props.children, (child, index) => {
|
|
73
|
+
if (React.isValidElement(child)) {
|
|
74
|
+
return React.cloneElement(child, { key: props.value || index });
|
|
75
|
+
}
|
|
76
|
+
return child;
|
|
77
|
+
})
|
|
78
|
+
] });
|
|
79
|
+
};
|
|
80
|
+
export {
|
|
81
|
+
Tabs
|
|
67
82
|
};
|
|
@@ -1,15 +1,18 @@
|
|
|
1
|
-
import { jsx
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { tv } from "tailwind-variants";
|
|
3
|
-
import { Label } from "../typography/Label";
|
|
3
|
+
import { Label } from "../typography/Label.js";
|
|
4
4
|
const textLinkStyles = tv({
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
5
|
+
base: [
|
|
6
|
+
"text-violet-600",
|
|
7
|
+
"underline",
|
|
8
|
+
"decoration-violet-600",
|
|
9
|
+
"underline-offset-2",
|
|
10
|
+
"hover:decoration-violet-200"
|
|
11
|
+
]
|
|
12
12
|
});
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
const TextLink = (props) => {
|
|
14
|
+
return /* @__PURE__ */ jsx(Label, { size: "sm", as: "span", children: /* @__PURE__ */ jsx("a", { href: props.href, className: textLinkStyles(props), children: props.children }) });
|
|
15
|
+
};
|
|
16
|
+
export {
|
|
17
|
+
TextLink
|
|
15
18
|
};
|