@astra-kit/ui 0.0.0-stage → 0.0.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 (304) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/LICENSE.md +21 -0
  3. package/README.md +384 -2
  4. package/THIRD_PARTY_NOTICES.md +31 -0
  5. package/assets/fonts/geist-LICENSE.txt +93 -0
  6. package/assets/fonts/geist-latin-variable.woff2 +0 -0
  7. package/assets/fonts/ibm-plex-mono-latin-400.woff2 +0 -0
  8. package/assets/fonts/ibm-plex-mono-latin-500.woff2 +0 -0
  9. package/assets/fonts/ibmplexmono-LICENSE.txt +93 -0
  10. package/assets/fonts/inter-LICENSE.txt +93 -0
  11. package/assets/fonts/inter-latin-variable.woff2 +0 -0
  12. package/dist/adapters/unpic-image.d.ts +3 -0
  13. package/dist/adapters/unpic-image.js +98 -0
  14. package/dist/components/account-menu.d.ts +67 -0
  15. package/dist/components/account-menu.js +440 -0
  16. package/dist/components/action-button.d.ts +25 -0
  17. package/dist/components/action-button.js +264 -0
  18. package/dist/components/alert.d.ts +31 -0
  19. package/dist/components/alert.js +503 -0
  20. package/dist/components/animated-collapse.d.ts +19 -0
  21. package/dist/components/animated-collapse.js +170 -0
  22. package/dist/components/animated-count.d.ts +13 -0
  23. package/dist/components/animated-count.js +105 -0
  24. package/dist/components/animated-list-item.d.ts +25 -0
  25. package/dist/components/animated-list-item.js +134 -0
  26. package/dist/components/animated-theme-toggler.d.ts +12 -0
  27. package/dist/components/animated-theme-toggler.js +200 -0
  28. package/dist/components/avatar.d.ts +65 -0
  29. package/dist/components/avatar.js +463 -0
  30. package/dist/components/badge.d.ts +21 -0
  31. package/dist/components/badge.js +297 -0
  32. package/dist/components/button-interaction.d.ts +23 -0
  33. package/dist/components/button-interaction.js +22 -0
  34. package/dist/components/button-label.d.ts +8 -0
  35. package/dist/components/button-label.js +203 -0
  36. package/dist/components/button.d.ts +23 -0
  37. package/dist/components/button.js +145 -0
  38. package/dist/components/calendar.d.ts +47 -0
  39. package/dist/components/calendar.js +155 -0
  40. package/dist/components/card.d.ts +38 -0
  41. package/dist/components/card.js +904 -0
  42. package/dist/components/carousel.d.ts +71 -0
  43. package/dist/components/carousel.js +585 -0
  44. package/dist/components/checkbox.d.ts +15 -0
  45. package/dist/components/checkbox.js +324 -0
  46. package/dist/components/control-button.d.ts +16 -0
  47. package/dist/components/control-button.js +215 -0
  48. package/dist/components/data-table.d.ts +118 -0
  49. package/dist/components/data-table.js +895 -0
  50. package/dist/components/dialog-surface.d.ts +49 -0
  51. package/dist/components/dialog-surface.js +220 -0
  52. package/dist/components/dialog.d.ts +92 -0
  53. package/dist/components/dialog.js +320 -0
  54. package/dist/components/dropdown-menu.d.ts +57 -0
  55. package/dist/components/dropdown-menu.js +107 -0
  56. package/dist/components/field.d.ts +53 -0
  57. package/dist/components/field.js +710 -0
  58. package/dist/components/file-upload.d.ts +88 -0
  59. package/dist/components/file-upload.js +776 -0
  60. package/dist/components/filter-presets-bar.d.ts +73 -0
  61. package/dist/components/filter-presets-bar.js +510 -0
  62. package/dist/components/filter-query-bar.d.ts +21 -0
  63. package/dist/components/filter-query-bar.js +881 -0
  64. package/dist/components/filter-query-grammar.d.ts +188 -0
  65. package/dist/components/filter-query-grammar.js +875 -0
  66. package/dist/components/form.d.ts +29 -0
  67. package/dist/components/form.js +330 -0
  68. package/dist/components/highlighter.d.ts +15 -0
  69. package/dist/components/highlighter.js +152 -0
  70. package/dist/components/hover-card.d.ts +50 -0
  71. package/dist/components/hover-card.js +80 -0
  72. package/dist/components/input-group.d.ts +16 -0
  73. package/dist/components/input-group.js +277 -0
  74. package/dist/components/input.d.ts +17 -0
  75. package/dist/components/input.js +120 -0
  76. package/dist/components/label.d.ts +4 -0
  77. package/dist/components/label.js +43 -0
  78. package/dist/components/link.d.ts +9 -0
  79. package/dist/components/link.js +43 -0
  80. package/dist/components/morph-text.d.ts +14 -0
  81. package/dist/components/morph-text.js +210 -0
  82. package/dist/components/pagination.d.ts +59 -0
  83. package/dist/components/pagination.js +190 -0
  84. package/dist/components/popover.d.ts +17 -0
  85. package/dist/components/popover.js +40 -0
  86. package/dist/components/presence-swap.d.ts +22 -0
  87. package/dist/components/presence-swap.js +209 -0
  88. package/dist/components/primitives/alert-dialog.d.ts +68 -0
  89. package/dist/components/primitives/alert-dialog.js +629 -0
  90. package/dist/components/primitives/avatar.d.ts +46 -0
  91. package/dist/components/primitives/avatar.js +265 -0
  92. package/dist/components/primitives/calendar.d.ts +37 -0
  93. package/dist/components/primitives/calendar.js +1250 -0
  94. package/dist/components/primitives/carousel.d.ts +106 -0
  95. package/dist/components/primitives/carousel.js +928 -0
  96. package/dist/components/primitives/dialog.d.ts +62 -0
  97. package/dist/components/primitives/dialog.js +490 -0
  98. package/dist/components/primitives/dropdown-menu-items.d.ts +59 -0
  99. package/dist/components/primitives/dropdown-menu-items.js +265 -0
  100. package/dist/components/primitives/dropdown-menu.d.ts +64 -0
  101. package/dist/components/primitives/dropdown-menu.js +560 -0
  102. package/dist/components/primitives/hover-card.d.ts +50 -0
  103. package/dist/components/primitives/hover-card.js +507 -0
  104. package/dist/components/primitives/pagination.d.ts +65 -0
  105. package/dist/components/primitives/pagination.js +373 -0
  106. package/dist/components/primitives/popover.d.ts +22 -0
  107. package/dist/components/primitives/popover.js +213 -0
  108. package/dist/components/primitives/select.d.ts +37 -0
  109. package/dist/components/primitives/select.js +428 -0
  110. package/dist/components/primitives/tooltip.d.ts +30 -0
  111. package/dist/components/primitives/tooltip.js +277 -0
  112. package/dist/components/progress-ring.d.ts +20 -0
  113. package/dist/components/progress-ring.js +53 -0
  114. package/dist/components/radio-group.d.ts +34 -0
  115. package/dist/components/radio-group.js +392 -0
  116. package/dist/components/reaction-button.d.ts +30 -0
  117. package/dist/components/reaction-button.js +189 -0
  118. package/dist/components/rich-link-editor.d.ts +25 -0
  119. package/dist/components/rich-link-editor.js +320 -0
  120. package/dist/components/rich-markdown-content.d.ts +10 -0
  121. package/dist/components/rich-markdown-content.js +56 -0
  122. package/dist/components/rich-text-content.d.ts +19 -0
  123. package/dist/components/rich-text-content.js +26 -0
  124. package/dist/components/select.d.ts +55 -0
  125. package/dist/components/select.js +188 -0
  126. package/dist/components/separator.d.ts +3 -0
  127. package/dist/components/separator.js +48 -0
  128. package/dist/components/sheet.d.ts +19 -0
  129. package/dist/components/sheet.js +420 -0
  130. package/dist/components/sidebar-panel-context.d.ts +17 -0
  131. package/dist/components/sidebar-panel-context.js +14 -0
  132. package/dist/components/sidebar.d.ts +195 -0
  133. package/dist/components/sidebar.js +2041 -0
  134. package/dist/components/skeleton.d.ts +23 -0
  135. package/dist/components/skeleton.js +334 -0
  136. package/dist/components/split-button.d.ts +36 -0
  137. package/dist/components/split-button.js +306 -0
  138. package/dist/components/svgs/whatsappIcon.d.ts +3 -0
  139. package/dist/components/svgs/whatsappIcon.js +14 -0
  140. package/dist/components/switch.d.ts +13 -0
  141. package/dist/components/switch.js +444 -0
  142. package/dist/components/table.d.ts +10 -0
  143. package/dist/components/table.js +298 -0
  144. package/dist/components/tabs.d.ts +36 -0
  145. package/dist/components/tabs.js +636 -0
  146. package/dist/components/textarea.d.ts +16 -0
  147. package/dist/components/textarea.js +111 -0
  148. package/dist/components/themed-toaster.d.ts +7 -0
  149. package/dist/components/themed-toaster.js +86 -0
  150. package/dist/components/toaster.d.ts +12 -0
  151. package/dist/components/toaster.js +62 -0
  152. package/dist/components/tooltip.d.ts +43 -0
  153. package/dist/components/tooltip.js +65 -0
  154. package/dist/components/typing-animation.d.ts +34 -0
  155. package/dist/components/typing-animation.js +389 -0
  156. package/dist/constants/action-button.d.ts +20 -0
  157. package/dist/constants/action-button.js +17 -0
  158. package/dist/constants/alert.d.ts +16 -0
  159. package/dist/constants/alert.js +13 -0
  160. package/dist/constants/avatar.d.ts +38 -0
  161. package/dist/constants/avatar.js +32 -0
  162. package/dist/constants/badge.d.ts +6 -0
  163. package/dist/constants/badge.js +6 -0
  164. package/dist/constants/button.d.ts +16 -0
  165. package/dist/constants/button.js +16 -0
  166. package/dist/constants/calendar.d.ts +36 -0
  167. package/dist/constants/calendar.js +34 -0
  168. package/dist/constants/card.d.ts +23 -0
  169. package/dist/constants/card.js +20 -0
  170. package/dist/constants/carousel.d.ts +55 -0
  171. package/dist/constants/carousel.js +74 -0
  172. package/dist/constants/checkbox.d.ts +17 -0
  173. package/dist/constants/checkbox.js +17 -0
  174. package/dist/constants/dialog.d.ts +11 -0
  175. package/dist/constants/dialog.js +10 -0
  176. package/dist/constants/dropdown-menu.d.ts +10 -0
  177. package/dist/constants/dropdown-menu.js +37 -0
  178. package/dist/constants/field.d.ts +24 -0
  179. package/dist/constants/field.js +24 -0
  180. package/dist/constants/hover-card.d.ts +37 -0
  181. package/dist/constants/hover-card.js +85 -0
  182. package/dist/constants/morph-text.d.ts +13 -0
  183. package/dist/constants/morph-text.js +13 -0
  184. package/dist/constants/motion.d.ts +12 -0
  185. package/dist/constants/motion.js +12 -0
  186. package/dist/constants/pagination.d.ts +20 -0
  187. package/dist/constants/pagination.js +20 -0
  188. package/dist/constants/popover.d.ts +7 -0
  189. package/dist/constants/popover.js +33 -0
  190. package/dist/constants/radio-group.d.ts +10 -0
  191. package/dist/constants/radio-group.js +10 -0
  192. package/dist/constants/select.d.ts +7 -0
  193. package/dist/constants/select.js +34 -0
  194. package/dist/constants/sidebar.d.ts +9 -0
  195. package/dist/constants/sidebar.js +17 -0
  196. package/dist/constants/skeleton.d.ts +17 -0
  197. package/dist/constants/skeleton.js +17 -0
  198. package/dist/constants/split-button.d.ts +7 -0
  199. package/dist/constants/split-button.js +5 -0
  200. package/dist/constants/switch.d.ts +33 -0
  201. package/dist/constants/switch.js +41 -0
  202. package/dist/constants/tabs.d.ts +17 -0
  203. package/dist/constants/tabs.js +17 -0
  204. package/dist/constants/toast.d.ts +3 -0
  205. package/dist/constants/toast.js +3 -0
  206. package/dist/constants/tooltip.d.ts +13 -0
  207. package/dist/constants/tooltip.js +52 -0
  208. package/dist/hooks/use-horizontal-swipe.d.ts +23 -0
  209. package/dist/hooks/use-horizontal-swipe.js +80 -0
  210. package/dist/hooks/use-is-hydrated.d.ts +6 -0
  211. package/dist/hooks/use-is-hydrated.js +20 -0
  212. package/dist/hooks/use-mobile.d.ts +1 -0
  213. package/dist/hooks/use-mobile.js +19 -0
  214. package/dist/hooks/use-prefers-reduced-motion.d.ts +2 -0
  215. package/dist/hooks/use-prefers-reduced-motion.js +27 -0
  216. package/dist/hooks/use-rich-link-editor.d.ts +55 -0
  217. package/dist/hooks/use-rich-link-editor.js +515 -0
  218. package/dist/hooks/use-sidebar-persistence.d.ts +6 -0
  219. package/dist/hooks/use-sidebar-persistence.js +52 -0
  220. package/dist/hooks/use-today.d.ts +7 -0
  221. package/dist/hooks/use-today.js +50 -0
  222. package/dist/hooks/use-viewer-time-zone.d.ts +6 -0
  223. package/dist/hooks/use-viewer-time-zone.js +20 -0
  224. package/dist/hooks.d.ts +11 -0
  225. package/dist/hooks.js +11 -0
  226. package/dist/index.d.ts +71 -0
  227. package/dist/index.js +69 -0
  228. package/dist/lib/browser-clipboard.d.ts +13 -0
  229. package/dist/lib/browser-clipboard.js +48 -0
  230. package/dist/lib/column-filter-value.d.ts +12 -0
  231. package/dist/lib/column-filter-value.js +52 -0
  232. package/dist/lib/file-acceptance.d.ts +43 -0
  233. package/dist/lib/file-acceptance.js +107 -0
  234. package/dist/lib/format-file-size.d.ts +16 -0
  235. package/dist/lib/format-file-size.js +34 -0
  236. package/dist/lib/fuzzy-search.d.ts +17 -0
  237. package/dist/lib/fuzzy-search.js +183 -0
  238. package/dist/lib/horizontal-swipe.d.ts +23 -0
  239. package/dist/lib/horizontal-swipe.js +29 -0
  240. package/dist/lib/image-dimensions.d.ts +2 -0
  241. package/dist/lib/image-dimensions.js +7 -0
  242. package/dist/lib/name-initials.d.ts +7 -0
  243. package/dist/lib/name-initials.js +11 -0
  244. package/dist/lib/rich-text/link-markdown-constants.d.ts +147 -0
  245. package/dist/lib/rich-text/link-markdown-constants.js +458 -0
  246. package/dist/lib/rich-text/link-markdown-types.d.ts +53 -0
  247. package/dist/lib/rich-text/link-markdown-types.js +1 -0
  248. package/dist/lib/rich-text/link-markdown.d.ts +193 -0
  249. package/dist/lib/rich-text/link-markdown.js +592 -0
  250. package/dist/lib/rich-text/rich-markdown.d.ts +41 -0
  251. package/dist/lib/rich-text/rich-markdown.js +105 -0
  252. package/dist/lib/rich-text/rich-text-editor-dom.d.ts +26 -0
  253. package/dist/lib/rich-text/rich-text-editor-dom.js +79 -0
  254. package/dist/lib/toast-layer.d.ts +24 -0
  255. package/dist/lib/toast-layer.js +76 -0
  256. package/dist/lib/utils.d.ts +2 -0
  257. package/dist/lib/utils.js +2 -0
  258. package/dist/lib/year-month-filter.d.ts +16 -0
  259. package/dist/lib/year-month-filter.js +46 -0
  260. package/dist/motion/arc-floating-slot.d.ts +40 -0
  261. package/dist/motion/arc-floating-slot.js +177 -0
  262. package/dist/motion/arc-press.d.ts +6 -0
  263. package/dist/motion/arc-press.js +59 -0
  264. package/dist/motion/arc-swap.d.ts +22 -0
  265. package/dist/motion/arc-swap.js +49 -0
  266. package/dist/motion/arc-tokens.d.ts +53 -0
  267. package/dist/motion/arc-tokens.js +73 -0
  268. package/dist/motion/glide-indicator.d.ts +69 -0
  269. package/dist/motion/glide-indicator.js +309 -0
  270. package/dist/motion/glide-slot.d.ts +9 -0
  271. package/dist/motion/glide-slot.js +71 -0
  272. package/dist/motion/motion-slot.d.ts +12 -0
  273. package/dist/motion/motion-slot.js +376 -0
  274. package/dist/motion/overlay-warmth.d.ts +24 -0
  275. package/dist/motion/overlay-warmth.js +70 -0
  276. package/dist/motion/presence.d.ts +40 -0
  277. package/dist/motion/presence.js +101 -0
  278. package/dist/motion/surface-keyframes.d.ts +24 -0
  279. package/dist/motion/surface-keyframes.js +141 -0
  280. package/dist/motion/tokens.d.ts +81 -0
  281. package/dist/motion/tokens.js +67 -0
  282. package/dist/motion/use-attached-element.d.ts +7 -0
  283. package/dist/motion/use-attached-element.js +22 -0
  284. package/dist/motion/use-morph-width.d.ts +13 -0
  285. package/dist/motion/use-morph-width.js +59 -0
  286. package/dist/next.d.ts +14 -0
  287. package/dist/next.js +79 -0
  288. package/dist/providers/astra-ui-provider.d.ts +27 -0
  289. package/dist/providers/astra-ui-provider.js +100 -0
  290. package/dist/providers/native-provider.d.ts +4 -0
  291. package/dist/providers/native-provider.js +45 -0
  292. package/dist/sonner.d.ts +7 -0
  293. package/dist/sonner.js +8 -0
  294. package/dist/styles.css +2 -0
  295. package/dist/tanstack.d.ts +11 -0
  296. package/dist/tanstack.js +50 -0
  297. package/dist/theme.d.ts +3 -0
  298. package/dist/theme.js +1 -0
  299. package/dist/types/data-table.d.ts +27 -0
  300. package/dist/types/data-table.js +1 -0
  301. package/fonts.css +5 -0
  302. package/package.json +450 -4
  303. package/styles.css +4 -0
  304. package/theme.css +248 -0
@@ -0,0 +1,29 @@
1
+ import * as React from "react";
2
+ import type { Label as LabelPrimitive } from "radix-ui";
3
+ import { Slot } from "radix-ui";
4
+ import { type ControllerProps, type FieldPath, type FieldValues } from "react-hook-form";
5
+ declare const Form: <TFieldValues extends FieldValues, TContext = any, TTransformedValues = TFieldValues>({ children, watch, getValues, getErrors, getFieldState, setError, clearErrors, setValue, setValues, trigger, formState, resetField, reset, resetDefaultValues, handleSubmit, unregister, control, register, setFocus, subscribe, }: import("react-hook-form").FormProviderProps<TFieldValues, TContext, TTransformedValues>) => React.JSX.Element;
6
+ declare const FormField: <TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({ ...props }: ControllerProps<TFieldValues, TName>) => React.JSX.Element;
7
+ /**
8
+ * Reads the field and item context shared by the form parts.
9
+ * @returns Accessible ids plus the react-hook-form state of the enclosing field.
10
+ * @throws When used outside `<FormField>`, where no field name is available.
11
+ */
12
+ declare const useFormField: () => {
13
+ invalid: boolean;
14
+ isDirty: boolean;
15
+ isTouched: boolean;
16
+ isValidating: boolean;
17
+ error?: import("react-hook-form").FieldError | undefined;
18
+ id: string;
19
+ name: string;
20
+ formItemId: string;
21
+ formDescriptionId: string;
22
+ formMessageId: string;
23
+ };
24
+ declare function FormItem({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
25
+ declare function FormLabel({ className, ...props }: React.ComponentProps<typeof LabelPrimitive.Root>): React.JSX.Element;
26
+ declare function FormControl({ ...props }: React.ComponentProps<typeof Slot.Root>): React.JSX.Element;
27
+ declare function FormDescription({ className, ...props }: React.ComponentProps<"p">): React.JSX.Element;
28
+ declare function FormMessage({ className, ...props }: React.ComponentProps<"p">): React.JSX.Element | null;
29
+ export { useFormField, Form, FormItem, FormLabel, FormControl, FormDescription, FormMessage, FormField, };
@@ -0,0 +1,330 @@
1
+ "use client";
2
+ import { c as _c } from "react/compiler-runtime";
3
+ import * as React from "react";
4
+ import { Slot } from "radix-ui";
5
+ import { Controller, FormProvider, useFormContext, useFormState } from "react-hook-form";
6
+ import { MotionSlot } from "../motion/motion-slot.js";
7
+ import { cn } from "../lib/utils.js";
8
+ import { Label } from "./label.js";
9
+ import { jsx as _jsx } from "react/jsx-runtime";
10
+ const Form = FormProvider;
11
+ const FormFieldContext = React.createContext({});
12
+ const FormField = (t0) => {
13
+ const $ = _c(9);
14
+ let props;
15
+ if ($[0] !== t0) {
16
+ ({...props} = t0);
17
+ $[0] = t0;
18
+ $[1] = props;
19
+ } else {
20
+ props = $[1];
21
+ }
22
+ let t1;
23
+ if ($[2] !== props.name) {
24
+ t1 = { name: props.name };
25
+ $[2] = props.name;
26
+ $[3] = t1;
27
+ } else {
28
+ t1 = $[3];
29
+ }
30
+ let t2;
31
+ if ($[4] !== props) {
32
+ t2 = /* @__PURE__ */ _jsx(Controller, { ...props });
33
+ $[4] = props;
34
+ $[5] = t2;
35
+ } else {
36
+ t2 = $[5];
37
+ }
38
+ let t3;
39
+ if ($[6] !== t1 || $[7] !== t2) {
40
+ t3 = /* @__PURE__ */ _jsx(FormFieldContext.Provider, {
41
+ value: t1,
42
+ children: t2
43
+ });
44
+ $[6] = t1;
45
+ $[7] = t2;
46
+ $[8] = t3;
47
+ } else {
48
+ t3 = $[8];
49
+ }
50
+ return t3;
51
+ };
52
+ /**
53
+ * Reads the field and item context shared by the form parts.
54
+ * @returns Accessible ids plus the react-hook-form state of the enclosing field.
55
+ * @throws When used outside `<FormField>`, where no field name is available.
56
+ */
57
+ const useFormField = () => {
58
+ const $ = _c(13);
59
+ const fieldContext = React.useContext(FormFieldContext);
60
+ const itemContext = React.useContext(FormItemContext);
61
+ const { getFieldState } = useFormContext();
62
+ let t0;
63
+ if ($[0] !== fieldContext.name) {
64
+ t0 = { name: fieldContext.name };
65
+ $[0] = fieldContext.name;
66
+ $[1] = t0;
67
+ } else {
68
+ t0 = $[1];
69
+ }
70
+ const formState = useFormState(t0);
71
+ if (!fieldContext.name) {
72
+ throw new Error("useFormField: must be used within <FormField>, which provides the field name");
73
+ }
74
+ let t1;
75
+ if ($[2] !== fieldContext.name || $[3] !== formState || $[4] !== getFieldState) {
76
+ t1 = getFieldState(fieldContext.name, formState);
77
+ $[2] = fieldContext.name;
78
+ $[3] = formState;
79
+ $[4] = getFieldState;
80
+ $[5] = t1;
81
+ } else {
82
+ t1 = $[5];
83
+ }
84
+ const fieldState = t1;
85
+ const { id } = itemContext;
86
+ const t2 = `${id}-form-item`;
87
+ const t3 = `${id}-form-item-description`;
88
+ const t4 = `${id}-form-item-message`;
89
+ let t5;
90
+ if ($[6] !== fieldContext.name || $[7] !== fieldState || $[8] !== id || $[9] !== t2 || $[10] !== t3 || $[11] !== t4) {
91
+ t5 = {
92
+ id,
93
+ name: fieldContext.name,
94
+ formItemId: t2,
95
+ formDescriptionId: t3,
96
+ formMessageId: t4,
97
+ ...fieldState
98
+ };
99
+ $[6] = fieldContext.name;
100
+ $[7] = fieldState;
101
+ $[8] = id;
102
+ $[9] = t2;
103
+ $[10] = t3;
104
+ $[11] = t4;
105
+ $[12] = t5;
106
+ } else {
107
+ t5 = $[12];
108
+ }
109
+ return t5;
110
+ };
111
+ const FormItemContext = React.createContext({});
112
+ function FormItem(t0) {
113
+ const $ = _c(13);
114
+ let className;
115
+ let props;
116
+ if ($[0] !== t0) {
117
+ ({className, ...props} = t0);
118
+ $[0] = t0;
119
+ $[1] = className;
120
+ $[2] = props;
121
+ } else {
122
+ className = $[1];
123
+ props = $[2];
124
+ }
125
+ const id = React.useId();
126
+ let t1;
127
+ if ($[3] !== id) {
128
+ t1 = { id };
129
+ $[3] = id;
130
+ $[4] = t1;
131
+ } else {
132
+ t1 = $[4];
133
+ }
134
+ let t2;
135
+ if ($[5] !== className) {
136
+ t2 = cn("grid gap-2", className);
137
+ $[5] = className;
138
+ $[6] = t2;
139
+ } else {
140
+ t2 = $[6];
141
+ }
142
+ let t3;
143
+ if ($[7] !== props || $[8] !== t2) {
144
+ t3 = /* @__PURE__ */ _jsx("div", {
145
+ "data-slot": "form-item",
146
+ className: t2,
147
+ ...props
148
+ });
149
+ $[7] = props;
150
+ $[8] = t2;
151
+ $[9] = t3;
152
+ } else {
153
+ t3 = $[9];
154
+ }
155
+ let t4;
156
+ if ($[10] !== t1 || $[11] !== t3) {
157
+ t4 = /* @__PURE__ */ _jsx(FormItemContext.Provider, {
158
+ value: t1,
159
+ children: t3
160
+ });
161
+ $[10] = t1;
162
+ $[11] = t3;
163
+ $[12] = t4;
164
+ } else {
165
+ t4 = $[12];
166
+ }
167
+ return t4;
168
+ }
169
+ function FormLabel(t0) {
170
+ const $ = _c(10);
171
+ let className;
172
+ let props;
173
+ if ($[0] !== t0) {
174
+ ({className, ...props} = t0);
175
+ $[0] = t0;
176
+ $[1] = className;
177
+ $[2] = props;
178
+ } else {
179
+ className = $[1];
180
+ props = $[2];
181
+ }
182
+ const { error, formItemId } = useFormField();
183
+ const t1 = !!error;
184
+ let t2;
185
+ if ($[3] !== className) {
186
+ t2 = cn("data-[error=true]:text-destructive", className);
187
+ $[3] = className;
188
+ $[4] = t2;
189
+ } else {
190
+ t2 = $[4];
191
+ }
192
+ let t3;
193
+ if ($[5] !== formItemId || $[6] !== props || $[7] !== t1 || $[8] !== t2) {
194
+ t3 = /* @__PURE__ */ _jsx(Label, {
195
+ "data-slot": "form-label",
196
+ "data-error": t1,
197
+ className: t2,
198
+ htmlFor: formItemId,
199
+ ...props
200
+ });
201
+ $[5] = formItemId;
202
+ $[6] = props;
203
+ $[7] = t1;
204
+ $[8] = t2;
205
+ $[9] = t3;
206
+ } else {
207
+ t3 = $[9];
208
+ }
209
+ return t3;
210
+ }
211
+ function FormControl(t0) {
212
+ const $ = _c(7);
213
+ let props;
214
+ if ($[0] !== t0) {
215
+ ({...props} = t0);
216
+ $[0] = t0;
217
+ $[1] = props;
218
+ } else {
219
+ props = $[1];
220
+ }
221
+ const { error, formItemId, formDescriptionId, formMessageId } = useFormField();
222
+ const t1 = !error ? `${formDescriptionId}` : `${formDescriptionId} ${formMessageId}`;
223
+ const t2 = !!error;
224
+ let t3;
225
+ if ($[2] !== formItemId || $[3] !== props || $[4] !== t1 || $[5] !== t2) {
226
+ t3 = /* @__PURE__ */ _jsx(Slot.Root, {
227
+ "data-slot": "form-control",
228
+ id: formItemId,
229
+ "aria-describedby": t1,
230
+ "aria-invalid": t2,
231
+ ...props
232
+ });
233
+ $[2] = formItemId;
234
+ $[3] = props;
235
+ $[4] = t1;
236
+ $[5] = t2;
237
+ $[6] = t3;
238
+ } else {
239
+ t3 = $[6];
240
+ }
241
+ return t3;
242
+ }
243
+ function FormDescription(t0) {
244
+ const $ = _c(9);
245
+ let className;
246
+ let props;
247
+ if ($[0] !== t0) {
248
+ ({className, ...props} = t0);
249
+ $[0] = t0;
250
+ $[1] = className;
251
+ $[2] = props;
252
+ } else {
253
+ className = $[1];
254
+ props = $[2];
255
+ }
256
+ const { formDescriptionId } = useFormField();
257
+ let t1;
258
+ if ($[3] !== className) {
259
+ t1 = cn("text-sm text-muted-foreground", className);
260
+ $[3] = className;
261
+ $[4] = t1;
262
+ } else {
263
+ t1 = $[4];
264
+ }
265
+ let t2;
266
+ if ($[5] !== formDescriptionId || $[6] !== props || $[7] !== t1) {
267
+ t2 = /* @__PURE__ */ _jsx("p", {
268
+ "data-slot": "form-description",
269
+ id: formDescriptionId,
270
+ className: t1,
271
+ ...props
272
+ });
273
+ $[5] = formDescriptionId;
274
+ $[6] = props;
275
+ $[7] = t1;
276
+ $[8] = t2;
277
+ } else {
278
+ t2 = $[8];
279
+ }
280
+ return t2;
281
+ }
282
+ function FormMessage(t0) {
283
+ const $ = _c(10);
284
+ let className;
285
+ let props;
286
+ if ($[0] !== t0) {
287
+ ({className, ...props} = t0);
288
+ $[0] = t0;
289
+ $[1] = className;
290
+ $[2] = props;
291
+ } else {
292
+ className = $[1];
293
+ props = $[2];
294
+ }
295
+ const { error, formMessageId } = useFormField();
296
+ const body = error ? String(error?.message ?? "") : props.children;
297
+ if (!body) {
298
+ return null;
299
+ }
300
+ let t1;
301
+ if ($[3] !== className) {
302
+ t1 = cn("text-sm text-destructive", className);
303
+ $[3] = className;
304
+ $[4] = t1;
305
+ } else {
306
+ t1 = $[4];
307
+ }
308
+ let t2;
309
+ if ($[5] !== body || $[6] !== formMessageId || $[7] !== props || $[8] !== t1) {
310
+ t2 = /* @__PURE__ */ _jsx(MotionSlot, {
311
+ kind: "message",
312
+ children: /* @__PURE__ */ _jsx("p", {
313
+ "data-slot": "form-message",
314
+ id: formMessageId,
315
+ className: t1,
316
+ ...props,
317
+ children: body
318
+ })
319
+ });
320
+ $[5] = body;
321
+ $[6] = formMessageId;
322
+ $[7] = props;
323
+ $[8] = t1;
324
+ $[9] = t2;
325
+ } else {
326
+ t2 = $[9];
327
+ }
328
+ return t2;
329
+ }
330
+ export { useFormField, Form, FormItem, FormLabel, FormControl, FormDescription, FormMessage, FormField };
@@ -0,0 +1,15 @@
1
+ import type React from "react";
2
+ type AnnotationAction = "highlight" | "underline" | "box" | "circle" | "strike-through" | "crossed-off" | "bracket";
3
+ interface HighlighterProps {
4
+ children: React.ReactNode;
5
+ action?: AnnotationAction;
6
+ color?: string;
7
+ strokeWidth?: number;
8
+ animationDuration?: number;
9
+ iterations?: number;
10
+ padding?: number;
11
+ multiline?: boolean;
12
+ isView?: boolean;
13
+ }
14
+ export declare function Highlighter({ children, action, color, strokeWidth, animationDuration, iterations, padding, multiline, isView, }: HighlighterProps): React.JSX.Element;
15
+ export {};
@@ -0,0 +1,152 @@
1
+ "use client";
2
+ import { c as _c } from "react/compiler-runtime";
3
+ import { useEffect, useRef, useState } from "react";
4
+ import { usePrefersReducedMotion } from "../hooks/use-prefers-reduced-motion.js";
5
+ import { annotate } from "rough-notation";
6
+ import { jsx as _jsx } from "react/jsx-runtime";
7
+ export function Highlighter(t0) {
8
+ const $ = _c(18);
9
+ const { children, action: t1, color: t2, strokeWidth: t3, animationDuration: t4, iterations: t5, padding: t6, multiline: t7, isView: t8 } = t0;
10
+ const action = t1 === undefined ? "highlight" : t1;
11
+ const color = t2 === undefined ? "#ffd1dc" : t2;
12
+ const strokeWidth = t3 === undefined ? 1.5 : t3;
13
+ const animationDuration = t4 === undefined ? 600 : t4;
14
+ const iterations = t5 === undefined ? 2 : t5;
15
+ const padding = t6 === undefined ? 2 : t6;
16
+ const multiline = t7 === undefined ? true : t7;
17
+ const isView = t8 === undefined ? false : t8;
18
+ const shouldReduceMotion = usePrefersReducedMotion();
19
+ const elementRef = useRef(null);
20
+ const annotationRef = useRef(null);
21
+ let t9;
22
+ if ($[0] !== isView) {
23
+ t9 = () => !isView || typeof IntersectionObserver === "undefined";
24
+ $[0] = isView;
25
+ $[1] = t9;
26
+ } else {
27
+ t9 = $[1];
28
+ }
29
+ const [isInView, setIsInView] = useState(t9);
30
+ let t10;
31
+ let t11;
32
+ if ($[2] !== isView) {
33
+ t10 = () => {
34
+ if (!isView) {
35
+ return;
36
+ }
37
+ const element = elementRef.current;
38
+ if (!element || typeof IntersectionObserver === "undefined") {
39
+ return;
40
+ }
41
+ const observer = new IntersectionObserver((t12) => {
42
+ const [entry] = t12;
43
+ if (entry.isIntersecting) {
44
+ setIsInView(true);
45
+ observer.disconnect();
46
+ }
47
+ }, { rootMargin: "-10%" });
48
+ observer.observe(element);
49
+ return () => {
50
+ observer.disconnect();
51
+ };
52
+ };
53
+ t11 = [isView];
54
+ $[2] = isView;
55
+ $[3] = t10;
56
+ $[4] = t11;
57
+ } else {
58
+ t10 = $[3];
59
+ t11 = $[4];
60
+ }
61
+ useEffect(t10, t11);
62
+ const shouldShow = !isView || isInView;
63
+ let t12;
64
+ let t13;
65
+ if ($[5] !== action || $[6] !== animationDuration || $[7] !== color || $[8] !== iterations || $[9] !== multiline || $[10] !== padding || $[11] !== shouldReduceMotion || $[12] !== shouldShow || $[13] !== strokeWidth) {
66
+ t12 = () => {
67
+ const element_0 = elementRef.current;
68
+ let resizeObserver = null;
69
+ let redrawFrameId = null;
70
+ if (shouldShow && element_0) {
71
+ const annotationConfig = {
72
+ type: action,
73
+ color,
74
+ strokeWidth,
75
+ animationDuration,
76
+ animate: !shouldReduceMotion,
77
+ iterations,
78
+ padding,
79
+ multiline
80
+ };
81
+ const annotation = annotate(element_0, annotationConfig);
82
+ annotationRef.current = annotation;
83
+ annotation.show();
84
+ if (typeof ResizeObserver !== "undefined") {
85
+ resizeObserver = new ResizeObserver(() => {
86
+ if (redrawFrameId != null) {
87
+ return;
88
+ }
89
+ redrawFrameId = window.requestAnimationFrame(() => {
90
+ redrawFrameId = null;
91
+ annotation.hide();
92
+ annotation.show();
93
+ });
94
+ });
95
+ resizeObserver.observe(element_0);
96
+ }
97
+ }
98
+ return () => {
99
+ if (redrawFrameId != null) {
100
+ window.cancelAnimationFrame(redrawFrameId);
101
+ }
102
+ if (annotationRef.current) {
103
+ annotationRef.current.remove();
104
+ annotationRef.current = null;
105
+ }
106
+ if (resizeObserver) {
107
+ resizeObserver.disconnect();
108
+ }
109
+ };
110
+ };
111
+ t13 = [
112
+ shouldShow,
113
+ shouldReduceMotion,
114
+ action,
115
+ color,
116
+ strokeWidth,
117
+ animationDuration,
118
+ iterations,
119
+ padding,
120
+ multiline
121
+ ];
122
+ $[5] = action;
123
+ $[6] = animationDuration;
124
+ $[7] = color;
125
+ $[8] = iterations;
126
+ $[9] = multiline;
127
+ $[10] = padding;
128
+ $[11] = shouldReduceMotion;
129
+ $[12] = shouldShow;
130
+ $[13] = strokeWidth;
131
+ $[14] = t12;
132
+ $[15] = t13;
133
+ } else {
134
+ t12 = $[14];
135
+ t13 = $[15];
136
+ }
137
+ useEffect(t12, t13);
138
+ let t14;
139
+ if ($[16] !== children) {
140
+ t14 = /* @__PURE__ */ _jsx("span", {
141
+ "data-slot": "highlighter",
142
+ ref: elementRef,
143
+ className: "relative inline-block bg-transparent",
144
+ children
145
+ });
146
+ $[16] = children;
147
+ $[17] = t14;
148
+ } else {
149
+ t14 = $[17];
150
+ }
151
+ return t14;
152
+ }
@@ -0,0 +1,50 @@
1
+ /**
2
+ * Arc's Hover Card (https://uiarc.dev, MIT License, see THIRD_PARTY_NOTICES.md): a read-only preview of a person or
3
+ * link that opens after half a second of hover or on keyboard focus, grows from the trigger edge on a smooth spring
4
+ * and closes fast on leave. While a card is open, and briefly after it closes, moving to another trigger opens its
5
+ * card almost at once and only fades. It follows Arc's closed API, `<HoverCard content={...}>` around its trigger,
6
+ * with Arc's `HoverCardProfile` preset and open state and placement extensions.
7
+ */
8
+ import type { ReactElement, ReactNode } from "react";
9
+ import { HoverCardProfile, type HoverCardProfileProps, type HoverCardStat } from "./primitives/hover-card.js";
10
+ /** Side of the trigger a hover card prefers. */
11
+ export type HoverCardSide = "top" | "bottom" | "left" | "right";
12
+ /** Alignment of the card against its trigger. */
13
+ export type HoverCardAlign = "start" | "center" | "end";
14
+ export type HoverCardProps = {
15
+ /** The trigger, such as a mention button or link. Rendered with `asChild`, so it must accept a ref and be focusable. */
16
+ children: ReactElement;
17
+ /** The preview. `HoverCardProfile` covers people. Keep it read only: focus never moves into the card. */
18
+ content: ReactNode;
19
+ /** Preferred side of the trigger. Defaults to `bottom`. */
20
+ side?: HoverCardSide;
21
+ /** Alignment against the trigger. Defaults to `start`. */
22
+ align?: HoverCardAlign;
23
+ /** Milliseconds of hover before the first card opens. Defaults to 500. */
24
+ openDelay?: number;
25
+ /** Grace, in milliseconds, after the pointer leaves. Defaults to 140. */
26
+ closeDelay?: number;
27
+ /** Class on the card surface. */
28
+ className?: string;
29
+ /** Class on the card surface, merged after `className`. */
30
+ contentClassName?: string;
31
+ /** Gap, in px, between the card and its trigger. Defaults to 8. */
32
+ sideOffset?: number;
33
+ /** Distance, in px, the card keeps from the viewport edges. Defaults to 12. */
34
+ collisionPadding?: number;
35
+ /** Controlled open state. */
36
+ open?: boolean;
37
+ /** Initial open state when uncontrolled. */
38
+ defaultOpen?: boolean;
39
+ /** Called when the card opens or closes, for example to load its data on open. */
40
+ onOpenChange?: (open: boolean) => void;
41
+ };
42
+ /**
43
+ * A read-only preview that opens after a short hover or keyboard focus and stays open while the pointer travels into
44
+ * it.
45
+ * @param props - The trigger, the preview and optional timing, placement and open state.
46
+ * @returns The trigger with its hover card.
47
+ */
48
+ declare function HoverCard({ children, content, side, align, openDelay, closeDelay, className, contentClassName, sideOffset, collisionPadding, open, defaultOpen, onOpenChange, }: HoverCardProps): import("react").JSX.Element;
49
+ export { HoverCard, HoverCardProfile };
50
+ export type { HoverCardProfileProps, HoverCardStat };
@@ -0,0 +1,80 @@
1
+ "use client";
2
+ import { c as _c } from "react/compiler-runtime";
3
+ import { cn } from "../lib/utils.js";
4
+ import { HoverCard as HoverCardRoot, HoverCardContent, HoverCardProfile, HoverCardTrigger } from "./primitives/hover-card.js";
5
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
6
+ /**
7
+ * A read-only preview that opens after a short hover or keyboard focus and stays open while the pointer travels into
8
+ * it.
9
+ * @param props - The trigger, the preview and optional timing, placement and open state.
10
+ * @returns The trigger with its hover card.
11
+ */
12
+ function HoverCard(t0) {
13
+ const $ = _c(20);
14
+ const { children, content, side: t1, align: t2, openDelay, closeDelay, className, contentClassName, sideOffset, collisionPadding, open, defaultOpen, onOpenChange } = t0;
15
+ const side = t1 === undefined ? "bottom" : t1;
16
+ const align = t2 === undefined ? "start" : t2;
17
+ let t3;
18
+ if ($[0] !== children) {
19
+ t3 = /* @__PURE__ */ _jsx(HoverCardTrigger, {
20
+ asChild: true,
21
+ children
22
+ });
23
+ $[0] = children;
24
+ $[1] = t3;
25
+ } else {
26
+ t3 = $[1];
27
+ }
28
+ let t4;
29
+ if ($[2] !== className || $[3] !== contentClassName) {
30
+ t4 = cn(className, contentClassName);
31
+ $[2] = className;
32
+ $[3] = contentClassName;
33
+ $[4] = t4;
34
+ } else {
35
+ t4 = $[4];
36
+ }
37
+ let t5;
38
+ if ($[5] !== align || $[6] !== collisionPadding || $[7] !== content || $[8] !== side || $[9] !== sideOffset || $[10] !== t4) {
39
+ t5 = /* @__PURE__ */ _jsx(HoverCardContent, {
40
+ side,
41
+ align,
42
+ sideOffset,
43
+ collisionPadding,
44
+ className: t4,
45
+ children: content
46
+ });
47
+ $[5] = align;
48
+ $[6] = collisionPadding;
49
+ $[7] = content;
50
+ $[8] = side;
51
+ $[9] = sideOffset;
52
+ $[10] = t4;
53
+ $[11] = t5;
54
+ } else {
55
+ t5 = $[11];
56
+ }
57
+ let t6;
58
+ if ($[12] !== closeDelay || $[13] !== defaultOpen || $[14] !== onOpenChange || $[15] !== open || $[16] !== openDelay || $[17] !== t3 || $[18] !== t5) {
59
+ t6 = /* @__PURE__ */ _jsxs(HoverCardRoot, {
60
+ openDelay,
61
+ closeDelay,
62
+ open,
63
+ defaultOpen,
64
+ onOpenChange,
65
+ children: [t3, t5]
66
+ });
67
+ $[12] = closeDelay;
68
+ $[13] = defaultOpen;
69
+ $[14] = onOpenChange;
70
+ $[15] = open;
71
+ $[16] = openDelay;
72
+ $[17] = t3;
73
+ $[18] = t5;
74
+ $[19] = t6;
75
+ } else {
76
+ t6 = $[19];
77
+ }
78
+ return t6;
79
+ }
80
+ export { HoverCard, HoverCardProfile };
@@ -0,0 +1,16 @@
1
+ import * as React from "react";
2
+ import { type VariantProps } from "class-variance-authority";
3
+ import { ControlButton } from "./control-button.js";
4
+ declare function InputGroup({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
5
+ declare const inputGroupAddonVariants: (props?: ({
6
+ align?: "block-end" | "block-start" | "inline-end" | "inline-start" | null | undefined;
7
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
8
+ declare function InputGroupAddon({ className, align, ...props }: React.ComponentProps<"div"> & VariantProps<typeof inputGroupAddonVariants>): React.JSX.Element;
9
+ declare const inputGroupButtonVariants: (props?: ({
10
+ size?: "icon-sm" | "icon-xs" | "sm" | "xs" | null | undefined;
11
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
12
+ declare function InputGroupButton({ className, type, variant, size, ...props }: Omit<React.ComponentProps<typeof ControlButton>, "size"> & VariantProps<typeof inputGroupButtonVariants>): React.JSX.Element;
13
+ declare function InputGroupText({ className, ...props }: React.ComponentProps<"span">): React.JSX.Element;
14
+ declare function InputGroupInput({ className, ...props }: React.ComponentProps<"input">): React.JSX.Element;
15
+ declare function InputGroupTextarea({ className, ...props }: React.ComponentProps<"textarea">): React.JSX.Element;
16
+ export { InputGroup, InputGroupAddon, InputGroupButton, InputGroupText, InputGroupInput, InputGroupTextarea, };