@regardio/react 0.5.5 → 0.6.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 (182) hide show
  1. package/dist/background-slideshow/index.d.mts +36 -0
  2. package/dist/background-slideshow/index.mjs +110 -0
  3. package/dist/blurry-gradient/index.d.mts +17 -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 +40 -0
  9. package/dist/carousel/index.mjs +141 -0
  10. package/dist/checkbox/index.d.mts +37 -0
  11. package/dist/checkbox/index.mjs +70 -0
  12. package/dist/checkbox-group/index.d.mts +17 -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 +6 -0
  16. package/dist/countdown/index.mjs +58 -0
  17. package/dist/field/index.d.mts +66 -0
  18. package/dist/field/index.mjs +115 -0
  19. package/dist/fieldset/index.d.mts +33 -0
  20. package/dist/fieldset/index.mjs +61 -0
  21. package/dist/form/index.d.mts +22 -0
  22. package/dist/form/index.mjs +31 -0
  23. package/dist/generic-error/{index.d.ts → index.d.mts} +22 -18
  24. package/dist/generic-error/index.mjs +57 -0
  25. package/dist/grid/index.d.mts +1197 -0
  26. package/dist/grid/index.mjs +221 -0
  27. package/dist/heading/index.d.mts +31 -0
  28. package/dist/heading/index.mjs +29 -0
  29. package/dist/highlight/index.d.mts +18 -0
  30. package/dist/highlight/index.mjs +35 -0
  31. package/dist/hooks/{use-current-route-data.d.ts → use-current-route-data.d.mts} +3 -2
  32. package/dist/hooks/use-current-route-data.mjs +20 -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 +21 -0
  35. package/dist/hooks/{use-matches-data.d.ts → use-matches-data.d.mts} +3 -2
  36. package/dist/hooks/use-matches-data.mjs +21 -0
  37. package/dist/hooks/{use-media-query.d.ts → use-media-query.d.mts} +3 -2
  38. package/dist/hooks/use-media-query.mjs +26 -0
  39. package/dist/hooks/use-mobile.d.mts +4 -0
  40. package/dist/hooks/use-mobile.mjs +20 -0
  41. package/dist/hooks/use-nonce.d.mts +8 -0
  42. package/dist/hooks/use-nonce.mjs +13 -0
  43. package/dist/hooks/{use-orientation.d.ts → use-orientation.d.mts} +3 -2
  44. package/dist/hooks/use-orientation.mjs +30 -0
  45. package/dist/hooks/use-user.d.mts +55 -0
  46. package/dist/hooks/use-user.mjs +39 -0
  47. package/dist/icon-button/index.d.mts +29 -0
  48. package/dist/icon-button/index.mjs +36 -0
  49. package/dist/if/index.d.mts +15 -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-Bm-tWhsb.d.mts +30 -0
  54. package/dist/index-YT2CkvL6.d.mts +36 -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 +73 -0
  59. package/dist/link/index.mjs +129 -0
  60. package/dist/list/index.d.mts +71 -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 +24 -0
  65. package/dist/password-input/index.mjs +92 -0
  66. package/dist/picture/{index.d.ts → index.d.mts} +21 -20
  67. package/dist/picture/index.mjs +3 -0
  68. package/dist/picture-DkX3W5zl.mjs +69 -0
  69. package/dist/protected-email/{index.d.ts → index.d.mts} +14 -8
  70. package/dist/protected-email/index.mjs +37 -0
  71. package/dist/radio/index.d.mts +37 -0
  72. package/dist/radio/index.mjs +72 -0
  73. package/dist/radio-group/index.d.mts +17 -0
  74. package/dist/radio-group/index.mjs +29 -0
  75. package/dist/slider/index.d.mts +85 -0
  76. package/dist/slider/index.mjs +133 -0
  77. package/dist/switch/index.d.mts +38 -0
  78. package/dist/switch/index.mjs +87 -0
  79. package/dist/text/index.d.mts +26 -0
  80. package/dist/text/index.mjs +32 -0
  81. package/dist/text-CPlUND-Z.mjs +58 -0
  82. package/dist/toggle/index.d.mts +59 -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} +4 -3
  87. package/dist/utils/text/index.mjs +3 -0
  88. package/package.json +17 -129
  89. package/src/button/button.stories.tsx +161 -0
  90. package/src/button/button.test.tsx +73 -0
  91. package/src/button/button.tsx +112 -0
  92. package/src/button/index.ts +2 -0
  93. package/src/carousel/carousel-next.tsx +2 -2
  94. package/src/carousel/carousel-previous.tsx +2 -2
  95. package/src/checkbox/checkbox.stories.tsx +118 -0
  96. package/src/checkbox/checkbox.tsx +91 -0
  97. package/src/checkbox/index.ts +2 -0
  98. package/src/checkbox-group/checkbox-group.tsx +40 -0
  99. package/src/checkbox-group/index.ts +2 -0
  100. package/src/field/field.stories.tsx +105 -0
  101. package/src/field/field.test.tsx +61 -0
  102. package/src/field/field.tsx +165 -0
  103. package/src/field/index.ts +12 -0
  104. package/src/fieldset/fieldset.stories.tsx +204 -0
  105. package/src/fieldset/fieldset.test.tsx +63 -0
  106. package/src/fieldset/fieldset.tsx +75 -0
  107. package/src/fieldset/index.ts +7 -0
  108. package/src/form/form.stories.tsx +230 -0
  109. package/src/form/form.test.tsx +68 -0
  110. package/src/form/form.tsx +38 -0
  111. package/src/form/index.ts +2 -0
  112. package/src/icon-button/icon-button.stories.tsx +128 -7
  113. package/src/icon-button/icon-button.test.tsx +152 -0
  114. package/src/icon-button/icon-button.tsx +43 -9
  115. package/src/input/index.ts +2 -0
  116. package/src/input/input.stories.tsx +151 -0
  117. package/src/input/input.test.tsx +65 -0
  118. package/src/input/input.tsx +113 -0
  119. package/src/link/link.test.tsx +169 -0
  120. package/src/password-input/index.ts +1 -1
  121. package/src/password-input/password-input.tsx +104 -27
  122. package/src/radio/index.ts +2 -0
  123. package/src/radio/radio.tsx +92 -0
  124. package/src/radio-group/index.ts +2 -0
  125. package/src/radio-group/radio-group.tsx +36 -0
  126. package/src/slider/index.ts +18 -0
  127. package/src/slider/slider.tsx +179 -0
  128. package/src/switch/index.ts +2 -0
  129. package/src/switch/switch.stories.tsx +118 -0
  130. package/src/switch/switch.tsx +101 -0
  131. package/src/toggle/index.ts +2 -0
  132. package/src/toggle/toggle.stories.tsx +232 -0
  133. package/src/toggle/toggle.test.tsx +149 -0
  134. package/src/toggle/toggle.tsx +88 -0
  135. package/src/utils/text/text.test.tsx +110 -0
  136. package/dist/background-slideshow/index.d.ts +0 -24
  137. package/dist/background-slideshow/index.js +0 -165
  138. package/dist/blurry-gradient/index.d.ts +0 -16
  139. package/dist/blurry-gradient/index.js +0 -128
  140. package/dist/carousel/index.d.ts +0 -36
  141. package/dist/carousel/index.js +0 -171
  142. package/dist/countdown/index.d.ts +0 -5
  143. package/dist/countdown/index.js +0 -73
  144. package/dist/generic-error/index.js +0 -47
  145. package/dist/grid/index.d.ts +0 -1196
  146. package/dist/grid/index.js +0 -239
  147. package/dist/heading/index.d.ts +0 -24
  148. package/dist/heading/index.js +0 -99
  149. package/dist/highlight/index.d.ts +0 -13
  150. package/dist/highlight/index.js +0 -59
  151. package/dist/hooks/use-current-route-data.js +0 -16
  152. package/dist/hooks/use-focus-search.js +0 -19
  153. package/dist/hooks/use-matches-data.js +0 -15
  154. package/dist/hooks/use-media-query.js +0 -20
  155. package/dist/hooks/use-mobile.d.ts +0 -3
  156. package/dist/hooks/use-mobile.js +0 -19
  157. package/dist/hooks/use-nonce.d.ts +0 -7
  158. package/dist/hooks/use-nonce.js +0 -8
  159. package/dist/hooks/use-orientation.js +0 -29
  160. package/dist/hooks/use-user.d.ts +0 -50
  161. package/dist/hooks/use-user.js +0 -25
  162. package/dist/icon-button/index.d.ts +0 -9
  163. package/dist/icon-button/index.js +0 -17
  164. package/dist/if/index.d.ts +0 -10
  165. package/dist/if/index.js +0 -24
  166. package/dist/iframe/index.d.ts +0 -10
  167. package/dist/iframe/index.js +0 -17
  168. package/dist/link/index.d.ts +0 -55
  169. package/dist/link/index.js +0 -195
  170. package/dist/list/index.d.ts +0 -69
  171. package/dist/list/index.js +0 -65
  172. package/dist/markdown-container/index.d.ts +0 -22
  173. package/dist/markdown-container/index.js +0 -128
  174. package/dist/password-input/index.d.ts +0 -11
  175. package/dist/password-input/index.js +0 -46
  176. package/dist/picture/index.js +0 -68
  177. package/dist/protected-email/index.js +0 -30
  178. package/dist/text/index.d.ts +0 -20
  179. package/dist/text/index.js +0 -38
  180. package/dist/utils/author/index.d.ts +0 -3
  181. package/dist/utils/author/index.js +0 -33
  182. 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,38 @@
1
+ import { ComponentProps } from "react";
2
+ import * as react_jsx_runtime53 from "react/jsx-runtime";
3
+ import { Switch as Switch$1 } from "@base-ui/react/switch";
4
+
5
+ //#region src/switch/switch.d.ts
6
+ type SwitchSize = 'sm' | 'md' | 'lg';
7
+ interface SwitchRootProps extends Omit<ComponentProps<typeof Switch$1.Root>, 'className'> {
8
+ className?: string;
9
+ size?: SwitchSize;
10
+ }
11
+ interface SwitchThumbProps extends Omit<ComponentProps<typeof Switch$1.Thumb>, 'className'> {
12
+ className?: string;
13
+ size?: SwitchSize;
14
+ }
15
+ declare const SwitchRoot: ({
16
+ className,
17
+ size,
18
+ ...props
19
+ }: SwitchRootProps) => react_jsx_runtime53.JSX.Element;
20
+ declare const SwitchThumb: ({
21
+ className,
22
+ size,
23
+ ...props
24
+ }: SwitchThumbProps) => react_jsx_runtime53.JSX.Element;
25
+ declare const Switch: {
26
+ Root: ({
27
+ className,
28
+ size,
29
+ ...props
30
+ }: SwitchRootProps) => react_jsx_runtime53.JSX.Element;
31
+ Thumb: ({
32
+ className,
33
+ size,
34
+ ...props
35
+ }: SwitchThumbProps) => react_jsx_runtime53.JSX.Element;
36
+ };
37
+ //#endregion
38
+ 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,26 @@
1
+ import { ComponentProps } from "react";
2
+ import * as react_jsx_runtime50 from "react/jsx-runtime";
3
+
4
+ //#region src/text/text.d.ts
5
+ declare const themeColorVariants: {
6
+ readonly primary: readonly [];
7
+ };
8
+ declare const textVariants: {
9
+ readonly code: readonly ["font-light", "font-monospace"];
10
+ readonly primary: readonly [];
11
+ readonly subtitle: readonly ["text-lg"];
12
+ };
13
+ type TextThemeColor = keyof typeof themeColorVariants;
14
+ type TextVariant = keyof typeof textVariants;
15
+ interface TextProps extends ComponentProps<'p'> {
16
+ themeColor?: TextThemeColor;
17
+ variant?: TextVariant;
18
+ }
19
+ declare const Text: ({
20
+ children,
21
+ className,
22
+ variant,
23
+ themeColor
24
+ }: TextProps) => react_jsx_runtime50.JSX.Element;
25
+ //#endregion
26
+ 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,58 @@
1
+ import React, { 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, ...props } = element.props;
17
+ return cloneElement(element, {
18
+ ...props,
19
+ children: lowerCaseSzett(children)
20
+ });
21
+ }
22
+ if (Array.isArray(text)) return text.map((child, index) => /* @__PURE__ */ jsx(React.Fragment, { children: lowerCaseSzett(child) }, index.toString()));
23
+ return text;
24
+ };
25
+ function replaceShyInReactNode(node) {
26
+ if (typeof node === "string") return node.replace(/\u00AD/g, "");
27
+ if (isValidElement(node)) {
28
+ const element = node;
29
+ const { children, ...props } = element.props;
30
+ return cloneElement(element, {
31
+ ...props,
32
+ children: replaceShyInReactNode(children)
33
+ });
34
+ }
35
+ if (Array.isArray(node)) return node.map((child, index) => /* @__PURE__ */ jsx(React.Fragment, { children: replaceShyInReactNode(child) }, index.toString()));
36
+ return node;
37
+ }
38
+ function shy(input) {
39
+ if (input === null) return null;
40
+ if (typeof input === "string") return replaceShyInString(input);
41
+ return replaceShyInReactNode(input);
42
+ }
43
+ /**
44
+ * Replace special characters in text: typographic quotes and soft hyphens.
45
+ * This is a React-aware version that handles ReactNode trees.
46
+ */
47
+ function replaceSpecialChars(text, locale) {
48
+ return shy(typographicQuotes(text, locale));
49
+ }
50
+ /**
51
+ * Wrap sentences in span elements
52
+ */
53
+ function wrapSentences(text) {
54
+ return splitIntoSentences(text).map((sentence, index) => /* @__PURE__ */ jsxs("span", { children: [sentence, " "] }, index.toString()));
55
+ }
56
+
57
+ //#endregion
58
+ export { wrapSentences as i, replaceSpecialChars as n, shy as r, lowerCaseSzett as t };
@@ -0,0 +1,59 @@
1
+ import { ComponentProps, ReactNode } from "react";
2
+ import * as react_jsx_runtime51 from "react/jsx-runtime";
3
+ import { Toggle as Toggle$1 } from "@base-ui/react/toggle";
4
+ import * as tailwind_variants3 from "tailwind-variants";
5
+
6
+ //#region src/toggle/toggle.d.ts
7
+ declare const toggle: tailwind_variants3.TVReturnType<{
8
+ size: {
9
+ lg: string[];
10
+ md: string[];
11
+ sm: string[];
12
+ };
13
+ variant: {
14
+ default: never[];
15
+ ghost: string[];
16
+ outline: string[];
17
+ };
18
+ }, undefined, string[], {
19
+ size: {
20
+ lg: string[];
21
+ md: string[];
22
+ sm: string[];
23
+ };
24
+ variant: {
25
+ default: never[];
26
+ ghost: string[];
27
+ outline: string[];
28
+ };
29
+ }, undefined, tailwind_variants3.TVReturnType<{
30
+ size: {
31
+ lg: string[];
32
+ md: string[];
33
+ sm: string[];
34
+ };
35
+ variant: {
36
+ default: never[];
37
+ ghost: string[];
38
+ outline: string[];
39
+ };
40
+ }, undefined, string[], unknown, unknown, undefined>>;
41
+ type ToggleVariant = keyof typeof toggle.variants.variant;
42
+ type ToggleSize = keyof typeof toggle.variants.size;
43
+ interface ToggleProps extends Omit<ComponentProps<typeof Toggle$1>, 'className'> {
44
+ className?: string;
45
+ variant?: ToggleVariant;
46
+ size?: ToggleSize;
47
+ children?: ReactNode;
48
+ title?: string;
49
+ }
50
+ declare const Toggle: ({
51
+ className,
52
+ variant,
53
+ size,
54
+ title,
55
+ children,
56
+ ...props
57
+ }: ToggleProps) => react_jsx_runtime51.JSX.Element;
58
+ //#endregion
59
+ 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,5 +1,6 @@
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
  /**
@@ -11,5 +12,5 @@ declare function replaceSpecialChars(text: string, locale: string): string | Rea
11
12
  * Wrap sentences in span elements
12
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-CPlUND-Z.mjs";
2
+
3
+ export { lowerCaseSzett, replaceSpecialChars, shy, wrapSentences };