@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.
Files changed (179) 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 -11
  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.d.ts +0 -3
  176. package/dist/index.es.js +0 -8343
  177. package/dist/logo-inline-gradient.svg +0 -43
  178. package/dist/setupTests.d.ts +0 -1
  179. package/dist/setupTests.js +0 -7
@@ -1,48 +1,64 @@
1
1
  "use client";
2
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
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
- 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
- },
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
- export const Textarea = ({ isRequired = false, ...props }) => {
43
- const { base, control, message } = textareaStyles({
44
- ...props,
45
- });
46
- const [value, setValue] = useState("");
47
- return (_jsxs(RadixForm.Field, { name: props.name, className: base(props), children: [props.label && (_jsx(RadixForm.Label, { children: _jsx(Label, { size: "md", children: props.label }) })), _jsx(RadixForm.Control, { asChild: true, children: _jsx("textarea", { className: control(props), required: isRequired, placeholder: props.placeholder, onChange: (e) => setValue(e.target.value), onBlur: () => props.onChange(value) }) }), _jsx("div", { className: message(props), children: isRequired && (_jsx(RadixForm.Message, { match: "valueMissing", children: _jsx(ValidationMessage, { children: `${props.name} is required` }) })) })] }));
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 { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useEffect, useRef, useState } from "react";
3
- import { cn, tv } from "tailwind-variants";
4
- import { AccessibleButton, } from "../accessible-button/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
- 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"],
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
- variants: {
29
- pressed: {
30
- false: {},
31
- true: {
32
- base: ["bg-slate-100"],
33
- },
34
- },
35
- animating: {
36
- true: {},
37
- false: {},
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
- compoundVariants: [
41
- {
42
- pressed: true,
43
- animating: true,
44
- class: {
45
- label: ["opacity-0"],
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
- * A button component that temporarily changes its label when pressed.
77
- */
78
- export const TimedButton = ({ className, onClick, ...props }) => {
79
- const [pressed, setPressed] = useState(false);
80
- const [animating, setAnimating] = useState(false);
81
- const timeoutsRef = useRef([]);
82
- const { base, icon: iconClass, label: labelClass, } = timedButtonStyles({ pressed, animating });
83
- useEffect(() => {
84
- // Cleanup all timeouts when component unmounts
85
- return () => {
86
- timeoutsRef.current.forEach((timeout) => clearTimeout(timeout));
87
- timeoutsRef.current = [];
88
- };
89
- }, []);
90
- const handleClick = () => {
91
- // Klick -> Pressed
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
- return (_jsxs(AccessibleButton, { className: cn(base(props), className), onClick: handleClick, ...props, children: [props.icon && _jsx(props.icon, { className: iconClass(), "aria-hidden": "true" }), _jsx(Label, { as: "span", size: "md", className: labelClass(), children: pressed ? props.labelActive : props.label })] }));
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 { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
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 { ReplyFilled, ReplyOutline } from "../icons/generated";
6
- import { Label } from "../typography/Label";
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
- slots: {
9
- base: [
10
- "inline-flex",
11
- "items-center",
12
- "justify-center",
13
- "gap-2",
14
- "h-8",
15
- "px-3",
16
- "py-2",
17
- "rounded-full",
18
- "transition-all",
19
- "duration-150",
20
- "ease-in-out",
21
- "focus-visible:outline-none",
22
- "focus-visible:ring-2",
23
- "focus-visible:ring-offset-2",
24
- "disabled:opacity-50",
25
- "disabled:pointer-events-none",
26
- "cursor-pointer",
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
- icon: ["inline-flex"],
29
- label: [],
30
- },
31
- variants: {
32
- pressed: {
33
- true: {
34
- base: ["hover:bg-violet-50", "hover:text-violet-600"],
35
- icon: [
36
- "text-violet-600",
37
- "hover:transition-all",
38
- "hover:duration-300",
39
- "hover:ease-out",
40
- ],
41
- label: [
42
- "text-inherit",
43
- "hover:transition-all",
44
- "hover:duration-300",
45
- "hover:ease-out",
46
- ],
47
- },
48
- false: {
49
- base: ["hover:bg-violet-50", "hover:text-violet-600"],
50
- icon: [
51
- "text-inherit",
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
- export const Toggle = ({ ariaLabel, labelText, pressed = false, onToggle, }) => {
67
- const { base, icon, label: labelSlot } = toggleStyles({ pressed });
68
- return (_jsxs(RadixToggle.Root, { "aria-label": ariaLabel, className: base(), pressed: pressed, onPressedChange: onToggle, children: [_jsx("span", { className: icon(), "aria-hidden": "true", "aria-label": pressed ? "ReplyFilled" : "ReplyOutline", children: pressed ? _jsx(ReplyFilled, {}) : _jsx(ReplyOutline, {}) }), _jsx("span", { className: labelSlot(), children: _jsx(Label, { as: "span", size: "md", children: labelText }) })] }));
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
- * A flexible, semantic, accessible typography component that allows you
4
- * to set the HTML tag and optionally make it clickable.
5
- */
6
- export const AccessibleTypography = (props) => {
7
- return createElement(props.as ?? "span", {
8
- className: props.className,
9
- "aria-label": props.ariaLabel,
10
- }, props.children);
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 as _jsx } from "react/jsx-runtime";
1
+ import { jsx } from "react/jsx-runtime";
2
2
  import { cn } from "tailwind-variants";
3
- import { AccessibleTypography, } from "./AccessibleTypography";
4
- import { headingStyles } from "./styles";
5
- /**
6
- * A semantic, accessible Heading component built on top of the AccessibleTypography component.
7
- */
8
- export const Heading = ({ as, className, ...props }) => {
9
- const styles = cn(headingStyles(props), className);
10
- return _jsx(AccessibleTypography, { as: as, className: styles, ...props });
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 as _jsx } from "react/jsx-runtime";
1
+ import { jsx } from "react/jsx-runtime";
2
2
  import { cn } from "tailwind-variants";
3
- import { AccessibleTypography, } from "./AccessibleTypography";
4
- import { labelStyles } from "./styles";
5
- /**
6
- * A semantic, accessible Label component built on top of the AccessibleTypography component.
7
- */
8
- export const Label = ({ as = "label", className, ...props }) => {
9
- const styles = cn(labelStyles(props), className);
10
- return _jsx(AccessibleTypography, { as: as, className: styles, ...props });
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 as _jsx } from "react/jsx-runtime";
1
+ import { jsx } from "react/jsx-runtime";
2
2
  import { cn } from "tailwind-variants";
3
- import { AccessibleTypography, } from "./AccessibleTypography";
4
- import { paragraphStyles } from "./styles";
5
- /**
6
- * A semantic, accessible Paragraph component built on top of the AccessibleTypography component.
7
- */
8
- export const Paragraph = ({ as = "p", className, ...props }) => {
9
- const styles = cn(paragraphStyles(props), className);
10
- return _jsx(AccessibleTypography, { as: as, className: styles, ...props });
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 as _jsx } from "react/jsx-runtime";
1
+ import { jsx } from "react/jsx-runtime";
2
2
  import { cn } from "tailwind-variants";
3
- import { AccessibleTypography, } from "./AccessibleTypography";
4
- import { placeholderStyles } from "./styles";
5
- /**
6
- * A semantic, accessible Placeholder component built on top of the AccessibleTypography component.
7
- */
8
- export const Placeholder = ({ as = "span", className, ...props }) => {
9
- const styles = cn(placeholderStyles(props), className);
10
- return _jsx(AccessibleTypography, { as: as, className: styles, ...props });
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 as _jsx } from "react/jsx-runtime";
1
+ import { jsx } from "react/jsx-runtime";
2
2
  import { cn } from "tailwind-variants";
3
- import { AccessibleTypography, } from "./AccessibleTypography";
4
- import { validationMessageStyles } from "./styles";
5
- /**
6
- * A semantic, accessible ValidationMessage component built on top of the AccessibleTypography component.
7
- */
8
- export const ValidationMessage = ({ as = "span", type = "error", className, ...props }) => {
9
- const styles = cn(validationMessageStyles({ type, ...props }), className);
10
- return _jsx(AccessibleTypography, { as: as, className: styles, ...props });
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
  };