@regardio/react 0.4.7 → 0.5.1

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 (202) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +5 -5
  3. package/dist/{components/background-slideshow.js → background-slideshow/index.js} +2 -11
  4. package/dist/{components/blurry-gradient.js → blurry-gradient/index.js} +15 -9
  5. package/dist/{components/carousel.d.ts → carousel/index.d.ts} +17 -9
  6. package/dist/{components/carousel.js → carousel/index.js} +34 -30
  7. package/dist/{components/countdown.js → countdown/index.js} +2 -11
  8. package/dist/{components/generic-error.js → generic-error/index.js} +1 -1
  9. package/dist/grid/index.d.ts +1196 -0
  10. package/dist/grid/index.js +239 -0
  11. package/dist/heading/index.d.ts +24 -0
  12. package/dist/{components/heading.js → heading/index.js} +15 -34
  13. package/dist/highlight/index.d.ts +13 -0
  14. package/dist/{components/highlight.js → highlight/index.js} +9 -17
  15. package/dist/hooks/{use-current-route-data.js → use-current-route-data/index.js} +1 -1
  16. package/dist/hooks/{use-focus-search.js → use-focus-search/index.js} +1 -1
  17. package/dist/hooks/{use-matches-data.js → use-matches-data/index.js} +1 -1
  18. package/dist/hooks/{use-media-query.js → use-media-query/index.js} +1 -1
  19. package/dist/hooks/{use-mobile.js → use-mobile/index.js} +1 -1
  20. package/dist/hooks/use-nonce/index.d.ts +6 -0
  21. package/dist/hooks/use-nonce/index.js +8 -0
  22. package/dist/hooks/{use-orientation.d.ts → use-orientation/index.d.ts} +1 -1
  23. package/dist/hooks/{use-orientation.js → use-orientation/index.js} +1 -1
  24. package/dist/hooks/{use-user.js → use-user/index.js} +1 -1
  25. package/dist/{components/icon-button.js → icon-button/index.js} +1 -1
  26. package/dist/{components/if.js → if/index.js} +1 -1
  27. package/dist/{components/iframe.js → iframe/index.js} +2 -11
  28. package/dist/{components/link.d.ts → link/index.d.ts} +19 -13
  29. package/dist/{components/link.js → link/index.js} +31 -36
  30. package/dist/list/index.d.ts +69 -0
  31. package/dist/list/index.js +65 -0
  32. package/dist/{components/markdown-container.js → markdown-container/index.js} +3 -67
  33. package/dist/{components/password-input.js → password-input/index.js} +2 -11
  34. package/dist/{components/picture.js → picture/index.js} +2 -11
  35. package/dist/{components/protected-email.d.ts → protected-email/index.d.ts} +1 -1
  36. package/dist/{components/protected-email.js → protected-email/index.js} +1 -1
  37. package/dist/text/index.d.ts +20 -0
  38. package/dist/text/index.js +38 -0
  39. package/dist/utils/author/index.d.ts +3 -0
  40. package/dist/utils/author/index.js +33 -0
  41. package/dist/utils/text/index.d.ts +15 -0
  42. package/dist/utils/text/index.js +73 -0
  43. package/package.json +92 -121
  44. package/src/{stories/BackgroundSlideshow.stories.tsx → background-slideshow/background-slideshow.stories.tsx} +1 -1
  45. package/src/{components → background-slideshow}/background-slideshow.tsx +3 -1
  46. package/src/background-slideshow/index.ts +2 -0
  47. package/src/{stories/BlurryGradient.stories.tsx → blurry-gradient/blurry-gradient.stories.tsx} +1 -1
  48. package/src/{components → blurry-gradient}/blurry-gradient.tsx +14 -8
  49. package/src/blurry-gradient/index.ts +2 -0
  50. package/src/carousel/carousel-content.tsx +16 -0
  51. package/src/carousel/carousel-item.tsx +23 -0
  52. package/src/carousel/carousel-next.tsx +22 -0
  53. package/src/carousel/carousel-previous.tsx +22 -0
  54. package/src/{components/carousel.tsx → carousel/carousel-root.tsx} +8 -78
  55. package/src/carousel/carousel.stories.tsx +89 -0
  56. package/src/carousel/index.parts.ts +5 -0
  57. package/src/carousel/index.ts +4 -0
  58. package/src/{stories/Countdown.stories.tsx → countdown/countdown.stories.tsx} +1 -1
  59. package/src/{components → countdown}/countdown.tsx +3 -7
  60. package/src/countdown/index.ts +1 -0
  61. package/src/{stories/GenericError.stories.tsx → generic-error/generic-error.stories.tsx} +1 -1
  62. package/src/{components → generic-error}/generic-error.tsx +2 -0
  63. package/src/generic-error/index.ts +2 -0
  64. package/src/grid/grid-item.tsx +188 -0
  65. package/src/grid/grid-root.tsx +72 -0
  66. package/src/grid/grid.stories.tsx +236 -0
  67. package/src/grid/index.parts.ts +2 -0
  68. package/src/grid/index.ts +5 -0
  69. package/src/{stories/Heading.stories.tsx → heading/heading.stories.tsx} +1 -1
  70. package/src/{components → heading}/heading.tsx +17 -25
  71. package/src/heading/index.ts +2 -0
  72. package/src/{stories/Highlight.stories.tsx → highlight/highlight.stories.tsx} +1 -1
  73. package/src/{components → highlight}/highlight.tsx +13 -9
  74. package/src/highlight/index.ts +2 -0
  75. package/src/hooks/use-current-route-data/index.ts +1 -0
  76. package/src/hooks/use-focus-search/index.ts +1 -0
  77. package/src/hooks/use-matches-data/index.ts +1 -0
  78. package/src/hooks/use-media-query/index.ts +1 -0
  79. package/src/hooks/use-mobile/index.ts +1 -0
  80. package/src/hooks/use-nonce/index.ts +1 -0
  81. package/src/hooks/use-orientation/index.ts +1 -0
  82. package/src/hooks/use-user/index.ts +2 -0
  83. package/src/{stories/IconButton.stories.tsx → icon-button/icon-button.stories.tsx} +1 -1
  84. package/src/icon-button/index.ts +2 -0
  85. package/src/{stories/If.stories.tsx → if/if.stories.tsx} +1 -1
  86. package/src/if/index.ts +1 -0
  87. package/src/{stories/Iframe.stories.tsx → iframe/iframe.stories.tsx} +1 -1
  88. package/src/{components → iframe}/iframe.tsx +1 -1
  89. package/src/iframe/index.ts +2 -0
  90. package/src/link/index.ts +2 -0
  91. package/src/{stories/Link.stories.tsx → link/link.stories.tsx} +1 -1
  92. package/src/{components → link}/link.tsx +39 -28
  93. package/src/list/index.parts.ts +2 -0
  94. package/src/list/index.ts +4 -0
  95. package/src/list/list-item.tsx +63 -0
  96. package/src/list/list-root-context.ts +21 -0
  97. package/src/list/list-root.tsx +81 -0
  98. package/src/list/list.css +32 -0
  99. package/src/list/list.stories.tsx +119 -0
  100. package/src/list/list.test.tsx +168 -0
  101. package/src/markdown-container/index.ts +2 -0
  102. package/src/{stories/MarkdownContainer.stories.tsx → markdown-container/markdown-container.stories.tsx} +1 -1
  103. package/src/{components → markdown-container}/markdown-container.tsx +3 -1
  104. package/src/password-input/index.ts +2 -0
  105. package/src/{stories/PasswordInput.stories.tsx → password-input/password-input.stories.tsx} +1 -1
  106. package/src/{components → password-input}/password-input.tsx +4 -4
  107. package/src/picture/index.ts +2 -0
  108. package/src/{stories/Picture.stories.tsx → picture/picture.stories.tsx} +1 -1
  109. package/src/{components → picture}/picture.tsx +2 -4
  110. package/src/protected-email/index.ts +2 -0
  111. package/src/{stories/ProtectedEmail.stories.tsx → protected-email/protected-email.stories.tsx} +1 -1
  112. package/src/{components → protected-email}/protected-email.tsx +3 -1
  113. package/src/tailwind.css +10 -0
  114. package/src/text/index.ts +2 -0
  115. package/src/{stories/Text.stories.tsx → text/text.stories.tsx} +1 -1
  116. package/src/text/text.tsx +46 -0
  117. package/src/utils/author/author.tsx +36 -0
  118. package/src/utils/author/index.ts +1 -0
  119. package/src/utils/text/index.ts +1 -0
  120. package/src/utils/text/text.tsx +103 -0
  121. package/dist/components/box.d.ts +0 -20
  122. package/dist/components/box.js +0 -50
  123. package/dist/components/definition-list.d.ts +0 -43
  124. package/dist/components/definition-list.js +0 -89
  125. package/dist/components/heading.d.ts +0 -27
  126. package/dist/components/highlight.d.ts +0 -19
  127. package/dist/components/item.d.ts +0 -70
  128. package/dist/components/item.js +0 -512
  129. package/dist/components/leaflet-map.d.ts +0 -34
  130. package/dist/components/leaflet-map.js +0 -201
  131. package/dist/components/list-item.d.ts +0 -19
  132. package/dist/components/list-item.js +0 -37
  133. package/dist/components/maptiler-map.d.ts +0 -27
  134. package/dist/components/maptiler-map.js +0 -129
  135. package/dist/components/text.d.ts +0 -20
  136. package/dist/components/text.js +0 -45
  137. package/dist/components/unordered-list.d.ts +0 -19
  138. package/dist/components/unordered-list.js +0 -39
  139. package/dist/hooks/use-nonce.d.ts +0 -12
  140. package/dist/hooks/use-nonce.js +0 -13
  141. package/dist/utils/author.d.ts +0 -9
  142. package/dist/utils/author.js +0 -55
  143. package/dist/utils/cn.d.ts +0 -9
  144. package/dist/utils/cn.js +0 -14
  145. package/dist/utils/is-route-active.d.ts +0 -19
  146. package/dist/utils/is-route-active.js +0 -56
  147. package/dist/utils/text.d.ts +0 -24
  148. package/dist/utils/text.js +0 -127
  149. package/src/components/box.tsx +0 -45
  150. package/src/components/definition-list.tsx +0 -90
  151. package/src/components/item.tsx +0 -340
  152. package/src/components/leaflet-map.tsx +0 -294
  153. package/src/components/link.test.tsx +0 -387
  154. package/src/components/list-item.tsx +0 -30
  155. package/src/components/maptiler-map.tsx +0 -181
  156. package/src/components/text.tsx +0 -38
  157. package/src/components/unordered-list.tsx +0 -32
  158. package/src/hooks/use-nonce.test.ts +0 -35
  159. package/src/stories/Box.stories.tsx +0 -83
  160. package/src/stories/Carousel.stories.tsx +0 -95
  161. package/src/stories/DefinitionList.stories.tsx +0 -51
  162. package/src/stories/Item.stories.tsx +0 -79
  163. package/src/stories/ListItem.stories.tsx +0 -38
  164. package/src/stories/UnorderedList.stories.tsx +0 -73
  165. package/src/styles/tailwind.css +0 -7
  166. package/src/test-setup.ts +0 -1
  167. package/src/utils/author.test.ts +0 -54
  168. package/src/utils/author.tsx +0 -73
  169. package/src/utils/cn.test.ts +0 -48
  170. package/src/utils/cn.ts +0 -14
  171. package/src/utils/is-route-active.test.ts +0 -80
  172. package/src/utils/is-route-active.ts +0 -100
  173. package/src/utils/text.test.ts +0 -152
  174. package/src/utils/text.tsx +0 -209
  175. package/src/vite-env.d.ts +0 -1
  176. /package/dist/{components/background-slideshow.d.ts → background-slideshow/index.d.ts} +0 -0
  177. /package/dist/{components/blurry-gradient.d.ts → blurry-gradient/index.d.ts} +0 -0
  178. /package/dist/{components/countdown.d.ts → countdown/index.d.ts} +0 -0
  179. /package/dist/{components/generic-error.d.ts → generic-error/index.d.ts} +0 -0
  180. /package/dist/hooks/{use-current-route-data.d.ts → use-current-route-data/index.d.ts} +0 -0
  181. /package/dist/hooks/{use-focus-search.d.ts → use-focus-search/index.d.ts} +0 -0
  182. /package/dist/hooks/{use-matches-data.d.ts → use-matches-data/index.d.ts} +0 -0
  183. /package/dist/hooks/{use-media-query.d.ts → use-media-query/index.d.ts} +0 -0
  184. /package/dist/hooks/{use-mobile.d.ts → use-mobile/index.d.ts} +0 -0
  185. /package/dist/hooks/{use-user.d.ts → use-user/index.d.ts} +0 -0
  186. /package/dist/{components/icon-button.d.ts → icon-button/index.d.ts} +0 -0
  187. /package/dist/{components/if.d.ts → if/index.d.ts} +0 -0
  188. /package/dist/{components/iframe.d.ts → iframe/index.d.ts} +0 -0
  189. /package/dist/{components/markdown-container.d.ts → markdown-container/index.d.ts} +0 -0
  190. /package/dist/{components/password-input.d.ts → password-input/index.d.ts} +0 -0
  191. /package/dist/{components/picture.d.ts → picture/index.d.ts} +0 -0
  192. /package/src/hooks/{use-current-route-data.ts → use-current-route-data/use-current-route-data.ts} +0 -0
  193. /package/src/hooks/{use-focus-search.ts → use-focus-search/use-focus-search.ts} +0 -0
  194. /package/src/hooks/{use-matches-data.ts → use-matches-data/use-matches-data.ts} +0 -0
  195. /package/src/hooks/{use-media-query.ts → use-media-query/use-media-query.ts} +0 -0
  196. /package/src/hooks/{use-mobile.ts → use-mobile/use-mobile.ts} +0 -0
  197. /package/src/hooks/{use-nonce.ts → use-nonce/use-nonce.ts} +0 -0
  198. /package/src/hooks/{use-orientation.ts → use-orientation/use-orientation.ts} +0 -0
  199. /package/src/hooks/{use-user.tsx → use-user/use-user.tsx} +0 -0
  200. /package/src/{components → icon-button}/icon-button.tsx +0 -0
  201. /package/src/{components → if}/if.tsx +0 -0
  202. /package/src/{styles/storybook.css → storybook.css} +0 -0
@@ -0,0 +1,239 @@
1
+ import { tv } from '@regardio/tailwind/utils';
2
+ import { forwardRef, createContext, useContext } from 'react';
3
+ import { jsx } from 'react/jsx-runtime';
4
+
5
+ var __defProp = Object.defineProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var gridItem = tv({
11
+ defaultVariants: {
12
+ span: 12
13
+ },
14
+ slots: {
15
+ root: ["relative"]
16
+ },
17
+ variants: {
18
+ end: {
19
+ 1: { root: "col-end-1" },
20
+ 2: { root: "col-end-2" },
21
+ 3: { root: "col-end-3" },
22
+ 4: { root: "col-end-4" },
23
+ 5: { root: "col-end-5" },
24
+ 6: { root: "col-end-6" },
25
+ 7: { root: "col-end-7" },
26
+ 8: { root: "col-end-8" },
27
+ 9: { root: "col-end-9" },
28
+ 10: { root: "col-end-10" },
29
+ 11: { root: "col-end-11" },
30
+ 12: { root: "col-end-12" },
31
+ 13: { root: "col-end-13" },
32
+ auto: { root: "col-end-auto" }
33
+ },
34
+ rowSpan: {
35
+ 1: { root: "row-span-1" },
36
+ 2: { root: "row-span-2" },
37
+ 3: { root: "row-span-3" },
38
+ 4: { root: "row-span-4" },
39
+ 5: { root: "row-span-5" },
40
+ 6: { root: "row-span-6" },
41
+ full: { root: "row-span-full" }
42
+ },
43
+ span: {
44
+ 1: { root: "col-span-1" },
45
+ 2: { root: "col-span-2" },
46
+ 3: { root: "col-span-3" },
47
+ 4: { root: "col-span-4" },
48
+ 5: { root: "col-span-5" },
49
+ 6: { root: "col-span-6" },
50
+ 7: { root: "col-span-7" },
51
+ 8: { root: "col-span-8" },
52
+ 9: { root: "col-span-9" },
53
+ 10: { root: "col-span-10" },
54
+ 11: { root: "col-span-11" },
55
+ 12: { root: "col-span-12" },
56
+ full: { root: "col-span-full" }
57
+ },
58
+ spanLg: {
59
+ 1: { root: "@lg:col-span-1" },
60
+ 2: { root: "@lg:col-span-2" },
61
+ 3: { root: "@lg:col-span-3" },
62
+ 4: { root: "@lg:col-span-4" },
63
+ 5: { root: "@lg:col-span-5" },
64
+ 6: { root: "@lg:col-span-6" },
65
+ 7: { root: "@lg:col-span-7" },
66
+ 8: { root: "@lg:col-span-8" },
67
+ 9: { root: "@lg:col-span-9" },
68
+ 10: { root: "@lg:col-span-10" },
69
+ 11: { root: "@lg:col-span-11" },
70
+ 12: { root: "@lg:col-span-12" },
71
+ full: { root: "@lg:col-span-full" }
72
+ },
73
+ spanMd: {
74
+ 1: { root: "@md:col-span-1" },
75
+ 2: { root: "@md:col-span-2" },
76
+ 3: { root: "@md:col-span-3" },
77
+ 4: { root: "@md:col-span-4" },
78
+ 5: { root: "@md:col-span-5" },
79
+ 6: { root: "@md:col-span-6" },
80
+ 7: { root: "@md:col-span-7" },
81
+ 8: { root: "@md:col-span-8" },
82
+ 9: { root: "@md:col-span-9" },
83
+ 10: { root: "@md:col-span-10" },
84
+ 11: { root: "@md:col-span-11" },
85
+ 12: { root: "@md:col-span-12" },
86
+ full: { root: "@md:col-span-full" }
87
+ },
88
+ spanSm: {
89
+ 1: { root: "@sm:col-span-1" },
90
+ 2: { root: "@sm:col-span-2" },
91
+ 3: { root: "@sm:col-span-3" },
92
+ 4: { root: "@sm:col-span-4" },
93
+ 5: { root: "@sm:col-span-5" },
94
+ 6: { root: "@sm:col-span-6" },
95
+ 7: { root: "@sm:col-span-7" },
96
+ 8: { root: "@sm:col-span-8" },
97
+ 9: { root: "@sm:col-span-9" },
98
+ 10: { root: "@sm:col-span-10" },
99
+ 11: { root: "@sm:col-span-11" },
100
+ 12: { root: "@sm:col-span-12" },
101
+ full: { root: "@sm:col-span-full" }
102
+ },
103
+ spanXl: {
104
+ 1: { root: "@xl:col-span-1" },
105
+ 2: { root: "@xl:col-span-2" },
106
+ 3: { root: "@xl:col-span-3" },
107
+ 4: { root: "@xl:col-span-4" },
108
+ 5: { root: "@xl:col-span-5" },
109
+ 6: { root: "@xl:col-span-6" },
110
+ 7: { root: "@xl:col-span-7" },
111
+ 8: { root: "@xl:col-span-8" },
112
+ 9: { root: "@xl:col-span-9" },
113
+ 10: { root: "@xl:col-span-10" },
114
+ 11: { root: "@xl:col-span-11" },
115
+ 12: { root: "@xl:col-span-12" },
116
+ full: { root: "@xl:col-span-full" }
117
+ },
118
+ spanXs: {
119
+ 1: { root: "@xs:col-span-1" },
120
+ 2: { root: "@xs:col-span-2" },
121
+ 3: { root: "@xs:col-span-3" },
122
+ 4: { root: "@xs:col-span-4" },
123
+ 5: { root: "@xs:col-span-5" },
124
+ 6: { root: "@xs:col-span-6" },
125
+ 7: { root: "@xs:col-span-7" },
126
+ 8: { root: "@xs:col-span-8" },
127
+ 9: { root: "@xs:col-span-9" },
128
+ 10: { root: "@xs:col-span-10" },
129
+ 11: { root: "@xs:col-span-11" },
130
+ 12: { root: "@xs:col-span-12" },
131
+ full: { root: "@xs:col-span-full" }
132
+ },
133
+ start: {
134
+ 1: { root: "col-start-1" },
135
+ 2: { root: "col-start-2" },
136
+ 3: { root: "col-start-3" },
137
+ 4: { root: "col-start-4" },
138
+ 5: { root: "col-start-5" },
139
+ 6: { root: "col-start-6" },
140
+ 7: { root: "col-start-7" },
141
+ 8: { root: "col-start-8" },
142
+ 9: { root: "col-start-9" },
143
+ 10: { root: "col-start-10" },
144
+ 11: { root: "col-start-11" },
145
+ 12: { root: "col-start-12" },
146
+ 13: { root: "col-start-13" },
147
+ auto: { root: "col-start-auto" }
148
+ }
149
+ }
150
+ });
151
+ var GridItem = forwardRef(
152
+ ({
153
+ children,
154
+ className,
155
+ classNames,
156
+ span,
157
+ spanXs,
158
+ spanSm,
159
+ spanMd,
160
+ spanLg,
161
+ spanXl,
162
+ start,
163
+ end,
164
+ rowSpan,
165
+ ...props
166
+ }, ref) => {
167
+ const styles = gridItem({ end, rowSpan, span, spanLg, spanMd, spanSm, spanXl, spanXs, start });
168
+ return /* @__PURE__ */ jsx(
169
+ "div",
170
+ {
171
+ className: styles.root({ className: classNames?.root ?? className }),
172
+ ref,
173
+ ...props,
174
+ children
175
+ }
176
+ );
177
+ }
178
+ );
179
+ GridItem.displayName = "GridItem";
180
+ var grid = tv({
181
+ defaultVariants: {
182
+ flow: "dense"
183
+ },
184
+ slots: {
185
+ root: [
186
+ "u-grid",
187
+ "grid",
188
+ "grid-cols-12",
189
+ "gap-[var(--spacing-grid-gutter)]",
190
+ "w-full",
191
+ "container-[grid]/inline-size"
192
+ ]
193
+ },
194
+ variants: {
195
+ align: {
196
+ center: { root: "content-center" },
197
+ end: { root: "content-end" },
198
+ start: { root: "content-start" },
199
+ stretch: { root: "content-stretch" }
200
+ },
201
+ flow: {
202
+ column: { root: "grid-auto-flow-col" },
203
+ dense: { root: "grid-auto-flow-dense" },
204
+ row: { root: "grid-auto-flow-row" }
205
+ }
206
+ }
207
+ });
208
+ var GridContext = createContext(null);
209
+ function useGrid() {
210
+ const context = useContext(GridContext);
211
+ if (!context) {
212
+ throw new Error("useGrid must be used within a <Grid.Root />");
213
+ }
214
+ return context;
215
+ }
216
+ var GridRoot = forwardRef(
217
+ ({ children, className, classNames, flow, align, ...props }, ref) => {
218
+ const styles = grid({ align, flow });
219
+ return /* @__PURE__ */ jsx(GridContext.Provider, { value: { styles }, children: /* @__PURE__ */ jsx(
220
+ "div",
221
+ {
222
+ className: styles.root({ className: classNames?.root ?? className }),
223
+ ref,
224
+ ...props,
225
+ children
226
+ }
227
+ ) });
228
+ }
229
+ );
230
+ GridRoot.displayName = "GridRoot";
231
+
232
+ // src/grid/index.parts.ts
233
+ var index_parts_exports = {};
234
+ __export(index_parts_exports, {
235
+ Item: () => GridItem,
236
+ Root: () => GridRoot
237
+ });
238
+
239
+ export { index_parts_exports as Grid, gridItem, useGrid };
@@ -0,0 +1,24 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { HTMLAttributes, ElementType } from 'react';
3
+
4
+ declare const levelVariants: {
5
+ readonly 1: readonly ["text-2xl"];
6
+ readonly 2: readonly ["text-xl"];
7
+ readonly 3: readonly ["text-lg"];
8
+ readonly 4: readonly ["text-md"];
9
+ readonly 5: readonly ["text-sm"];
10
+ readonly 6: readonly ["text-xs"];
11
+ };
12
+ type HeadingLevel = keyof typeof levelVariants;
13
+ interface HeadingProps extends HTMLAttributes<HTMLHeadingElement> {
14
+ as?: ElementType;
15
+ className?: string;
16
+ level?: HeadingLevel;
17
+ locale?: string;
18
+ }
19
+ declare const Heading: {
20
+ ({ as, children, className, level, ...props }: HeadingProps): react_jsx_runtime.JSX.Element;
21
+ displayName: string;
22
+ };
23
+
24
+ export { Heading, type HeadingLevel, type HeadingProps };
@@ -1,17 +1,9 @@
1
- import { defineConfig, cx } from 'cva';
2
- import { twMerge } from 'fluid-tailwindcss/tailwind-merge';
1
+ import { tv, cn } from '@regardio/tailwind/utils';
2
+ import { replaceShyInString } from '@regardio/js/text';
3
3
  import React, { isValidElement, cloneElement } from 'react';
4
4
  import { jsx } from 'react/jsx-runtime';
5
5
 
6
- // src/utils/cn.ts
7
- var { cva, compose } = defineConfig({
8
- hooks: {
9
- onComplete: (className) => {
10
- return twMerge(className);
11
- }
12
- }
13
- });
14
- var cn = (...inputs) => twMerge(cx(inputs));
6
+ // src/heading/heading.tsx
15
7
  var lowerCaseSzett = (text, _returnType) => {
16
8
  const processString = (str) => {
17
9
  const parts = str.split(/(ß)/g);
@@ -42,9 +34,6 @@ var lowerCaseSzett = (text, _returnType) => {
42
34
  }
43
35
  return text;
44
36
  };
45
- function replaceShyInString(input) {
46
- return input.replace(/&shy;/g, "\xAD");
47
- }
48
37
  function replaceShyInReactNode(node) {
49
38
  if (typeof node === "string") {
50
39
  return node.replace(/\u00AD/g, "");
@@ -71,31 +60,24 @@ function shy(input) {
71
60
  }
72
61
  return replaceShyInReactNode(input);
73
62
  }
74
- var heading = cva({
63
+ var levelVariants = {
64
+ 1: ["text-2xl"],
65
+ 2: ["text-xl"],
66
+ 3: ["text-lg"],
67
+ 4: ["text-md"],
68
+ 5: ["text-sm"],
69
+ 6: ["text-xs"]
70
+ };
71
+ var heading = tv({
75
72
  base: [],
76
73
  defaultVariants: {
77
74
  level: 3
78
75
  },
79
76
  variants: {
80
- level: {
81
- 1: ["text-2xl"],
82
- 2: ["text-xl"],
83
- 3: ["text-lg"],
84
- 4: ["text-md"],
85
- 5: ["text-sm"],
86
- 6: ["text-xs"]
87
- },
88
- variant: {}
77
+ level: levelVariants
89
78
  }
90
79
  });
91
- var Heading = ({
92
- as,
93
- children,
94
- className,
95
- level = 2,
96
- variant,
97
- ...props
98
- }) => {
80
+ var Heading = ({ as, children, className, level = 2, ...props }) => {
99
81
  const word = lowerCaseSzett(shy(children));
100
82
  const Component = as || `h${level}`;
101
83
  return /* @__PURE__ */ jsx(
@@ -103,8 +85,7 @@ var Heading = ({
103
85
  {
104
86
  className: cn(
105
87
  heading({
106
- level,
107
- variant
88
+ level
108
89
  }),
109
90
  className
110
91
  ),
@@ -0,0 +1,13 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { ComponentProps } from 'react';
3
+
4
+ declare const highlightVariants: {
5
+ readonly primary: readonly ["highlight"];
6
+ };
7
+ type HighlightVariant = keyof typeof highlightVariants;
8
+ interface HighlightProps extends ComponentProps<'mark'> {
9
+ variant?: HighlightVariant;
10
+ }
11
+ declare const Highlight: ({ children, className, variant }: HighlightProps) => react_jsx_runtime.JSX.Element;
12
+
13
+ export { Highlight, type HighlightProps };
@@ -1,31 +1,23 @@
1
- import { defineConfig } from 'cva';
2
- import { twMerge } from 'fluid-tailwindcss/tailwind-merge';
1
+ import { tv } from '@regardio/tailwind/utils';
3
2
  import { jsxs, jsx } from 'react/jsx-runtime';
4
3
 
5
- // src/utils/cn.ts
6
- var { cva, compose } = defineConfig({
7
- hooks: {
8
- onComplete: (className) => {
9
- return twMerge(className);
10
- }
11
- }
12
- });
13
- var li = cva({
4
+ // src/highlight/highlight.tsx
5
+ var highlightVariants = {
6
+ primary: ["highlight"]
7
+ };
8
+ var highlight = tv({
14
9
  defaultVariants: {
15
10
  variant: "primary"
16
11
  },
17
12
  variants: {
18
- variant: {
19
- primary: ["highlight"]
20
- }
13
+ variant: highlightVariants
21
14
  }
22
15
  });
23
- var Highlight = (props) => {
24
- const { children, className, variant } = props;
16
+ var Highlight = ({ children, className, variant }) => {
25
17
  return /* @__PURE__ */ jsxs(
26
18
  "mark",
27
19
  {
28
- className: li({
20
+ className: highlight({
29
21
  className,
30
22
  variant
31
23
  }),
@@ -1,7 +1,7 @@
1
1
  import { useMemo } from 'react';
2
2
  import { useLocation, useMatches } from 'react-router';
3
3
 
4
- // src/hooks/use-current-route-data.ts
4
+ // src/hooks/use-current-route-data/use-current-route-data.ts
5
5
  function useCurrentRouteData() {
6
6
  const location = useLocation();
7
7
  const matchingRoutes = useMatches();
@@ -1,6 +1,6 @@
1
1
  import { useEffect } from 'react';
2
2
 
3
- // src/hooks/use-focus-search.ts
3
+ // src/hooks/use-focus-search/use-focus-search.ts
4
4
  function useFocusSearch(ref) {
5
5
  useEffect(() => {
6
6
  function handleKeyDown(event) {
@@ -1,7 +1,7 @@
1
1
  import { useMemo } from 'react';
2
2
  import { useMatches } from 'react-router';
3
3
 
4
- // src/hooks/use-matches-data.ts
4
+ // src/hooks/use-matches-data/use-matches-data.ts
5
5
  function useMatchesData(id) {
6
6
  const matchingRoutes = useMatches();
7
7
  const route = useMemo(() => {
@@ -1,6 +1,6 @@
1
1
  import { useState, useEffect } from 'react';
2
2
 
3
- // src/hooks/use-media-query.ts
3
+ // src/hooks/use-media-query/use-media-query.ts
4
4
  function useMediaQuery(query) {
5
5
  const [matches, setMatches] = useState(false);
6
6
  useEffect(() => {
@@ -1,6 +1,6 @@
1
1
  import { useState, useEffect } from 'react';
2
2
 
3
- // src/hooks/use-mobile.ts
3
+ // src/hooks/use-mobile/use-mobile.ts
4
4
  var MOBILE_BREAKPOINT = 768;
5
5
  function useIsMobile() {
6
6
  const [isMobile, setIsMobile] = useState(void 0);
@@ -0,0 +1,6 @@
1
+ import * as react from 'react';
2
+
3
+ declare const NonceProvider: react.Provider<string>;
4
+ declare const useNonce: () => string;
5
+
6
+ export { NonceProvider, useNonce };
@@ -0,0 +1,8 @@
1
+ import { createContext, useContext } from 'react';
2
+
3
+ // src/hooks/use-nonce/use-nonce.ts
4
+ var NonceContext = createContext("");
5
+ var NonceProvider = NonceContext.Provider;
6
+ var useNonce = () => useContext(NonceContext);
7
+
8
+ export { NonceProvider, useNonce };
@@ -8,4 +8,4 @@ type Orientation = 'portrait' | 'landscape';
8
8
  */
9
9
  declare function useOrientation(): Orientation;
10
10
 
11
- export { type Orientation, useOrientation };
11
+ export { useOrientation };
@@ -1,6 +1,6 @@
1
1
  import { useState, useEffect } from 'react';
2
2
 
3
- // src/hooks/use-orientation.ts
3
+ // src/hooks/use-orientation/use-orientation.ts
4
4
  function useOrientation() {
5
5
  const [orientation, setOrientation] = useState(() => {
6
6
  if (typeof window !== "undefined") {
@@ -1,7 +1,7 @@
1
1
  import { createContext, useContext } from 'react';
2
2
  import { jsx } from 'react/jsx-runtime';
3
3
 
4
- // src/hooks/use-user.tsx
4
+ // src/hooks/use-user/use-user.tsx
5
5
  var defaultContextValue = {
6
6
  isLoading: false,
7
7
  user: null
@@ -1,6 +1,6 @@
1
1
  import { jsx } from 'react/jsx-runtime';
2
2
 
3
- // src/components/icon-button.tsx
3
+ // src/icon-button/icon-button.tsx
4
4
  var IconButton = (props) => {
5
5
  const { className, icon } = props;
6
6
  const defaultClassName = "p-0";
@@ -1,7 +1,7 @@
1
1
  import { useMemo } from 'react';
2
2
  import { jsx, Fragment } from 'react/jsx-runtime';
3
3
 
4
- // src/components/if.tsx
4
+ // src/if/if.tsx
5
5
  function If({
6
6
  condition,
7
7
  children,
@@ -1,16 +1,7 @@
1
- import { defineConfig, cx } from 'cva';
2
- import { twMerge } from 'fluid-tailwindcss/tailwind-merge';
1
+ import { cn } from '@regardio/tailwind/utils';
3
2
  import { jsx } from 'react/jsx-runtime';
4
3
 
5
- // src/utils/cn.ts
6
- var { cva, compose } = defineConfig({
7
- hooks: {
8
- onComplete: (className) => {
9
- return twMerge(className);
10
- }
11
- }
12
- });
13
- var cn = (...inputs) => twMerge(cx(inputs));
4
+ // src/iframe/iframe.tsx
14
5
  var Iframe = ({ src, title, className }) => /* @__PURE__ */ jsx(
15
6
  "iframe",
16
7
  {
@@ -1,5 +1,3 @@
1
- import * as cva from 'cva';
2
- import { VariantProps } from 'cva';
3
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
4
2
  import * as react from 'react';
5
3
  import { NavLinkProps } from 'react-router';
@@ -21,23 +19,31 @@ interface LinkBaseProps extends Omit<NavLinkProps, 'to'> {
21
19
  viewTransition?: boolean;
22
20
  }
23
21
  declare const LinkBase: ({ className, to, routeKey, children, onClick, viewTransition, ...props }: LinkBaseProps) => react_jsx_runtime.JSX.Element;
24
- declare const link: (props?: ({
25
- arrow?: "darr" | "larr" | "rarr" | "uarr" | undefined;
26
- variant?: "link" | "button" | "primary" | "code" | "navtitle" | "subtitle" | undefined;
27
- } & ({
28
- class?: cva.ClassValue;
29
- className?: never;
30
- } | {
31
- class?: never;
32
- className?: cva.ClassValue;
33
- })) | undefined) => string;
34
- interface LinkProps extends Omit<NavLinkProps, 'to'>, VariantProps<typeof link> {
22
+ declare const arrowVariants: {
23
+ readonly darr: "darr";
24
+ readonly larr: "larr";
25
+ readonly rarr: "rarr";
26
+ readonly uarr: "uarr";
27
+ };
28
+ declare const linkVariants: {
29
+ readonly button: readonly ["block", "button", "mt-s", "relative", "rarr", "text-right", "text-sm", "tracking-wider", "uppercase"];
30
+ readonly code: readonly ["font-monospace"];
31
+ readonly link: readonly ["rarr", "!bg-transparent", "uppercase", "!tracking-wider"];
32
+ readonly navtitle: readonly ["block", "uppercase", "tracking-wider"];
33
+ readonly primary: readonly [];
34
+ readonly subtitle: readonly ["text-lg"];
35
+ };
36
+ type LinkArrow = keyof typeof arrowVariants;
37
+ type LinkVariant = keyof typeof linkVariants;
38
+ interface LinkProps extends Omit<NavLinkProps, 'to'> {
39
+ arrow?: LinkArrow;
35
40
  to?: string | Partial<{
36
41
  pathname?: string;
37
42
  search?: string;
38
43
  hash?: string;
39
44
  }>;
40
45
  routeKey?: string;
46
+ variant?: LinkVariant;
41
47
  viewTransition?: boolean;
42
48
  }
43
49
  declare const Link: ({ arrow, children, className, routeKey, to, variant, viewTransition, ...props }: LinkProps) => react_jsx_runtime.JSX.Element;
@@ -1,17 +1,10 @@
1
+ import { tv } from '@regardio/tailwind/utils';
1
2
  import React, { createContext, useContext, useCallback, isValidElement, cloneElement } from 'react';
2
3
  import { NavLink } from 'react-router';
3
- import { defineConfig } from 'cva';
4
- import { twMerge } from 'fluid-tailwindcss/tailwind-merge';
4
+ import '@regardio/js/text';
5
5
  import { jsx, Fragment } from 'react/jsx-runtime';
6
6
 
7
- // src/components/link.tsx
8
- var { cva, compose } = defineConfig({
9
- hooks: {
10
- onComplete: (className) => {
11
- return twMerge(className);
12
- }
13
- }
14
- });
7
+ // src/link/link.tsx
15
8
  var lowerCaseSzett = (text, _returnType) => {
16
9
  const processString = (str) => {
17
10
  const parts = str.split(/(ß)/g);
@@ -125,36 +118,38 @@ var LinkBase = ({
125
118
  }
126
119
  );
127
120
  };
128
- var link = cva({
121
+ var arrowVariants = {
122
+ darr: "darr",
123
+ larr: "larr",
124
+ rarr: "rarr",
125
+ uarr: "uarr"
126
+ };
127
+ var linkVariants = {
128
+ button: [
129
+ "block",
130
+ "button",
131
+ "mt-s",
132
+ "relative",
133
+ "rarr",
134
+ "text-right",
135
+ "text-sm",
136
+ "tracking-wider",
137
+ "uppercase"
138
+ ],
139
+ code: ["font-monospace"],
140
+ link: ["rarr", "!bg-transparent", "uppercase", "!tracking-wider"],
141
+ navtitle: ["block", "uppercase", "tracking-wider"],
142
+ primary: [],
143
+ subtitle: ["text-lg"]
144
+ };
145
+ var link = tv({
129
146
  base: [],
130
147
  defaultVariants: {
131
148
  variant: "primary"
132
149
  },
133
150
  variants: {
134
- arrow: {
135
- darr: "darr",
136
- larr: "larr",
137
- rarr: "rarr",
138
- uarr: "uarr"
139
- },
140
- variant: {
141
- button: [
142
- "block",
143
- "button",
144
- "mt-s",
145
- "relative",
146
- "rarr",
147
- "text-right",
148
- "text-sm",
149
- "tracking-wider",
150
- "uppercase"
151
- ],
152
- code: ["font-monospace"],
153
- link: ["rarr", "!bg-transparent", "uppercase", "!tracking-wider"],
154
- navtitle: ["block", "uppercase", "tracking-wider"],
155
- primary: [],
156
- subtitle: ["text-lg"]
157
- }
151
+ arrow: arrowVariants,
152
+ variant: linkVariants
158
153
  }
159
154
  });
160
155
  var Link = ({
@@ -173,7 +168,7 @@ var Link = ({
173
168
  ...props,
174
169
  className: link({
175
170
  arrow,
176
- className,
171
+ className: typeof className === "string" ? className : void 0,
177
172
  variant
178
173
  }),
179
174
  routeKey,