@regardio/react 0.5.7 → 0.7.0

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 (214) hide show
  1. package/dist/background-slideshow/index.d.mts +34 -0
  2. package/dist/background-slideshow/index.mjs +110 -0
  3. package/dist/blurry-gradient/index.d.mts +16 -0
  4. package/dist/blurry-gradient/index.mjs +93 -0
  5. package/dist/button/index.d.mts +2 -0
  6. package/dist/button/index.mjs +3 -0
  7. package/dist/button-BiSQpBbc.mjs +129 -0
  8. package/dist/carousel/index.d.mts +74 -0
  9. package/dist/carousel/index.mjs +136 -0
  10. package/dist/checkbox/index.d.mts +28 -0
  11. package/dist/checkbox/index.mjs +70 -0
  12. package/dist/checkbox-group/index.d.mts +16 -0
  13. package/dist/checkbox-group/index.mjs +29 -0
  14. package/dist/chunk-BTpB_u-K.mjs +18 -0
  15. package/dist/countdown/index.d.mts +4 -0
  16. package/dist/countdown/index.mjs +58 -0
  17. package/dist/field/index.d.mts +68 -0
  18. package/dist/field/index.mjs +115 -0
  19. package/dist/fieldset/index.d.mts +34 -0
  20. package/dist/fieldset/index.mjs +61 -0
  21. package/dist/form/index.d.mts +21 -0
  22. package/dist/form/index.mjs +31 -0
  23. package/dist/generic-error/index.d.mts +44 -0
  24. package/dist/generic-error/index.mjs +57 -0
  25. package/dist/grid/index.d.mts +101 -0
  26. package/dist/grid/index.mjs +219 -0
  27. package/dist/heading/index.d.mts +27 -0
  28. package/dist/heading/index.mjs +28 -0
  29. package/dist/highlight/index.d.mts +17 -0
  30. package/dist/highlight/index.mjs +35 -0
  31. package/dist/hooks/use-current-route-data.d.mts +8 -0
  32. package/dist/hooks/use-current-route-data.mjs +22 -0
  33. package/dist/hooks/{use-focus-search.d.ts → use-focus-search.d.mts} +4 -3
  34. package/dist/hooks/use-focus-search.mjs +23 -0
  35. package/dist/hooks/use-matches-data.d.mts +10 -0
  36. package/dist/hooks/use-matches-data.mjs +23 -0
  37. package/dist/hooks/use-media-query.d.mts +9 -0
  38. package/dist/hooks/use-media-query.mjs +28 -0
  39. package/dist/hooks/use-mobile.d.mts +4 -0
  40. package/dist/hooks/use-mobile.mjs +22 -0
  41. package/dist/hooks/use-nonce.d.mts +6 -0
  42. package/dist/hooks/use-nonce.mjs +13 -0
  43. package/dist/hooks/use-orientation.d.mts +12 -0
  44. package/dist/hooks/use-orientation.mjs +32 -0
  45. package/dist/hooks/use-user.d.mts +53 -0
  46. package/dist/hooks/use-user.mjs +39 -0
  47. package/dist/icon-button/index.d.mts +28 -0
  48. package/dist/icon-button/index.mjs +36 -0
  49. package/dist/if/index.d.mts +13 -0
  50. package/dist/if/index.mjs +21 -0
  51. package/dist/iframe/index.d.mts +11 -0
  52. package/dist/iframe/index.mjs +15 -0
  53. package/dist/index-Bj5_XfEC.d.mts +29 -0
  54. package/dist/index-C_evL5vG.d.mts +35 -0
  55. package/dist/input/index.d.mts +2 -0
  56. package/dist/input/index.mjs +3 -0
  57. package/dist/input-CtR6aRVi.mjs +73 -0
  58. package/dist/link/index.d.mts +71 -0
  59. package/dist/link/index.mjs +129 -0
  60. package/dist/list/index.d.mts +72 -0
  61. package/dist/list/index.mjs +54 -0
  62. package/dist/markdown-container/index.d.mts +23 -0
  63. package/dist/markdown-container/index.mjs +71 -0
  64. package/dist/password-input/index.d.mts +23 -0
  65. package/dist/password-input/index.mjs +92 -0
  66. package/dist/picture/index.d.mts +39 -0
  67. package/dist/picture/index.mjs +3 -0
  68. package/dist/picture-DkX3W5zl.mjs +69 -0
  69. package/dist/protected-email/index.d.mts +24 -0
  70. package/dist/protected-email/index.mjs +37 -0
  71. package/dist/radio/index.d.mts +28 -0
  72. package/dist/radio/index.mjs +72 -0
  73. package/dist/radio-group/index.d.mts +16 -0
  74. package/dist/radio-group/index.mjs +29 -0
  75. package/dist/slider/index.d.mts +63 -0
  76. package/dist/slider/index.mjs +133 -0
  77. package/dist/switch/index.d.mts +29 -0
  78. package/dist/switch/index.mjs +87 -0
  79. package/dist/text/index.d.mts +25 -0
  80. package/dist/text/index.mjs +32 -0
  81. package/dist/text-EQC4zJbE.mjs +52 -0
  82. package/dist/toggle/index.d.mts +25 -0
  83. package/dist/toggle/index.mjs +82 -0
  84. package/dist/utils/author/index.d.mts +4 -0
  85. package/dist/utils/author/index.mjs +26 -0
  86. package/dist/utils/text/{index.d.ts → index.d.mts} +9 -8
  87. package/dist/utils/text/index.mjs +3 -0
  88. package/package.json +131 -83
  89. package/src/background-slideshow/background-slideshow.tsx +1 -2
  90. package/src/blurry-gradient/blurry-gradient.tsx +1 -1
  91. package/src/button/button.stories.tsx +161 -0
  92. package/src/button/button.test.tsx +73 -0
  93. package/src/button/button.tsx +118 -0
  94. package/src/button/index.ts +2 -0
  95. package/src/carousel/carousel-content.tsx +17 -14
  96. package/src/carousel/carousel-item.tsx +18 -18
  97. package/src/carousel/carousel-next.tsx +22 -17
  98. package/src/carousel/carousel-previous.tsx +22 -17
  99. package/src/carousel/carousel-root.tsx +91 -86
  100. package/src/checkbox/checkbox.stories.tsx +118 -0
  101. package/src/checkbox/checkbox.tsx +102 -0
  102. package/src/checkbox/index.ts +2 -0
  103. package/src/checkbox-group/checkbox-group.tsx +40 -0
  104. package/src/checkbox-group/index.ts +2 -0
  105. package/src/countdown/countdown.tsx +1 -1
  106. package/src/field/field.stories.tsx +105 -0
  107. package/src/field/field.test.tsx +61 -0
  108. package/src/field/field.tsx +186 -0
  109. package/src/field/index.ts +12 -0
  110. package/src/fieldset/fieldset.stories.tsx +204 -0
  111. package/src/fieldset/fieldset.test.tsx +63 -0
  112. package/src/fieldset/fieldset.tsx +86 -0
  113. package/src/fieldset/index.ts +7 -0
  114. package/src/form/form.stories.tsx +230 -0
  115. package/src/form/form.test.tsx +68 -0
  116. package/src/form/form.tsx +38 -0
  117. package/src/form/index.ts +2 -0
  118. package/src/generic-error/generic-error.tsx +2 -3
  119. package/src/grid/grid-item.tsx +77 -36
  120. package/src/grid/grid-root.tsx +49 -22
  121. package/src/heading/heading.tsx +7 -3
  122. package/src/highlight/highlight.tsx +1 -1
  123. package/src/hooks/use-current-route-data.ts +4 -2
  124. package/src/hooks/use-focus-search.ts +3 -1
  125. package/src/hooks/use-matches-data.ts +2 -0
  126. package/src/hooks/use-media-query.ts +2 -0
  127. package/src/hooks/use-mobile.ts +3 -1
  128. package/src/hooks/use-nonce.ts +3 -3
  129. package/src/hooks/use-orientation.ts +2 -0
  130. package/src/hooks/use-user.tsx +3 -2
  131. package/src/icon-button/icon-button.stories.tsx +128 -7
  132. package/src/icon-button/icon-button.test.tsx +152 -0
  133. package/src/icon-button/icon-button.tsx +43 -9
  134. package/src/if/if.tsx +3 -1
  135. package/src/input/index.ts +2 -0
  136. package/src/input/input.stories.tsx +151 -0
  137. package/src/input/input.test.tsx +65 -0
  138. package/src/input/input.tsx +113 -0
  139. package/src/link/link.tsx +4 -3
  140. package/src/list/list-item.tsx +10 -13
  141. package/src/list/list-root-context.ts +3 -3
  142. package/src/list/list-root.tsx +10 -13
  143. package/src/password-input/index.ts +1 -1
  144. package/src/password-input/password-input.tsx +104 -27
  145. package/src/protected-email/protected-email.tsx +6 -1
  146. package/src/radio/index.ts +2 -0
  147. package/src/radio/radio.tsx +103 -0
  148. package/src/radio-group/index.ts +2 -0
  149. package/src/radio-group/radio-group.tsx +40 -0
  150. package/src/slider/index.ts +18 -0
  151. package/src/slider/slider.tsx +201 -0
  152. package/src/switch/index.ts +2 -0
  153. package/src/switch/switch.stories.tsx +118 -0
  154. package/src/switch/switch.tsx +112 -0
  155. package/src/text/text.tsx +6 -1
  156. package/src/toggle/index.ts +2 -0
  157. package/src/toggle/toggle.stories.tsx +232 -0
  158. package/src/toggle/toggle.test.tsx +149 -0
  159. package/src/toggle/toggle.tsx +88 -0
  160. package/src/utils/text/text.tsx +8 -16
  161. package/dist/background-slideshow/index.d.ts +0 -24
  162. package/dist/background-slideshow/index.js +0 -165
  163. package/dist/blurry-gradient/index.d.ts +0 -16
  164. package/dist/blurry-gradient/index.js +0 -128
  165. package/dist/carousel/index.d.ts +0 -36
  166. package/dist/carousel/index.js +0 -171
  167. package/dist/countdown/index.d.ts +0 -5
  168. package/dist/countdown/index.js +0 -73
  169. package/dist/generic-error/index.d.ts +0 -43
  170. package/dist/generic-error/index.js +0 -47
  171. package/dist/grid/index.d.ts +0 -1196
  172. package/dist/grid/index.js +0 -239
  173. package/dist/heading/index.d.ts +0 -24
  174. package/dist/heading/index.js +0 -99
  175. package/dist/highlight/index.d.ts +0 -13
  176. package/dist/highlight/index.js +0 -59
  177. package/dist/hooks/use-current-route-data.d.ts +0 -7
  178. package/dist/hooks/use-current-route-data.js +0 -16
  179. package/dist/hooks/use-focus-search.js +0 -19
  180. package/dist/hooks/use-matches-data.d.ts +0 -9
  181. package/dist/hooks/use-matches-data.js +0 -15
  182. package/dist/hooks/use-media-query.d.ts +0 -8
  183. package/dist/hooks/use-media-query.js +0 -20
  184. package/dist/hooks/use-mobile.d.ts +0 -3
  185. package/dist/hooks/use-mobile.js +0 -19
  186. package/dist/hooks/use-nonce.d.ts +0 -7
  187. package/dist/hooks/use-nonce.js +0 -8
  188. package/dist/hooks/use-orientation.d.ts +0 -11
  189. package/dist/hooks/use-orientation.js +0 -29
  190. package/dist/hooks/use-user.d.ts +0 -50
  191. package/dist/hooks/use-user.js +0 -25
  192. package/dist/icon-button/index.d.ts +0 -9
  193. package/dist/icon-button/index.js +0 -17
  194. package/dist/if/index.d.ts +0 -10
  195. package/dist/if/index.js +0 -24
  196. package/dist/iframe/index.d.ts +0 -10
  197. package/dist/iframe/index.js +0 -17
  198. package/dist/link/index.d.ts +0 -55
  199. package/dist/link/index.js +0 -195
  200. package/dist/list/index.d.ts +0 -69
  201. package/dist/list/index.js +0 -65
  202. package/dist/markdown-container/index.d.ts +0 -22
  203. package/dist/markdown-container/index.js +0 -128
  204. package/dist/password-input/index.d.ts +0 -11
  205. package/dist/password-input/index.js +0 -46
  206. package/dist/picture/index.d.ts +0 -38
  207. package/dist/picture/index.js +0 -68
  208. package/dist/protected-email/index.d.ts +0 -20
  209. package/dist/protected-email/index.js +0 -30
  210. package/dist/text/index.d.ts +0 -20
  211. package/dist/text/index.js +0 -38
  212. package/dist/utils/author/index.d.ts +0 -3
  213. package/dist/utils/author/index.js +0 -33
  214. package/dist/utils/text/index.js +0 -73
@@ -0,0 +1,133 @@
1
+ import { tv } from "@regardio/tailwind/utils";
2
+ import { jsx } from "react/jsx-runtime";
3
+ import { Slider as Slider$1 } from "@base-ui/react/slider";
4
+
5
+ //#region src/slider/slider.tsx
6
+ const sliderRoot = tv({
7
+ base: [
8
+ "relative",
9
+ "flex",
10
+ "items-center",
11
+ "w-full"
12
+ ],
13
+ defaultVariants: { size: "md" },
14
+ variants: { size: {
15
+ lg: ["h-8"],
16
+ md: ["h-6"],
17
+ sm: ["h-4"]
18
+ } }
19
+ });
20
+ const sliderControl = tv({ base: [
21
+ "relative",
22
+ "flex",
23
+ "items-center",
24
+ "w-full",
25
+ "touch-none"
26
+ ] });
27
+ const sliderTrack = tv({
28
+ base: [
29
+ "relative",
30
+ "w-full",
31
+ "rounded-full",
32
+ "bg-gray-200",
33
+ "overflow-hidden"
34
+ ],
35
+ defaultVariants: { size: "md" },
36
+ variants: { size: {
37
+ lg: ["h-3"],
38
+ md: ["h-2"],
39
+ sm: ["h-1"]
40
+ } }
41
+ });
42
+ const sliderIndicator = tv({ base: [
43
+ "absolute",
44
+ "h-full",
45
+ "bg-blue-600",
46
+ "rounded-full"
47
+ ] });
48
+ const sliderThumb = tv({
49
+ base: [
50
+ "block",
51
+ "rounded-full",
52
+ "bg-white",
53
+ "border-2",
54
+ "border-blue-600",
55
+ "shadow-lg",
56
+ "focus:outline-none",
57
+ "focus:ring-2",
58
+ "focus:ring-blue-500",
59
+ "focus:ring-offset-2",
60
+ "disabled:cursor-not-allowed",
61
+ "disabled:opacity-50",
62
+ "cursor-grab",
63
+ "active:cursor-grabbing"
64
+ ],
65
+ defaultVariants: { size: "md" },
66
+ variants: { size: {
67
+ lg: ["h-6", "w-6"],
68
+ md: ["h-5", "w-5"],
69
+ sm: ["h-3", "w-3"]
70
+ } }
71
+ });
72
+ const sliderValue = tv({ base: [
73
+ "text-sm",
74
+ "font-medium",
75
+ "text-gray-700",
76
+ "mb-2"
77
+ ] });
78
+ const SliderRoot = ({ className, size = "md", ...props }) => {
79
+ return /* @__PURE__ */ jsx(Slider$1.Root, {
80
+ className: sliderRoot({
81
+ className,
82
+ size
83
+ }),
84
+ ...props
85
+ });
86
+ };
87
+ const SliderControl = ({ className, ...props }) => {
88
+ return /* @__PURE__ */ jsx(Slider$1.Control, {
89
+ className: sliderControl({ className }),
90
+ ...props
91
+ });
92
+ };
93
+ const SliderTrack = ({ className, size = "md", ...props }) => {
94
+ return /* @__PURE__ */ jsx(Slider$1.Track, {
95
+ className: sliderTrack({
96
+ className,
97
+ size
98
+ }),
99
+ ...props
100
+ });
101
+ };
102
+ const SliderIndicator = ({ className, ...props }) => {
103
+ return /* @__PURE__ */ jsx(Slider$1.Indicator, {
104
+ className: sliderIndicator({ className }),
105
+ ...props
106
+ });
107
+ };
108
+ const SliderThumb = ({ className, size = "md", ...props }) => {
109
+ return /* @__PURE__ */ jsx(Slider$1.Thumb, {
110
+ className: sliderThumb({
111
+ className,
112
+ size
113
+ }),
114
+ ...props
115
+ });
116
+ };
117
+ const SliderValue = ({ className, ...props }) => {
118
+ return /* @__PURE__ */ jsx(Slider$1.Value, {
119
+ className: sliderValue({ className }),
120
+ ...props
121
+ });
122
+ };
123
+ const Slider = {
124
+ Control: SliderControl,
125
+ Indicator: SliderIndicator,
126
+ Root: SliderRoot,
127
+ Thumb: SliderThumb,
128
+ Track: SliderTrack,
129
+ Value: SliderValue
130
+ };
131
+
132
+ //#endregion
133
+ export { Slider, SliderControl, SliderIndicator, SliderRoot, SliderThumb, SliderTrack, SliderValue };
@@ -0,0 +1,29 @@
1
+ import { ComponentProps } from "react";
2
+ import { Switch as Switch$1 } from "@base-ui/react/switch";
3
+
4
+ //#region src/switch/switch.d.ts
5
+ type SwitchSize = "sm" | "md" | "lg";
6
+ interface SwitchRootProps extends Omit<ComponentProps<typeof Switch$1.Root>, "className"> {
7
+ className?: string;
8
+ size?: SwitchSize;
9
+ }
10
+ interface SwitchThumbProps extends Omit<ComponentProps<typeof Switch$1.Thumb>, "className"> {
11
+ className?: string;
12
+ size?: SwitchSize;
13
+ }
14
+ declare const SwitchRoot: ({
15
+ className,
16
+ size,
17
+ ...props
18
+ }: SwitchRootProps) => React.JSX.Element;
19
+ declare const SwitchThumb: ({
20
+ className,
21
+ size,
22
+ ...props
23
+ }: SwitchThumbProps) => React.JSX.Element;
24
+ declare const Switch: {
25
+ Root: typeof SwitchRoot;
26
+ Thumb: typeof SwitchThumb;
27
+ };
28
+ //#endregion
29
+ export { Switch, SwitchRoot, type SwitchRootProps, type SwitchSize, SwitchThumb, type SwitchThumbProps };
@@ -0,0 +1,87 @@
1
+ import { tv } from "@regardio/tailwind/utils";
2
+ import { jsx } from "react/jsx-runtime";
3
+ import { Switch as Switch$1 } from "@base-ui/react/switch";
4
+
5
+ //#region src/switch/switch.tsx
6
+ const switchRoot = tv({
7
+ base: [
8
+ "relative",
9
+ "inline-flex",
10
+ "items-center",
11
+ "rounded-full",
12
+ "transition-colors",
13
+ "duration-200",
14
+ "focus:outline-none",
15
+ "focus:ring-2",
16
+ "focus:ring-blue-500",
17
+ "focus:ring-offset-2",
18
+ "disabled:cursor-not-allowed",
19
+ "disabled:opacity-50",
20
+ "cursor-pointer",
21
+ "bg-gray-300",
22
+ "data-[checked]:bg-blue-600"
23
+ ],
24
+ defaultVariants: { size: "md" },
25
+ variants: { size: {
26
+ lg: ["h-8", "w-14"],
27
+ md: ["h-6", "w-11"],
28
+ sm: ["h-4", "w-7"]
29
+ } }
30
+ });
31
+ const switchThumb = tv({
32
+ base: [
33
+ "pointer-events-none",
34
+ "inline-block",
35
+ "rounded-full",
36
+ "bg-white",
37
+ "shadow-lg",
38
+ "ring-0",
39
+ "transition-transform",
40
+ "duration-200",
41
+ "translate-x-0",
42
+ "data-[checked]:translate-x-full"
43
+ ],
44
+ defaultVariants: { size: "md" },
45
+ variants: { size: {
46
+ lg: [
47
+ "h-6",
48
+ "w-6",
49
+ "data-[checked]:translate-x-6"
50
+ ],
51
+ md: [
52
+ "h-5",
53
+ "w-5",
54
+ "data-[checked]:translate-x-5"
55
+ ],
56
+ sm: [
57
+ "h-3",
58
+ "w-3",
59
+ "data-[checked]:translate-x-3"
60
+ ]
61
+ } }
62
+ });
63
+ const SwitchRoot = ({ className, size = "md", ...props }) => {
64
+ return /* @__PURE__ */ jsx(Switch$1.Root, {
65
+ className: switchRoot({
66
+ className,
67
+ size
68
+ }),
69
+ ...props
70
+ });
71
+ };
72
+ const SwitchThumb = ({ className, size = "md", ...props }) => {
73
+ return /* @__PURE__ */ jsx(Switch$1.Thumb, {
74
+ className: switchThumb({
75
+ className,
76
+ size
77
+ }),
78
+ ...props
79
+ });
80
+ };
81
+ const Switch = {
82
+ Root: SwitchRoot,
83
+ Thumb: SwitchThumb
84
+ };
85
+
86
+ //#endregion
87
+ export { Switch, SwitchRoot, SwitchThumb };
@@ -0,0 +1,25 @@
1
+ import { ComponentProps } from "react";
2
+
3
+ //#region src/text/text.d.ts
4
+ declare const themeColorVariants: {
5
+ readonly primary: readonly [];
6
+ };
7
+ declare const textVariants: {
8
+ readonly code: readonly ["font-light", "font-monospace"];
9
+ readonly primary: readonly [];
10
+ readonly subtitle: readonly ["text-lg"];
11
+ };
12
+ type TextThemeColor = keyof typeof themeColorVariants;
13
+ type TextVariant = keyof typeof textVariants;
14
+ interface TextProps extends ComponentProps<"p"> {
15
+ themeColor?: TextThemeColor;
16
+ variant?: TextVariant;
17
+ }
18
+ declare const Text: ({
19
+ children,
20
+ className,
21
+ variant,
22
+ themeColor
23
+ }: TextProps) => React.JSX.Element;
24
+ //#endregion
25
+ export { Text, type TextProps };
@@ -0,0 +1,32 @@
1
+ import { tv } from "@regardio/tailwind/utils";
2
+ import { jsx } from "react/jsx-runtime";
3
+
4
+ //#region src/text/text.tsx
5
+ const text = tv({
6
+ base: ["relative", "block"],
7
+ defaultVariants: {
8
+ themeColor: "primary",
9
+ variant: "primary"
10
+ },
11
+ variants: {
12
+ themeColor: { primary: [] },
13
+ variant: {
14
+ code: ["font-light", "font-monospace"],
15
+ primary: [],
16
+ subtitle: ["text-lg"]
17
+ }
18
+ }
19
+ });
20
+ const Text = ({ children, className, variant, themeColor }) => {
21
+ return /* @__PURE__ */ jsx("div", {
22
+ className: text({
23
+ className,
24
+ themeColor,
25
+ variant
26
+ }),
27
+ children
28
+ });
29
+ };
30
+
31
+ //#endregion
32
+ export { Text };
@@ -0,0 +1,52 @@
1
+ import { Fragment, cloneElement, isValidElement } from "react";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
3
+ import { replaceShyInString, splitIntoSentences, typographicQuotes } from "@regardio/js/text";
4
+
5
+ //#region src/utils/text/text.tsx
6
+ const lowerCaseSzett = (text, _returnType) => {
7
+ const processString = (str) => {
8
+ return str.split(/(ß)/g).map((part, index) => part === "ß" ? /* @__PURE__ */ jsx("span", {
9
+ className: "lowercase",
10
+ children: part
11
+ }, index.toString()) : part);
12
+ };
13
+ if (typeof text === "string") return processString(text);
14
+ if (isValidElement(text)) {
15
+ const element = text;
16
+ const { children } = element.props;
17
+ return cloneElement(element, element.props, lowerCaseSzett(children));
18
+ }
19
+ if (Array.isArray(text)) return text.map((child, index) => /* @__PURE__ */ jsx(Fragment, { children: lowerCaseSzett(child) }, index.toString()));
20
+ return text;
21
+ };
22
+ function replaceShyInReactNode(node) {
23
+ if (typeof node === "string") return node.replace(/\u00AD/g, "");
24
+ if (isValidElement(node)) {
25
+ const element = node;
26
+ const { children } = element.props;
27
+ return cloneElement(element, element.props, replaceShyInReactNode(children));
28
+ }
29
+ if (Array.isArray(node)) return node.map((child, index) => /* @__PURE__ */ jsx(Fragment, { children: replaceShyInReactNode(child) }, index.toString()));
30
+ return node;
31
+ }
32
+ function shy(input) {
33
+ if (input === null) return null;
34
+ if (typeof input === "string") return replaceShyInString(input);
35
+ return replaceShyInReactNode(input);
36
+ }
37
+ /**
38
+ * Replace special characters in text: typographic quotes and soft hyphens.
39
+ * This is a React-aware version that handles ReactNode trees.
40
+ */
41
+ function replaceSpecialChars(text, locale) {
42
+ return shy(typographicQuotes(text, locale));
43
+ }
44
+ /**
45
+ * Wrap sentences in span elements
46
+ */
47
+ function wrapSentences(text) {
48
+ return splitIntoSentences(text).map((sentence, index) => /* @__PURE__ */ jsxs("span", { children: [sentence, " "] }, index.toString()));
49
+ }
50
+
51
+ //#endregion
52
+ export { wrapSentences as i, replaceSpecialChars as n, shy as r, lowerCaseSzett as t };
@@ -0,0 +1,25 @@
1
+ import { ComponentProps, ReactNode } from "react";
2
+ import { tv } from "@regardio/tailwind/utils";
3
+ import { Toggle as Toggle$1 } from "@base-ui/react/toggle";
4
+
5
+ //#region src/toggle/toggle.d.ts
6
+ declare const toggle: ReturnType<typeof tv>;
7
+ type ToggleVariant = keyof typeof toggle.variants.variant;
8
+ type ToggleSize = keyof typeof toggle.variants.size;
9
+ interface ToggleProps extends Omit<ComponentProps<typeof Toggle$1>, "className"> {
10
+ className?: string;
11
+ variant?: ToggleVariant;
12
+ size?: ToggleSize;
13
+ children?: ReactNode;
14
+ title?: string;
15
+ }
16
+ declare const Toggle: ({
17
+ className,
18
+ variant,
19
+ size,
20
+ title,
21
+ children,
22
+ ...props
23
+ }: ToggleProps) => React.JSX.Element;
24
+ //#endregion
25
+ export { Toggle, type ToggleProps, type ToggleSize, type ToggleVariant };
@@ -0,0 +1,82 @@
1
+ import { tv } from "@regardio/tailwind/utils";
2
+ import { jsx } from "react/jsx-runtime";
3
+ import { Toggle as Toggle$1 } from "@base-ui/react/toggle";
4
+
5
+ //#region src/toggle/toggle.tsx
6
+ const toggle = tv({
7
+ base: [
8
+ "inline-flex",
9
+ "items-center",
10
+ "justify-center",
11
+ "rounded-md",
12
+ "text-sm",
13
+ "font-medium",
14
+ "transition-colors",
15
+ "duration-200",
16
+ "focus:outline-none",
17
+ "focus:ring-2",
18
+ "focus:ring-blue-500",
19
+ "focus:ring-offset-2",
20
+ "disabled:pointer-events-none",
21
+ "disabled:opacity-50"
22
+ ],
23
+ defaultVariants: {
24
+ size: "md",
25
+ variant: "outline"
26
+ },
27
+ variants: {
28
+ size: {
29
+ lg: [
30
+ "h-12",
31
+ "w-12",
32
+ "p-3"
33
+ ],
34
+ md: [
35
+ "h-10",
36
+ "w-10",
37
+ "p-2"
38
+ ],
39
+ sm: [
40
+ "h-8",
41
+ "w-8",
42
+ "p-1"
43
+ ]
44
+ },
45
+ variant: {
46
+ default: [],
47
+ ghost: [
48
+ "bg-transparent",
49
+ "text-gray-700",
50
+ "hover:bg-gray-100",
51
+ "hover:text-gray-900",
52
+ "data-[pressed]:bg-gray-200",
53
+ "data-[pressed]:text-gray-900"
54
+ ],
55
+ outline: [
56
+ "border",
57
+ "border-gray-300",
58
+ "bg-white",
59
+ "text-gray-700",
60
+ "hover:bg-gray-50",
61
+ "hover:text-gray-900",
62
+ "data-[pressed]:bg-gray-100",
63
+ "data-[pressed]:text-gray-900"
64
+ ]
65
+ }
66
+ }
67
+ });
68
+ const Toggle = ({ className, variant = "outline", size = "md", title, children, ...props }) => {
69
+ return /* @__PURE__ */ jsx(Toggle$1, {
70
+ className: toggle({
71
+ className,
72
+ size,
73
+ variant
74
+ }),
75
+ title,
76
+ ...props,
77
+ children
78
+ });
79
+ };
80
+
81
+ //#endregion
82
+ export { Toggle };
@@ -0,0 +1,4 @@
1
+ //#region src/utils/author/author.d.ts
2
+ declare function generateLinkFromAuthorString(input: string): React.ReactNode;
3
+ //#endregion
4
+ export { generateLinkFromAuthorString };
@@ -0,0 +1,26 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { parseAuthorString } from "@regardio/js/text";
3
+
4
+ //#region src/utils/author/author.tsx
5
+ function generateLinkFromAuthorString(input) {
6
+ const match = parseAuthorString(input);
7
+ if (match.name) {
8
+ if (match.email) return /* @__PURE__ */ jsx("a", {
9
+ className: "u-email p-name",
10
+ href: `mailto:${match.email}`,
11
+ children: match.name
12
+ });
13
+ if (match.url && (match.url.startsWith("/") || match.url.startsWith("http"))) return /* @__PURE__ */ jsx("a", {
14
+ className: "u-url p-name",
15
+ href: match.url,
16
+ children: match.name
17
+ });
18
+ return /* @__PURE__ */ jsx("span", {
19
+ className: "p-name",
20
+ children: match.name
21
+ });
22
+ }
23
+ }
24
+
25
+ //#endregion
26
+ export { generateLinkFromAuthorString };
@@ -1,15 +1,16 @@
1
- import { ReactNode } from 'react';
1
+ import { ReactNode } from "react";
2
2
 
3
+ //#region src/utils/text/text.d.ts
3
4
  declare const lowerCaseSzett: (text: ReactNode | string, _returnType?: "string") => ReactNode;
4
5
  declare function shy(input: string | ReactNode | null): string | ReactNode | null;
5
6
  /**
6
- * Replace special characters in text: typographic quotes and soft hyphens.
7
- * This is a React-aware version that handles ReactNode trees.
8
- */
7
+ * Replace special characters in text: typographic quotes and soft hyphens.
8
+ * This is a React-aware version that handles ReactNode trees.
9
+ */
9
10
  declare function replaceSpecialChars(text: string, locale: string): string | ReactNode | null;
10
11
  /**
11
- * Wrap sentences in span elements
12
- */
12
+ * Wrap sentences in span elements
13
+ */
13
14
  declare function wrapSentences(text: string): ReactNode;
14
-
15
- export { lowerCaseSzett, replaceSpecialChars, shy, wrapSentences };
15
+ //#endregion
16
+ export { lowerCaseSzett, replaceSpecialChars, shy, wrapSentences };
@@ -0,0 +1,3 @@
1
+ import { i as wrapSentences, n as replaceSpecialChars, r as shy, t as lowerCaseSzett } from "../../text-EQC4zJbE.mjs";
2
+
3
+ export { lowerCaseSzett, replaceSpecialChars, shy, wrapSentences };