@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.
Files changed (180) hide show
  1. package/dist/assets/fallback.png.js +4 -0
  2. package/dist/cm-designsystem.css +1944 -1
  3. package/dist/components/accessible-button/AccessibleButton.js +29 -11
  4. package/dist/components/avatar/Avatar.js +91 -65
  5. package/dist/components/branding/BrandingGallery.js +212 -145
  6. package/dist/components/branding/app-icon-gradient.svg.js +4 -0
  7. package/dist/components/branding/app-icon-white.svg.js +4 -0
  8. package/dist/components/branding/hover-logo-default.svg.js +4 -0
  9. package/dist/components/branding/hover-logo-hovered.svg.js +4 -0
  10. package/dist/components/branding/logo-inline-gradient.svg.js +4 -0
  11. package/dist/components/branding/logo-inline-violet.svg.js +4 -0
  12. package/dist/components/branding/logo-inline-white.svg.js +4 -0
  13. package/dist/components/branding/logo-stacked-gradient.svg.js +4 -0
  14. package/dist/components/branding/logo-stacked-violet.svg.js +4 -0
  15. package/dist/components/branding/logo-stacked-white.svg.js +4 -0
  16. package/dist/components/branding/superzeichen.svg.js +4 -0
  17. package/dist/components/button/Button.js +61 -55
  18. package/dist/components/color/ColorDoc.js +26 -7
  19. package/dist/components/file-upload/FileUpload.js +129 -66
  20. package/dist/components/form/Form.js +33 -26
  21. package/dist/components/icon-button/IconButton.js +33 -29
  22. package/dist/components/icons/IconBase.js +21 -6
  23. package/dist/components/icons/generated/ArrowDown.js +15 -4
  24. package/dist/components/icons/generated/ArrowLeft.js +15 -4
  25. package/dist/components/icons/generated/ArrowRight.js +15 -4
  26. package/dist/components/icons/generated/ArrowUp.js +15 -4
  27. package/dist/components/icons/generated/Calendar.js +15 -4
  28. package/dist/components/icons/generated/Cancel.js +12 -4
  29. package/dist/components/icons/generated/Checkmark.js +12 -4
  30. package/dist/components/icons/generated/Edit.js +9 -4
  31. package/dist/components/icons/generated/Eye.js +15 -4
  32. package/dist/components/icons/generated/Fullscreen.js +9 -4
  33. package/dist/components/icons/generated/HeartFilled.js +15 -4
  34. package/dist/components/icons/generated/HeartOutline.js +15 -4
  35. package/dist/components/icons/generated/Location.js +15 -4
  36. package/dist/components/icons/generated/LogOut.js +12 -4
  37. package/dist/components/icons/generated/Mumble.js +13 -4
  38. package/dist/components/icons/generated/Profile.js +12 -4
  39. package/dist/components/icons/generated/ReplyFilled.js +15 -4
  40. package/dist/components/icons/generated/ReplyOutline.js +15 -4
  41. package/dist/components/icons/generated/Repost.js +15 -4
  42. package/dist/components/icons/generated/Send.js +15 -4
  43. package/dist/components/icons/generated/Settings.js +15 -4
  44. package/dist/components/icons/generated/Share.js +12 -4
  45. package/dist/components/icons/generated/Time.js +12 -4
  46. package/dist/components/icons/generated/Upload.js +21 -4
  47. package/dist/components/input/Input.js +67 -41
  48. package/dist/components/like-toggle/LikeToggle.js +203 -176
  49. package/dist/components/logo-link/LogoLink.js +56 -34
  50. package/dist/components/modal/Modal.js +66 -50
  51. package/dist/components/navi-button/NaviButton.js +42 -30
  52. package/dist/components/navi-user-button/NaviUserButton.js +39 -29
  53. package/dist/components/round-button/RoundButton.js +39 -29
  54. package/dist/components/tabs/TabItem.js +11 -8
  55. package/dist/components/tabs/Tabs.js +74 -59
  56. package/dist/components/text-link/TextLink.js +14 -11
  57. package/dist/components/textarea/Textarea.js +57 -41
  58. package/dist/components/timed-button/TimedButton.js +116 -102
  59. package/dist/components/toggle/Toggle.js +91 -62
  60. package/dist/components/typography/AccessibleTypography.js +12 -9
  61. package/dist/components/typography/Heading.js +13 -9
  62. package/dist/components/typography/Label.js +13 -9
  63. package/dist/components/typography/Paragraph.js +13 -9
  64. package/dist/components/typography/Placeholder.js +13 -9
  65. package/dist/components/typography/ValidationMessage.js +14 -9
  66. package/dist/components/typography/styles.js +53 -46
  67. package/dist/compositions/image-banner/ImageBanner.js +53 -45
  68. package/dist/compositions/image-upload-modal/ImageUploadModal.js +44 -20
  69. package/dist/compositions/post/Post.js +81 -26
  70. package/dist/compositions/post-base/PostBase.js +23 -24
  71. package/dist/compositions/post-creator/PostCreator.js +72 -24
  72. package/dist/compositions/profile-banner/ProfileBanner.js +71 -21
  73. package/dist/compositions/profile-banner-image/ProfileBannerImage.js +60 -52
  74. package/dist/compositions/profile-banner-info/ProfileBannerInfo.js +72 -40
  75. package/dist/compositions/response/Response.js +63 -19
  76. package/dist/compositions/response-creator/ResponseCreator.js +67 -23
  77. package/dist/compositions/user-info/UserInfo.js +71 -52
  78. package/dist/compositions/user-recommendation/UserRecommendation.js +58 -30
  79. package/dist/index.js +129 -4
  80. package/package.json +14 -12
  81. package/dist/components/accessible-button/AccessibleButton.d.ts +0 -32
  82. package/dist/components/accessible-button/AccessibleButton.test.d.ts +0 -1
  83. package/dist/components/accessible-button/AccessibleButton.test.js +0 -28
  84. package/dist/components/avatar/Avatar.d.ts +0 -118
  85. package/dist/components/branding/BrandingGallery.d.ts +0 -1
  86. package/dist/components/button/Button.d.ts +0 -66
  87. package/dist/components/button/Button.test.d.ts +0 -1
  88. package/dist/components/button/Button.test.js +0 -30
  89. package/dist/components/color/ColorDoc.d.ts +0 -4
  90. package/dist/components/file-upload/FileUpload.d.ts +0 -83
  91. package/dist/components/form/Form.d.ts +0 -54
  92. package/dist/components/icon-button/IconButton.d.ts +0 -69
  93. package/dist/components/icon-button/IconButton.test.d.ts +0 -1
  94. package/dist/components/icon-button/IconButton.test.js +0 -22
  95. package/dist/components/icons/IconBase.d.ts +0 -5
  96. package/dist/components/icons/generated/ArrowDown.d.ts +0 -3
  97. package/dist/components/icons/generated/ArrowLeft.d.ts +0 -3
  98. package/dist/components/icons/generated/ArrowRight.d.ts +0 -3
  99. package/dist/components/icons/generated/ArrowUp.d.ts +0 -3
  100. package/dist/components/icons/generated/Calendar.d.ts +0 -3
  101. package/dist/components/icons/generated/Cancel.d.ts +0 -3
  102. package/dist/components/icons/generated/Checkmark.d.ts +0 -3
  103. package/dist/components/icons/generated/Edit.d.ts +0 -3
  104. package/dist/components/icons/generated/Eye.d.ts +0 -3
  105. package/dist/components/icons/generated/Fullscreen.d.ts +0 -3
  106. package/dist/components/icons/generated/HeartFilled.d.ts +0 -3
  107. package/dist/components/icons/generated/HeartOutline.d.ts +0 -3
  108. package/dist/components/icons/generated/Location.d.ts +0 -3
  109. package/dist/components/icons/generated/LogOut.d.ts +0 -3
  110. package/dist/components/icons/generated/Mumble.d.ts +0 -3
  111. package/dist/components/icons/generated/Profile.d.ts +0 -3
  112. package/dist/components/icons/generated/ReplyFilled.d.ts +0 -3
  113. package/dist/components/icons/generated/ReplyOutline.d.ts +0 -3
  114. package/dist/components/icons/generated/Repost.d.ts +0 -3
  115. package/dist/components/icons/generated/Send.d.ts +0 -3
  116. package/dist/components/icons/generated/Settings.d.ts +0 -3
  117. package/dist/components/icons/generated/Share.d.ts +0 -3
  118. package/dist/components/icons/generated/Time.d.ts +0 -3
  119. package/dist/components/icons/generated/Upload.d.ts +0 -3
  120. package/dist/components/icons/generated/index.d.ts +0 -24
  121. package/dist/components/icons/generated/index.js +0 -24
  122. package/dist/components/index.d.ts +0 -27
  123. package/dist/components/index.js +0 -27
  124. package/dist/components/input/Input.d.ts +0 -61
  125. package/dist/components/like-toggle/LikeToggle.d.ts +0 -97
  126. package/dist/components/like-toggle/LikeToggle.test.d.ts +0 -1
  127. package/dist/components/like-toggle/LikeToggle.test.js +0 -35
  128. package/dist/components/logo-link/LogoLink.d.ts +0 -11
  129. package/dist/components/modal/Modal.d.ts +0 -75
  130. package/dist/components/modal/Modal.test.d.ts +0 -1
  131. package/dist/components/modal/Modal.test.js +0 -24
  132. package/dist/components/navi-button/NaviButton.d.ts +0 -49
  133. package/dist/components/navi-button/NaviButton.test.d.ts +0 -1
  134. package/dist/components/navi-button/NaviButton.test.js +0 -22
  135. package/dist/components/navi-user-button/NaviUserButton.d.ts +0 -44
  136. package/dist/components/round-button/RoundButton.d.ts +0 -44
  137. package/dist/components/round-button/RoundButton.test.d.ts +0 -1
  138. package/dist/components/round-button/RoundButton.test.js +0 -22
  139. package/dist/components/tabs/TabItem.d.ts +0 -11
  140. package/dist/components/tabs/Tabs.d.ts +0 -67
  141. package/dist/components/tabs/Tabs.test.d.ts +0 -1
  142. package/dist/components/tabs/Tabs.test.js +0 -61
  143. package/dist/components/text-link/TextLink.d.ts +0 -9
  144. package/dist/components/text-link/TextLink.test.d.ts +0 -1
  145. package/dist/components/text-link/TextLink.test.js +0 -14
  146. package/dist/components/textarea/Textarea.d.ts +0 -48
  147. package/dist/components/timed-button/TimedButton.d.ts +0 -79
  148. package/dist/components/timed-button/TimedButton.test.d.ts +0 -1
  149. package/dist/components/timed-button/TimedButton.test.js +0 -36
  150. package/dist/components/toggle/Toggle.d.ts +0 -62
  151. package/dist/components/toggle/Toggle.test.d.ts +0 -1
  152. package/dist/components/toggle/Toggle.test.js +0 -93
  153. package/dist/components/typography/AccessibleTypography.d.ts +0 -33
  154. package/dist/components/typography/Heading.d.ts +0 -24
  155. package/dist/components/typography/Label.d.ts +0 -22
  156. package/dist/components/typography/Paragraph.d.ts +0 -22
  157. package/dist/components/typography/Placeholder.d.ts +0 -17
  158. package/dist/components/typography/ValidationMessage.d.ts +0 -22
  159. package/dist/components/typography/styles.d.ts +0 -74
  160. package/dist/compositions/image-banner/ImageBanner.d.ts +0 -54
  161. package/dist/compositions/image-upload-modal/ImageUploadModal.d.ts +0 -15
  162. package/dist/compositions/index.d.ts +0 -11
  163. package/dist/compositions/index.js +0 -11
  164. package/dist/compositions/post/Post.d.ts +0 -75
  165. package/dist/compositions/post-base/PostBase.d.ts +0 -41
  166. package/dist/compositions/post-creator/PostCreator.d.ts +0 -69
  167. package/dist/compositions/profile-banner/ProfileBanner.d.ts +0 -82
  168. package/dist/compositions/profile-banner-image/ProfileBannerImage.d.ts +0 -54
  169. package/dist/compositions/profile-banner-info/ProfileBannerInfo.d.ts +0 -92
  170. package/dist/compositions/response/Response.d.ts +0 -75
  171. package/dist/compositions/response-creator/ResponseCreator.d.ts +0 -63
  172. package/dist/compositions/user-info/UserInfo.d.ts +0 -75
  173. package/dist/compositions/user-recommendation/UserRecommendation.d.ts +0 -63
  174. package/dist/favicon.svg +0 -18
  175. package/dist/index.cjs.js +0 -50
  176. package/dist/index.d.ts +0 -3
  177. package/dist/index.es.js +0 -8343
  178. package/dist/logo-inline-gradient.svg +0 -43
  179. package/dist/setupTests.d.ts +0 -1
  180. package/dist/setupTests.js +0 -7
@@ -1,75 +0,0 @@
1
- import React from "react";
2
- import { type VariantProps } from "tailwind-variants";
3
- declare const modalStyles: import("tailwind-variants").TVReturnType<{
4
- [key: string]: {
5
- [key: string]: import("tailwind-merge").ClassNameValue | {
6
- title?: import("tailwind-merge").ClassNameValue;
7
- content?: import("tailwind-merge").ClassNameValue;
8
- container?: import("tailwind-merge").ClassNameValue;
9
- overlay?: import("tailwind-merge").ClassNameValue;
10
- actions?: import("tailwind-merge").ClassNameValue;
11
- };
12
- };
13
- } | {
14
- [x: string]: {
15
- [x: string]: import("tailwind-merge").ClassNameValue | {
16
- title?: import("tailwind-merge").ClassNameValue;
17
- content?: import("tailwind-merge").ClassNameValue;
18
- container?: import("tailwind-merge").ClassNameValue;
19
- overlay?: import("tailwind-merge").ClassNameValue;
20
- actions?: import("tailwind-merge").ClassNameValue;
21
- };
22
- };
23
- } | {}, {
24
- overlay: string[];
25
- content: string[];
26
- title: string[];
27
- container: string[];
28
- actions: string[];
29
- }, undefined, {
30
- [key: string]: {
31
- [key: string]: import("tailwind-merge").ClassNameValue | {
32
- title?: import("tailwind-merge").ClassNameValue;
33
- content?: import("tailwind-merge").ClassNameValue;
34
- container?: import("tailwind-merge").ClassNameValue;
35
- overlay?: import("tailwind-merge").ClassNameValue;
36
- actions?: import("tailwind-merge").ClassNameValue;
37
- };
38
- };
39
- } | {}, {
40
- overlay: string[];
41
- content: string[];
42
- title: string[];
43
- container: string[];
44
- actions: string[];
45
- }, import("tailwind-variants").TVReturnType<unknown, {
46
- overlay: string[];
47
- content: string[];
48
- title: string[];
49
- container: string[];
50
- actions: string[];
51
- }, undefined, unknown, unknown, undefined>>;
52
- type ModalVariants = VariantProps<typeof modalStyles>;
53
- interface ModalProps extends ModalVariants {
54
- title: string;
55
- open: boolean;
56
- onOpenChange: (isOpen: boolean) => void;
57
- children: React.ReactNode;
58
- }
59
- export declare const Modal: React.FC<ModalProps> & {
60
- Body: typeof ModalBody;
61
- Actions: typeof ModalActions;
62
- };
63
- export declare function ModalBody({ children }: {
64
- children: React.ReactNode;
65
- }): React.ReactNode;
66
- export declare namespace ModalBody {
67
- var displayName: string;
68
- }
69
- export declare function ModalActions({ children }: {
70
- children: React.ReactNode;
71
- }): React.ReactNode;
72
- export declare namespace ModalActions {
73
- var displayName: string;
74
- }
75
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1,24 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { render, screen } from "@testing-library/react";
3
- import { describe, expect, test } from "vitest";
4
- import { Button } from "../button/Button";
5
- import { Cancel, Checkmark } from "../icons/generated";
6
- import { Modal } from "./Modal";
7
- describe("Modal", () => {
8
- test("should open modal", async () => {
9
- // Arrange
10
- render(_jsx("div", { children: _jsxs(Modal, { open: true, onOpenChange: () => { }, title: "Modal", children: [_jsx(Modal.Body, { children: "Body" }), _jsxs(Modal.Actions, { children: [_jsx(Button, { intent: "primary", size: "md", onClick: () => { }, icon: Cancel, children: "Exit" }), _jsx(Button, { intent: "secondary", size: "md", onClick: () => { }, icon: Checkmark, children: "Save" })] })] }) }));
11
- // Assert
12
- expect(screen.getByRole("dialog")).toBeVisible();
13
- expect(screen.getByText(/body/i)).toBeVisible();
14
- expect(screen.getByText(/modal/i)).toBeVisible();
15
- expect(screen.getByRole("button", { name: /exit/i })).toBeVisible();
16
- expect(screen.getByRole("button", { name: /save/i })).toBeVisible();
17
- });
18
- test("should open modal", async () => {
19
- // Arrange
20
- render(_jsx("div", { children: _jsxs(Modal, { open: false, onOpenChange: () => { }, title: "Modal", children: [_jsx(Modal.Body, { children: "Body" }), _jsxs(Modal.Actions, { children: [_jsx(Button, { intent: "primary", size: "md", onClick: () => { }, icon: Cancel, children: "Exit" }), _jsx(Button, { intent: "secondary", size: "md", onClick: () => { }, icon: Checkmark, children: "Save" })] })] }) }));
21
- // Assert
22
- expect(screen.queryByRole("dialog")).not.toBeInTheDocument();
23
- });
24
- });
@@ -1,49 +0,0 @@
1
- import React from "react";
2
- import { type VariantProps } from "tailwind-variants";
3
- import { type BaseAccessibleButtonProps } from "../accessible-button/AccessibleButton";
4
- import type { IconBaseProps } from "../icons/IconBase";
5
- declare const naviButtonStyles: import("tailwind-variants").TVReturnType<{
6
- intent: {
7
- secondary: string[];
8
- };
9
- }, undefined, string[], {
10
- intent: {
11
- secondary: string[];
12
- };
13
- }, undefined, import("tailwind-variants").TVReturnType<{
14
- intent: {
15
- secondary: string[];
16
- };
17
- }, undefined, string[], unknown, unknown, undefined>>;
18
- type NaviButtonVariants = VariantProps<typeof naviButtonStyles>;
19
- type NaviButtonIntent = "secondary";
20
- /**
21
- * Props for the NaviButton component.
22
- *
23
- * @inheritdoc BaseAccessibleButtonProps
24
- * @inheritdoc NaviButtonVariants
25
- */
26
- interface NaviButtonProps extends NaviButtonVariants, BaseAccessibleButtonProps {
27
- /**
28
- * Visual intent of the button (controls background color, hover, and active styles).
29
- */
30
- intent?: NaviButtonIntent;
31
- /**
32
- * Optional icon element rendered alongside the button label.
33
- */
34
- icon?: React.ComponentType<IconBaseProps>;
35
- /**
36
- * Optional className applied to the icon element.
37
- */
38
- iconClassName?: string;
39
- /**
40
- * Visible text label displayed inside the button.
41
- */
42
- children: string;
43
- }
44
- /**
45
- * A navigation-style button component that combines an accessible,
46
- * keyboard-friendly button foundation with variant-based styling.
47
- */
48
- export declare const NaviButton: React.FC<NaviButtonProps>;
49
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1,22 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { fireEvent, render, screen } from "@testing-library/react";
3
- import { describe, expect, test, vi } from "vitest";
4
- import { Mumble } from "../icons/generated";
5
- import { NaviButton } from "./NaviButton";
6
- describe("NaviButton", () => {
7
- test("should render button with icon", async () => {
8
- // Arrange
9
- render(_jsx(NaviButton, { onClick: vi.fn(), icon: Mumble, children: "button" }));
10
- // Assert
11
- expect(screen.getByRole("button")).toBeVisible();
12
- expect(screen.getByRole("button")).toHaveTextContent("button");
13
- expect(screen.getByText("Mumble")).toBeVisible();
14
- });
15
- test("should call onClick when clicked", () => {
16
- // Arrange
17
- const onClick = vi.fn();
18
- render(_jsx(NaviButton, { onClick: onClick, icon: Mumble, children: "button" }));
19
- fireEvent.click(screen.getByRole("button"));
20
- expect(onClick).toHaveBeenCalled();
21
- });
22
- });
@@ -1,44 +0,0 @@
1
- import { type VariantProps } from "tailwind-variants";
2
- import { type BaseAccessibleButtonProps } from "../accessible-button/AccessibleButton";
3
- declare const naviUserButtonStyles: import("tailwind-variants").TVReturnType<{
4
- intent: {
5
- secondary: string[];
6
- };
7
- }, undefined, string[], {
8
- intent: {
9
- secondary: string[];
10
- };
11
- }, undefined, import("tailwind-variants").TVReturnType<{
12
- intent: {
13
- secondary: string[];
14
- };
15
- }, undefined, string[], unknown, unknown, undefined>>;
16
- type NaviUserButtonVariants = VariantProps<typeof naviUserButtonStyles>;
17
- type NaviUserButtonIntent = "secondary";
18
- /**
19
- * Props for the NaviUserButton component.
20
- *
21
- * @inheritdoc BaseAccessibleButtonProps
22
- * @inheritdoc NaviUserButtonVariants
23
- */
24
- interface NaviUserButtonProps extends NaviUserButtonVariants, BaseAccessibleButtonProps {
25
- /**
26
- * Visual intent of the button (controls background color, hover, and active styles).
27
- */
28
- intent?: NaviUserButtonIntent;
29
- /**
30
- * Source URL for the user avatar image.
31
- */
32
- src: string;
33
- /**
34
- * Accessible alt text describing the avatar.
35
- * Required for proper screen reader support.
36
- */
37
- alt: string;
38
- }
39
- /**
40
- * A user-focused navigation button that displays a user avatar and behaves
41
- * like an accessible, keyboard-friendly button.
42
- */
43
- export declare const NaviUserButton: React.FC<NaviUserButtonProps>;
44
- export {};
@@ -1,44 +0,0 @@
1
- import { type VariantProps } from "tailwind-variants";
2
- import { type BaseAccessibleButtonProps } from "../accessible-button/AccessibleButton";
3
- import type { IconBaseProps } from "../icons/IconBase";
4
- declare const roundButtonStyles: import("tailwind-variants").TVReturnType<{
5
- intent: {
6
- primary: string[];
7
- };
8
- }, undefined, string[], {
9
- intent: {
10
- primary: string[];
11
- };
12
- }, undefined, import("tailwind-variants").TVReturnType<{
13
- intent: {
14
- primary: string[];
15
- };
16
- }, undefined, string[], unknown, unknown, undefined>>;
17
- type RoundButtonVariants = VariantProps<typeof roundButtonStyles>;
18
- type RoundButtonIntent = "primary";
19
- /**
20
- * Props for the RoundButton component.
21
- *
22
- * @inheritdoc BaseAccessibleButtonProps
23
- * @inheritdoc RoundButtonVariants
24
- */
25
- interface RoundButtonProps extends RoundButtonVariants, BaseAccessibleButtonProps {
26
- /**
27
- * Visual intent of the button (controls background color, hover, and active styles).
28
- */
29
- intent?: RoundButtonIntent;
30
- /**
31
- * Accessible label for the button, used by screen readers.
32
- */
33
- ariaLabel: string;
34
- /**
35
- * Icon element rendered alongside the button label.
36
- */
37
- icon: React.ComponentType<IconBaseProps>;
38
- }
39
- /**
40
- * A circular, icon-only button component that provides full accessibility,
41
- * keyboard interaction, and visual feedback through hover and active states.
42
- */
43
- export declare const RoundButton: React.FC<RoundButtonProps>;
44
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1,22 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { fireEvent, render, screen } from "@testing-library/react";
3
- import { describe, expect, test, vi } from "vitest";
4
- import { Mumble } from "../icons/generated";
5
- import { RoundButton } from "./RoundButton";
6
- describe("RoundButton", () => {
7
- test("should render button with icon", async () => {
8
- // Arrange
9
- render(_jsx(RoundButton, { onClick: vi.fn(), ariaLabel: "Mumble", icon: Mumble }));
10
- // Assert
11
- expect(screen.getByRole("button")).toBeVisible();
12
- expect(screen.getByLabelText("Mumble")).toBeVisible();
13
- expect(screen.getByText("Mumble")).toBeVisible();
14
- });
15
- test("should call onChange when second tab clicked", () => {
16
- // Arrange
17
- const onClick = vi.fn();
18
- render(_jsx(RoundButton, { onClick: onClick, ariaLabel: "Mumble", icon: Mumble }));
19
- fireEvent.click(screen.getByRole("button"));
20
- expect(onClick).toHaveBeenCalled();
21
- });
22
- });
@@ -1,11 +0,0 @@
1
- import React from "react";
2
- import { type VariantProps } from "tailwind-variants";
3
- declare const tabItemStyles: import("tailwind-variants").TVReturnType<{} | {} | {}, undefined, undefined, {} | {}, undefined, import("tailwind-variants").TVReturnType<unknown, undefined, undefined, unknown, unknown, undefined>>;
4
- type TabItemVariants = VariantProps<typeof tabItemStyles>;
5
- export interface TabItemProps extends TabItemVariants {
6
- value: string;
7
- label: string;
8
- children: React.ReactNode;
9
- }
10
- export declare const TabItem: (props: TabItemProps) => import("react/jsx-runtime").JSX.Element;
11
- export {};
@@ -1,67 +0,0 @@
1
- import React from "react";
2
- import { type VariantProps } from "tailwind-variants";
3
- import type { TabItemProps } from "./TabItem";
4
- declare const tabStyles: import("tailwind-variants").TVReturnType<{
5
- selected: {
6
- false: {
7
- trigger: string[];
8
- };
9
- true: {
10
- trigger: string[];
11
- };
12
- };
13
- effect: {
14
- first: {};
15
- middle: {};
16
- last: {};
17
- };
18
- }, {
19
- list: string[];
20
- trigger: string[];
21
- }, undefined, {
22
- selected: {
23
- false: {
24
- trigger: string[];
25
- };
26
- true: {
27
- trigger: string[];
28
- };
29
- };
30
- effect: {
31
- first: {};
32
- middle: {};
33
- last: {};
34
- };
35
- }, {
36
- list: string[];
37
- trigger: string[];
38
- }, import("tailwind-variants").TVReturnType<{
39
- selected: {
40
- false: {
41
- trigger: string[];
42
- };
43
- true: {
44
- trigger: string[];
45
- };
46
- };
47
- effect: {
48
- first: {};
49
- middle: {};
50
- last: {};
51
- };
52
- }, {
53
- list: string[];
54
- trigger: string[];
55
- }, undefined, unknown, unknown, undefined>>;
56
- type TabVariants = VariantProps<typeof tabStyles>;
57
- export interface TabLabelProps {
58
- value: string;
59
- label: string;
60
- }
61
- export interface TabProps extends TabVariants {
62
- value: string;
63
- onChange?: (value: string) => void;
64
- children: React.ReactElement<TabItemProps>[];
65
- }
66
- export declare const Tabs: (props: TabProps) => import("react/jsx-runtime").JSX.Element;
67
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1,61 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { fireEvent, render, screen } from "@testing-library/react";
3
- import { describe, expect, test, vi } from "vitest";
4
- import { TabItem } from "./TabItem";
5
- import { Tabs } from "./Tabs";
6
- describe("Tabs", () => {
7
- test("should render three tabs", async () => {
8
- // Arrange
9
- render(_jsxs(Tabs, { value: "1", children: [_jsx(TabItem, { label: "tab1", value: "1", children: "tabItem1" }), _jsx(TabItem, { label: "tab2", value: "2", children: "tabItem2" }), _jsx(TabItem, { label: "tab3", value: "3", children: "tabItem3" })] }));
10
- // Assert
11
- expect(screen.getByRole("tab", { name: /tab1/i })).toBeVisible();
12
- expect(screen.getByRole("tab", { name: /tab2/i })).toBeVisible();
13
- expect(screen.getByRole("tab", { name: /tab3/i })).toBeVisible();
14
- const tabItem1 = screen.getByRole("tabpanel", {
15
- name: /tab1/i,
16
- });
17
- expect(tabItem1).toBeVisible();
18
- expect(tabItem1).toHaveTextContent(/tabItem1/i);
19
- const tabItems = screen
20
- .getAllByRole("tabpanel", { hidden: true })
21
- .filter((el) => el.hasAttribute("hidden"));
22
- expect(tabItems.length).toBe(2);
23
- });
24
- test("should render first tab as selected when value = 1 is set", async () => {
25
- // Arrange
26
- render(_jsxs(Tabs, { value: "1", children: [_jsx(TabItem, { label: "tab1", value: "1", children: "tabItem1" }), _jsx(TabItem, { label: "tab2", value: "2", children: "tabItem2" }), _jsx(TabItem, { label: "tab3", value: "3", children: "tabItem3" })] }));
27
- // Assert
28
- const tabItem1 = screen.getByRole("tabpanel", {
29
- name: /tab1/i,
30
- });
31
- expect(tabItem1).toBeVisible();
32
- expect(tabItem1).toHaveTextContent(/tabItem1/i);
33
- expect(tabItem1).not.toHaveAttribute("hidden");
34
- const tabItems = screen
35
- .getAllByRole("tabpanel", { hidden: true })
36
- .filter((el) => el.hasAttribute("hidden"));
37
- expect(tabItems.length).toBe(2);
38
- });
39
- test("should render second tab as selected when value = 2 is set", async () => {
40
- // Arrange
41
- render(_jsxs(Tabs, { value: "2", children: [_jsx(TabItem, { label: "tab1", value: "1", children: "tabItem1" }), _jsx(TabItem, { label: "tab2", value: "2", children: "tabItem2" }), _jsx(TabItem, { label: "tab3", value: "3", children: "tabItem3" })] }));
42
- // Assert
43
- const tabItem2 = screen.getByRole("tabpanel", {
44
- name: /tab2/i,
45
- });
46
- expect(tabItem2).toBeVisible();
47
- expect(tabItem2).toHaveTextContent(/tabItem2/i);
48
- expect(tabItem2).not.toHaveAttribute("hidden");
49
- const tabItems = screen
50
- .getAllByRole("tabpanel", { hidden: true })
51
- .filter((el) => el.hasAttribute("hidden"));
52
- expect(tabItems.length).toBe(2);
53
- });
54
- test("should call onChange when second tab clicked", () => {
55
- // Arrange
56
- const onValueChange = vi.fn();
57
- render(_jsxs(Tabs, { value: "2", onChange: onValueChange, children: [_jsx(TabItem, { label: "tab1", value: "1", children: "tabItem1" }), _jsx(TabItem, { label: "tab2", value: "2", children: "tabItem2" }), _jsx(TabItem, { label: "tab3", value: "3", children: "tabItem3" })] }));
58
- fireEvent.click(screen.getByRole("tab", { name: /tab2/i }));
59
- expect(onValueChange).toHaveBeenCalledWith("2");
60
- });
61
- });
@@ -1,9 +0,0 @@
1
- import { type VariantProps } from "tailwind-variants";
2
- declare const textLinkStyles: import("tailwind-variants").TVReturnType<{} | {} | {}, undefined, string[], {} | {}, undefined, import("tailwind-variants").TVReturnType<unknown, undefined, string[], unknown, unknown, undefined>>;
3
- type TextLinkVariants = VariantProps<typeof textLinkStyles>;
4
- interface TextLinkProps extends TextLinkVariants {
5
- href: string;
6
- children: React.ReactNode;
7
- }
8
- export declare const TextLink: (props: TextLinkProps) => import("react/jsx-runtime").JSX.Element;
9
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1,14 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { render, screen } from "@testing-library/react";
3
- import { describe, expect, test } from "vitest";
4
- import { TextLink } from "./TextLink";
5
- describe("Text Link", () => {
6
- test("should render three tabs", async () => {
7
- // Arrange
8
- render(_jsx(TextLink, { href: "https://example.com", children: "Example Link" }));
9
- // Assert
10
- const link = screen.getByRole("link");
11
- expect(link).toBeVisible();
12
- expect(link).toHaveAttribute("href", "https://example.com");
13
- });
14
- });
@@ -1,48 +0,0 @@
1
- import { type VariantProps } from "tailwind-variants";
2
- declare const textareaStyles: import("tailwind-variants").TVReturnType<{
3
- [key: string]: {
4
- [key: string]: import("tailwind-merge").ClassNameValue | {
5
- base?: import("tailwind-merge").ClassNameValue;
6
- control?: import("tailwind-merge").ClassNameValue;
7
- message?: import("tailwind-merge").ClassNameValue;
8
- };
9
- };
10
- } | {
11
- [x: string]: {
12
- [x: string]: import("tailwind-merge").ClassNameValue | {
13
- base?: import("tailwind-merge").ClassNameValue;
14
- control?: import("tailwind-merge").ClassNameValue;
15
- message?: import("tailwind-merge").ClassNameValue;
16
- };
17
- };
18
- } | {}, {
19
- base: string[];
20
- control: string[];
21
- message: string[];
22
- }, undefined, {
23
- [key: string]: {
24
- [key: string]: import("tailwind-merge").ClassNameValue | {
25
- base?: import("tailwind-merge").ClassNameValue;
26
- control?: import("tailwind-merge").ClassNameValue;
27
- message?: import("tailwind-merge").ClassNameValue;
28
- };
29
- };
30
- } | {}, {
31
- base: string[];
32
- control: string[];
33
- message: string[];
34
- }, import("tailwind-variants").TVReturnType<unknown, {
35
- base: string[];
36
- control: string[];
37
- message: string[];
38
- }, undefined, unknown, unknown, undefined>>;
39
- type TextareaVariants = VariantProps<typeof textareaStyles>;
40
- interface TextareaProps extends TextareaVariants {
41
- name: string;
42
- placeholder: string;
43
- label?: string;
44
- isRequired?: boolean;
45
- onChange: (value: string) => void;
46
- }
47
- export declare const Textarea: ({ isRequired, ...props }: TextareaProps) => import("react/jsx-runtime").JSX.Element;
48
- export {};
@@ -1,79 +0,0 @@
1
- import { type VariantProps } from "tailwind-variants";
2
- import { type BaseAccessibleButtonProps } from "../accessible-button/AccessibleButton";
3
- import type { IconBaseProps } from "../icons/IconBase";
4
- declare const timedButtonStyles: import("tailwind-variants").TVReturnType<{
5
- pressed: {
6
- false: {};
7
- true: {
8
- base: string[];
9
- };
10
- };
11
- animating: {
12
- true: {};
13
- false: {};
14
- };
15
- }, {
16
- base: string[];
17
- icon: string[];
18
- label: string[];
19
- }, undefined, {
20
- pressed: {
21
- false: {};
22
- true: {
23
- base: string[];
24
- };
25
- };
26
- animating: {
27
- true: {};
28
- false: {};
29
- };
30
- }, {
31
- base: string[];
32
- icon: string[];
33
- label: string[];
34
- }, import("tailwind-variants").TVReturnType<{
35
- pressed: {
36
- false: {};
37
- true: {
38
- base: string[];
39
- };
40
- };
41
- animating: {
42
- true: {};
43
- false: {};
44
- };
45
- }, {
46
- base: string[];
47
- icon: string[];
48
- label: string[];
49
- }, undefined, unknown, unknown, undefined>>;
50
- type TimedButtonVariants = VariantProps<typeof timedButtonStyles>;
51
- /**
52
- * Props for the TimedButton component.
53
- *
54
- * @inheritdoc BaseAccessibleButtonProps
55
- * @inheritdoc TimedButtonVariants
56
- */
57
- interface TimedButtonProps extends TimedButtonVariants, BaseAccessibleButtonProps {
58
- /**
59
- * Optional icon element rendered alongside the button label.
60
- */
61
- icon?: React.ComponentType<IconBaseProps>;
62
- /**
63
- * Default label displayed on the button.
64
- *
65
- * This is the visible text before the button is clicked or activated.
66
- */
67
- label: string;
68
- /**
69
- * Active label displayed temporarily after the button is clicked.
70
- *
71
- * Typically used to show feedback, e.g., `"Link copied!"`.
72
- */
73
- labelActive: string;
74
- }
75
- /**
76
- * A button component that temporarily changes its label when pressed.
77
- */
78
- export declare const TimedButton: React.FC<TimedButtonProps>;
79
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1,36 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { fireEvent, render, screen, waitFor } from "@testing-library/react";
3
- import { describe, expect, test, vi } from "vitest";
4
- import { Share } from "../icons/generated";
5
- import { TimedButton } from "./TimedButton";
6
- describe("TimedButton", () => {
7
- test("should render icon and label", async () => {
8
- // Arrange
9
- render(_jsx(TimedButton, { onClick: function () { }, icon: Share, label: "Copy Link", labelActive: "Link Copied" }));
10
- const button = screen.getByRole("button");
11
- expect(button).toBeVisible();
12
- expect(button).toHaveTextContent("Copy Link");
13
- // Icon prüfen
14
- expect(screen.getByText("Share")).toBeInTheDocument();
15
- });
16
- test("renders initial state and toggles correctly", async () => {
17
- // Arrange
18
- const onClick = vi.fn();
19
- render(_jsx(TimedButton, { onClick: onClick, icon: Share, label: "Copy Link", labelActive: "Link Copied" }));
20
- const button = screen.getByRole("button");
21
- expect(button).toBeVisible();
22
- // Initial state with Likes
23
- expect(button).toHaveTextContent("Copy Link");
24
- expect(screen.getByText("Share")).toBeInTheDocument();
25
- // Simulate click
26
- fireEvent.click(button);
27
- // Immediate state after click: "Liked" label + HeartFilled
28
- expect(button).toHaveTextContent("Link Copied");
29
- expect(screen.getByText("Share")).toBeInTheDocument();
30
- expect(onClick).toHaveBeenCalled();
31
- // Wait for animation + likes count update (1s delay + 350ms animation)
32
- await waitFor(() => {
33
- expect(button).toHaveTextContent("Copy Link");
34
- }, { timeout: 1500 });
35
- });
36
- });