@collabchron/notiq 0.3.0 → 1.0.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 (282) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +230 -39
  3. package/dist/CodeActionMenuPlugin-EINOY4U4.mjs +15 -0
  4. package/dist/DynamicBlockComponent-NRQJ4WW4.mjs +161 -0
  5. package/dist/EquationComponent-CB6DFIHV.mjs +154 -0
  6. package/dist/ExcalidrawComponent-XW6646OH.mjs +528 -0
  7. package/dist/ExcalidrawPlugin-ZFHT62IF.mjs +14 -0
  8. package/dist/ExportPlugin-V2RLM63S.mjs +11 -0
  9. package/dist/FloatingLinkEditorPlugin-TRTCMSP4.mjs +12 -0
  10. package/dist/FloatingTextFormatToolbarPlugin-F2GY6LMI.mjs +30 -0
  11. package/dist/HintComponet-BRL6EAMS.mjs +217 -0
  12. package/dist/InlineImageComponent-UWIUWBHI.mjs +453 -0
  13. package/dist/MobileToolbar-BOOZAMQE.mjs +268 -0
  14. package/dist/SlashCommand-GMT5JI33.mjs +28 -0
  15. package/dist/StoryBuilderComponent-JGDBM5JU.mjs +562 -0
  16. package/{src/components/editor/plugins/TableCellActionMenuPlugin/index.tsx → dist/TableCellActionMenuPlugin-PGK2K3VG.mjs} +667 -759
  17. package/{src/components/editor/plugins/TableHoverActionsPlugin/index.tsx → dist/TableHoverActionsPlugin-GJVE6VRW.mjs} +258 -314
  18. package/dist/TemplatePlugin-ZD3QEVTI.mjs +9 -0
  19. package/dist/ToolbarPlugin-YKYA4NB4.mjs +1547 -0
  20. package/dist/babel-JZ2EV6AX.mjs +7233 -0
  21. package/dist/background-color-XZTYLGO2.mjs +362 -0
  22. package/dist/block-format-YJCV2DIY.mjs +15 -0
  23. package/dist/chunk-2FNEAMSP.mjs +127 -0
  24. package/dist/chunk-3CPBODXA.mjs +84 -0
  25. package/dist/chunk-3G37YKTV.mjs +83 -0
  26. package/dist/chunk-3JVFG7ER.mjs +184 -0
  27. package/dist/chunk-456TN7IM.mjs +110 -0
  28. package/dist/chunk-4EXYCTGJ.mjs +27 -0
  29. package/{src/utils/getSelectedNode.ts → dist/chunk-4HBCVSE6.mjs} +26 -27
  30. package/dist/chunk-4MEDW3T6.mjs +125 -0
  31. package/dist/chunk-4VWFVWYP.mjs +36 -0
  32. package/dist/chunk-5BAKY5KN.mjs +84 -0
  33. package/dist/chunk-5QSNIVIG.mjs +333 -0
  34. package/dist/chunk-64Z3FI7T.mjs +37 -0
  35. package/{src/components/editor/nodes/Stepper/index.tsx → dist/chunk-6RNZQOH2.mjs} +214 -260
  36. package/dist/chunk-77KXU36M.mjs +64 -0
  37. package/dist/chunk-77UA6HYR.mjs +165 -0
  38. package/dist/chunk-7NZAPJ4G.mjs +102 -0
  39. package/dist/chunk-7VUMHWWL.mjs +152 -0
  40. package/dist/chunk-AMMKBSST.mjs +1256 -0
  41. package/dist/chunk-BIU7WTLX.mjs +95 -0
  42. package/dist/chunk-EGMI62PP.mjs +83 -0
  43. package/dist/chunk-EHNQD5KO.mjs +88 -0
  44. package/dist/chunk-FSM26655.mjs +37 -0
  45. package/{src/components/editor/nodes/Hint/index.tsx → dist/chunk-G53GLEAY.mjs} +158 -190
  46. package/dist/chunk-GK35L7UY.mjs +28 -0
  47. package/dist/chunk-GXYD4VZM.mjs +193 -0
  48. package/dist/chunk-GYIOYVCN.mjs +538 -0
  49. package/dist/chunk-GZPNVR7L.mjs +157 -0
  50. package/dist/chunk-JXDPPUJI.mjs +52 -0
  51. package/dist/chunk-K36V4SIW.mjs +141 -0
  52. package/dist/chunk-KJ6AJ44Q.mjs +128 -0
  53. package/dist/chunk-KJV3FAZ7.mjs +142 -0
  54. package/{src/components/editor/plugins/ImagesPlugin/index.tsx → dist/chunk-LGG4IUIA.mjs} +189 -222
  55. package/dist/chunk-LQN3CMKV.mjs +1906 -0
  56. package/dist/chunk-N3WN46VL.mjs +236 -0
  57. package/dist/chunk-PBD6LMLC.mjs +366 -0
  58. package/dist/chunk-POGRR73N.mjs +33 -0
  59. package/{src/components/editor/utils/editorFormatting.ts → dist/chunk-PZSUSXQG.mjs} +238 -282
  60. package/dist/chunk-QEIFVK5M.mjs +29 -0
  61. package/dist/chunk-QHIQKMVN.mjs +427 -0
  62. package/dist/chunk-TCYK7DM7.mjs +36 -0
  63. package/dist/chunk-TTHQCW5F.mjs +47 -0
  64. package/dist/chunk-U47ABU5Z.mjs +53 -0
  65. package/dist/chunk-WDG7J2DY.mjs +116 -0
  66. package/dist/chunk-WJRHXI2C.mjs +733 -0
  67. package/dist/chunk-XLER2DHM.mjs +357 -0
  68. package/dist/chunk-XWC4TK2N.mjs +315 -0
  69. package/dist/chunk-YHPNOWFH.mjs +15 -0
  70. package/dist/chunk-YKC3SO4Z.mjs +32 -0
  71. package/dist/chunk-YMBXLRW5.mjs +374 -0
  72. package/dist/chunk-YPHOEJ46.mjs +64 -0
  73. package/dist/chunk-YUDCJRJM.mjs +25 -0
  74. package/dist/chunk-Z4EWP7BI.mjs +65 -0
  75. package/dist/chunk-ZB5LZQKC.mjs +191 -0
  76. package/dist/chunk-ZJRKATOJ.mjs +65 -0
  77. package/dist/color-BPKOPQKN.mjs +12 -0
  78. package/dist/estree-XC56IUFX.mjs +4414 -0
  79. package/dist/font-FEZ3GKSF.mjs +13 -0
  80. package/dist/font-size-EK775WRH.mjs +15 -0
  81. package/dist/html-S3ACX7NI.mjs +2738 -0
  82. package/dist/image-2PJIAYAT.mjs +993 -0
  83. package/dist/index.d.mts +145 -0
  84. package/dist/index.d.ts +145 -0
  85. package/dist/index.js +57855 -0
  86. package/dist/index.mjs +1790 -0
  87. package/dist/insert-gif-SAIDYURE.mjs +100 -0
  88. package/dist/insert-image-U3RJN3OW.mjs +259 -0
  89. package/dist/insert-node-5P2CRJ7S.mjs +201 -0
  90. package/dist/insert-poll-HCPM7MO6.mjs +33 -0
  91. package/dist/insert-table-24XYUS2W.mjs +66 -0
  92. package/dist/markdown-SNVBOSRA.mjs +3487 -0
  93. package/dist/poll-component-2R4MDLHS.mjs +303 -0
  94. package/dist/postcss-ONF3VDIM.mjs +5051 -0
  95. package/dist/standalone-EOIALU3M.mjs +2373 -0
  96. package/dist/stepper-FSARL6X6.mjs +304 -0
  97. package/dist/styles/notiq.css +1149 -0
  98. package/dist/text-align-VLECWO4H.mjs +118 -0
  99. package/dist/text-format-BG5WOOPZ.mjs +16 -0
  100. package/dist/typescript-AMPI6OVS.mjs +13135 -0
  101. package/package.json +67 -11
  102. package/src/styles/notiq.css +1149 -0
  103. package/src/styles/tailwind-plugin.ts +134 -0
  104. package/components.json +0 -21
  105. package/eslint.config.mjs +0 -16
  106. package/next.config.ts +0 -12
  107. package/postcss.config.mjs +0 -5
  108. package/public/file.svg +0 -1
  109. package/public/globe.svg +0 -1
  110. package/public/images/icons/plus.svg +0 -10
  111. package/public/next.svg +0 -1
  112. package/public/vercel.svg +0 -1
  113. package/public/window.svg +0 -1
  114. package/src/app/actions.ts +0 -2
  115. package/src/app/api/ai/route.ts +0 -175
  116. package/src/app/api/edgestore/[...edgestore]/route.ts +0 -28
  117. package/src/app/favicon.ico +0 -0
  118. package/src/app/globals.css +0 -205
  119. package/src/app/layout.tsx +0 -38
  120. package/src/app/page.tsx +0 -12
  121. package/src/components/editor/Core.tsx +0 -220
  122. package/src/components/editor/hooks/instructions-messages.ts +0 -300
  123. package/src/components/editor/hooks/use-mobile.ts +0 -19
  124. package/src/components/editor/hooks/useReport.ts +0 -67
  125. package/src/components/editor/hooks/useResizeObservert.ts +0 -22
  126. package/src/components/editor/index.tsx +0 -39
  127. package/src/components/editor/lexical-on-change.tsx +0 -28
  128. package/src/components/editor/nodes/CollapsibleNode/CollapsibleContainerNode.ts +0 -92
  129. package/src/components/editor/nodes/CollapsibleNode/CollapsibleContentNode.ts +0 -65
  130. package/src/components/editor/nodes/CollapsibleNode/CollapsibleTitleNode.ts +0 -105
  131. package/src/components/editor/nodes/EquationNode/EquationComponent.tsx +0 -143
  132. package/src/components/editor/nodes/EquationNode/EquationNode.tsx +0 -170
  133. package/src/components/editor/nodes/ExcalidrawNode/ExcalidrawComponent.tsx +0 -228
  134. package/src/components/editor/nodes/ExcalidrawNode/ExcalidrawImage.tsx +0 -137
  135. package/src/components/editor/nodes/ExcalidrawNode/ImageResizer.tsx +0 -317
  136. package/src/components/editor/nodes/ExcalidrawNode/index.tsx +0 -204
  137. package/src/components/editor/nodes/FigmaNode/FigmaNode.tsx +0 -134
  138. package/src/components/editor/nodes/Hint/HintComponet.tsx +0 -221
  139. package/src/components/editor/nodes/ImageNode/index.tsx +0 -328
  140. package/src/components/editor/nodes/InlineImageNode/InlineImageComponent.tsx +0 -383
  141. package/src/components/editor/nodes/InlineImageNode/InlineImageNode.css +0 -94
  142. package/src/components/editor/nodes/InlineImageNode/InlineImageNode.tsx +0 -309
  143. package/src/components/editor/nodes/LayoutNode/LayoutContainerNode.ts +0 -146
  144. package/src/components/editor/nodes/LayoutNode/LayoutItemNode.ts +0 -79
  145. package/src/components/editor/nodes/PollNode/index.tsx +0 -204
  146. package/src/components/editor/nodes/TweetNode/index.tsx +0 -214
  147. package/src/components/editor/nodes/index.ts +0 -81
  148. package/src/components/editor/plugins/AutoEmbedPlugin/index.tsx +0 -350
  149. package/src/components/editor/plugins/AutoLinkPlugin/index.tsx +0 -56
  150. package/src/components/editor/plugins/CodeActionMenuPlugin/components/CopyButton.tsx +0 -70
  151. package/src/components/editor/plugins/CodeActionMenuPlugin/components/PrettierButton.tsx +0 -192
  152. package/src/components/editor/plugins/CodeActionMenuPlugin/index.tsx +0 -217
  153. package/src/components/editor/plugins/CodeActionMenuPlugin/utils.ts +0 -26
  154. package/src/components/editor/plugins/CodeHighlightPlugin/index.ts +0 -21
  155. package/src/components/editor/plugins/CollapsiblePlugin/Collapsible.css +0 -76
  156. package/src/components/editor/plugins/CollapsiblePlugin/index.ts +0 -228
  157. package/src/components/editor/plugins/DragDropPastePlugin/index.tsx +0 -44
  158. package/src/components/editor/plugins/DraggableBlockPlugin/index.tsx +0 -52
  159. package/src/components/editor/plugins/EquationsPlugin/index.tsx +0 -85
  160. package/src/components/editor/plugins/ExcalidrawPlugin/index.tsx +0 -98
  161. package/src/components/editor/plugins/FigmaPlugin/index.tsx +0 -42
  162. package/src/components/editor/plugins/FloatingLinkEditorPlugin/index.tsx +0 -445
  163. package/src/components/editor/plugins/FloatingTextFormatToolbarPlugin/index.tsx +0 -275
  164. package/src/components/editor/plugins/InlineImagePlugin/index.tsx +0 -351
  165. package/src/components/editor/plugins/LayoutPlugin/index.tsx +0 -238
  166. package/src/components/editor/plugins/LinkPlugin/index.tsx +0 -36
  167. package/src/components/editor/plugins/LinkWithMetaData/index.tsx +0 -271
  168. package/src/components/editor/plugins/MarkdownShortcutPlugin/index.tsx +0 -11
  169. package/src/components/editor/plugins/MarkdownTransformers/index.tsx +0 -304
  170. package/src/components/editor/plugins/PollPlugin/index.tsx +0 -49
  171. package/src/components/editor/plugins/ShortcutsPlugin/index.tsx +0 -180
  172. package/src/components/editor/plugins/ShortcutsPlugin/shortcuts.ts +0 -253
  173. package/src/components/editor/plugins/SlashCommand/index.tsx +0 -621
  174. package/src/components/editor/plugins/SpeechToTextPlugin/index.ts +0 -127
  175. package/src/components/editor/plugins/TabFocusPlugin/index.ts +0 -58
  176. package/src/components/editor/plugins/TableCellResizer/index.tsx +0 -438
  177. package/src/components/editor/plugins/TablePlugin/index.tsx +0 -99
  178. package/src/components/editor/plugins/ToolbarPlugin/index.tsx +0 -522
  179. package/src/components/editor/plugins/TwitterPlugin/index.ts +0 -35
  180. package/src/components/editor/plugins/YouTubeNode/index.tsx +0 -179
  181. package/src/components/editor/plugins/YouTubePlugin/index.ts +0 -41
  182. package/src/components/editor/themes/editor-theme.ts +0 -113
  183. package/src/components/editor/themes/theme.css +0 -377
  184. package/src/components/editor/utils/ai.ts +0 -291
  185. package/src/components/editor/utils/canUseDOM.ts +0 -12
  186. package/src/components/editor/utils/environment.ts +0 -50
  187. package/src/components/editor/utils/extract-data.ts +0 -166
  188. package/src/components/editor/utils/getAllLexicalChildren.ts +0 -13
  189. package/src/components/editor/utils/getDOMRangeRect.ts +0 -27
  190. package/src/components/editor/utils/getSelectedNode.ts +0 -27
  191. package/src/components/editor/utils/gif.ts +0 -29
  192. package/src/components/editor/utils/invariant.ts +0 -15
  193. package/src/components/editor/utils/setFloatingElemPosition.ts +0 -51
  194. package/src/components/editor/utils/setFloatingElemPositionForLinkEditor.ts +0 -40
  195. package/src/components/editor/utils/setNodePlaceholderFromSelection/getNodePlaceholder.ts +0 -51
  196. package/src/components/editor/utils/setNodePlaceholderFromSelection/setNodePlaceholderFromSelection.ts +0 -15
  197. package/src/components/editor/utils/setNodePlaceholderFromSelection/setPlaceholderOnSelection.ts +0 -114
  198. package/src/components/editor/utils/setNodePlaceholderFromSelection/styles.css +0 -6
  199. package/src/components/editor/utils/url.ts +0 -109
  200. package/src/components/editor/utils/useLayoutEffect.ts +0 -13
  201. package/src/components/providers/QueryProvider.tsx +0 -15
  202. package/src/components/providers/SharedHistoryContext.tsx +0 -28
  203. package/src/components/providers/ToolbarContext.tsx +0 -123
  204. package/src/components/providers/theme-provider.tsx +0 -11
  205. package/src/components/theme/ModeToggle.tsx +0 -40
  206. package/src/components/ui/FileInput.tsx +0 -40
  207. package/src/components/ui/Input.css +0 -32
  208. package/src/components/ui/Select.css +0 -42
  209. package/src/components/ui/Select.tsx +0 -36
  210. package/src/components/ui/TextInput.tsx +0 -48
  211. package/src/components/ui/ai/ai-button.tsx +0 -574
  212. package/src/components/ui/ai/border.tsx +0 -99
  213. package/src/components/ui/ai/placeholder-input-vanish.tsx +0 -282
  214. package/src/components/ui/button.tsx +0 -89
  215. package/src/components/ui/card.tsx +0 -76
  216. package/src/components/ui/checkbox.tsx +0 -30
  217. package/src/components/ui/command.tsx +0 -153
  218. package/src/components/ui/dialog/Dialog.css +0 -25
  219. package/src/components/ui/dialog/Dialog.tsx +0 -34
  220. package/src/components/ui/dialog.tsx +0 -122
  221. package/src/components/ui/drop-downs/background-color.tsx +0 -183
  222. package/src/components/ui/drop-downs/block-format.tsx +0 -159
  223. package/src/components/ui/drop-downs/code.tsx +0 -42
  224. package/src/components/ui/drop-downs/color.tsx +0 -177
  225. package/src/components/ui/drop-downs/font-size.tsx +0 -138
  226. package/src/components/ui/drop-downs/font.tsx +0 -155
  227. package/src/components/ui/drop-downs/index.tsx +0 -122
  228. package/src/components/ui/drop-downs/insert-node.tsx +0 -213
  229. package/src/components/ui/drop-downs/text-align.tsx +0 -123
  230. package/src/components/ui/drop-downs/text-format.tsx +0 -104
  231. package/src/components/ui/dropdown-menu.tsx +0 -201
  232. package/src/components/ui/equation/EquationEditor.css +0 -38
  233. package/src/components/ui/equation/EquationEditor.tsx +0 -56
  234. package/src/components/ui/equation/KatexEquationAlterer.css +0 -41
  235. package/src/components/ui/equation/KatexEquationAlterer.tsx +0 -83
  236. package/src/components/ui/equation/KatexRenderer.tsx +0 -66
  237. package/src/components/ui/excalidraw/ExcalidrawModal.css +0 -64
  238. package/src/components/ui/excalidraw/ExcalidrawModal.tsx +0 -234
  239. package/src/components/ui/excalidraw/Modal.css +0 -62
  240. package/src/components/ui/excalidraw/Modal.tsx +0 -110
  241. package/src/components/ui/hover-card.tsx +0 -29
  242. package/src/components/ui/image/error-image.tsx +0 -17
  243. package/src/components/ui/image/file-upload.tsx +0 -240
  244. package/src/components/ui/image/image-resizer.tsx +0 -297
  245. package/src/components/ui/image/image-toolbar.tsx +0 -264
  246. package/src/components/ui/image/index.tsx +0 -408
  247. package/src/components/ui/image/lazy-image.tsx +0 -68
  248. package/src/components/ui/image/lazy-video.tsx +0 -71
  249. package/src/components/ui/input.tsx +0 -22
  250. package/src/components/ui/models/custom-dialog.tsx +0 -320
  251. package/src/components/ui/models/insert-gif.tsx +0 -90
  252. package/src/components/ui/models/insert-image.tsx +0 -52
  253. package/src/components/ui/models/insert-poll.tsx +0 -29
  254. package/src/components/ui/models/insert-table.tsx +0 -62
  255. package/src/components/ui/models/use-model.tsx +0 -91
  256. package/src/components/ui/poll/poll-component.tsx +0 -304
  257. package/src/components/ui/popover.tsx +0 -33
  258. package/src/components/ui/progress.tsx +0 -28
  259. package/src/components/ui/scroll-area.tsx +0 -48
  260. package/src/components/ui/separator.tsx +0 -31
  261. package/src/components/ui/skeleton.tsx +0 -15
  262. package/src/components/ui/sonner.tsx +0 -31
  263. package/src/components/ui/stepper/step.tsx +0 -179
  264. package/src/components/ui/stepper/stepper.tsx +0 -89
  265. package/src/components/ui/textarea.tsx +0 -22
  266. package/src/components/ui/toggle.tsx +0 -71
  267. package/src/components/ui/tooltip.tsx +0 -32
  268. package/src/components/ui/write/text-format-floting-toolbar.tsx +0 -346
  269. package/src/lib/edgestore.ts +0 -9
  270. package/src/lib/pinecone-client.ts +0 -0
  271. package/src/lib/utils.ts +0 -6
  272. package/src/utils/docSerialization.ts +0 -77
  273. package/src/utils/emoji-list.ts +0 -16615
  274. package/src/utils/getDOMRangeRect.ts +0 -27
  275. package/src/utils/getThemeSelector.ts +0 -25
  276. package/src/utils/isMobileWidth.ts +0 -7
  277. package/src/utils/joinClasses.ts +0 -13
  278. package/src/utils/setFloatingElemPosition.ts +0 -74
  279. package/src/utils/setFloatingElemPositionForLinkEditor.ts +0 -46
  280. package/src/utils/swipe.ts +0 -127
  281. package/src/utils/url.ts +0 -38
  282. package/tsconfig.json +0 -27
@@ -1,99 +0,0 @@
1
- "use client";
2
- import React, { useState, useEffect, useRef } from "react";
3
-
4
- import { motion } from "framer-motion";
5
- import { cn } from "@/lib/utils";
6
-
7
- type Direction = "TOP" | "LEFT" | "BOTTOM" | "RIGHT";
8
-
9
- export function HoverBorderGradient({
10
- children,
11
- containerClassName,
12
- className,
13
- as: Tag = "button",
14
- duration = 1,
15
- clockwise = true,
16
- ...props
17
- }: React.PropsWithChildren<
18
- {
19
- as?: React.ElementType;
20
- containerClassName?: string;
21
- className?: string;
22
- duration?: number;
23
- clockwise?: boolean;
24
- } & React.HTMLAttributes<HTMLElement>
25
- >) {
26
- const [hovered, setHovered] = useState<boolean>(false);
27
- const [direction, setDirection] = useState<Direction>("TOP");
28
-
29
- const rotateDirection = (currentDirection: Direction): Direction => {
30
- const directions: Direction[] = ["TOP", "LEFT", "BOTTOM", "RIGHT"];
31
- const currentIndex = directions.indexOf(currentDirection);
32
- const nextIndex = clockwise
33
- ? (currentIndex - 1 + directions.length) % directions.length
34
- : (currentIndex + 1) % directions.length;
35
- return directions[nextIndex];
36
- };
37
-
38
- const movingMap: Record<Direction, string> = {
39
- TOP: "radial-gradient(20.7% 50% at 50% 0%, hsl(0, 0%, 100%) 0%, rgba(255, 255, 255, 0) 100%)",
40
- LEFT: "radial-gradient(16.6% 43.1% at 0% 50%, hsl(0, 0%, 100%) 0%, rgba(255, 255, 255, 0) 100%)",
41
- BOTTOM:
42
- "radial-gradient(20.7% 50% at 50% 100%, hsl(0, 0%, 100%) 0%, rgba(255, 255, 255, 0) 100%)",
43
- RIGHT:
44
- "radial-gradient(16.2% 41.199999999999996% at 100% 50%, hsl(0, 0%, 100%) 0%, rgba(255, 255, 255, 0) 100%)",
45
- };
46
-
47
- const highlight =
48
- "radial-gradient(75% 181.15942028985506% at 50% 50%, #3275F8 0%, rgba(255, 255, 255, 0) 100%)";
49
-
50
- useEffect(() => {
51
- if (!hovered) {
52
- const interval = setInterval(() => {
53
- setDirection((prevState) => rotateDirection(prevState));
54
- }, duration * 1000);
55
- return () => clearInterval(interval);
56
- }
57
- }, [hovered]);
58
- return (
59
- <Tag
60
- onMouseEnter={(event: React.MouseEvent<HTMLDivElement>) => {
61
- setHovered(true);
62
- }}
63
- onMouseLeave={() => setHovered(false)}
64
- className={cn(
65
- "relative flex rounded-full border content-center bg-black/20 hover:bg-black/10 transition duration-500 dark:bg-white/20 items-center flex-col flex-nowrap justify-center overflow-visible p-px decoration-clone w-fit",
66
- containerClassName
67
- )}
68
- {...props}
69
- >
70
- <div
71
- className={cn(
72
- "w-auto text-white z-10 bg-black rounded-[inherit]",
73
- className
74
- )}
75
- >
76
- {children}
77
- </div>
78
- <motion.div
79
- className={cn(
80
- "flex-none inset-0 overflow-hidden absolute z-0 rounded-[inherit]"
81
- )}
82
- style={{
83
- filter: "blur(2px)",
84
- position: "absolute",
85
- width: "100%",
86
- height: "100%",
87
- }}
88
- initial={{ background: movingMap[direction] }}
89
- animate={{
90
- background: hovered
91
- ? [movingMap[direction], highlight]
92
- : movingMap[direction],
93
- }}
94
- transition={{ ease: "linear", duration: duration ?? 1 }}
95
- />
96
- <div className="bg-black absolute z-1 flex-none inset-[2px] rounded-[100px]" />
97
- </Tag>
98
- );
99
- }
@@ -1,282 +0,0 @@
1
- "use client";
2
-
3
- import { AnimatePresence, motion } from "framer-motion";
4
- import { useCallback, useEffect, useRef, useState } from "react";
5
- import { cn } from "@/lib/utils";
6
-
7
- export function PlaceholdersAndVanishInput({
8
- placeholders,
9
- onChange,
10
- onSubmit,
11
- disabled
12
- }: {
13
- placeholders: string[];
14
- onChange: (e: React.ChangeEvent<HTMLInputElement>) => void;
15
- onSubmit: (e: React.FormEvent<HTMLFormElement>) => void;
16
- disabled:boolean
17
- }) {
18
- const [currentPlaceholder, setCurrentPlaceholder] = useState(0);
19
-
20
-
21
- const intervalRef = useRef<NodeJS.Timeout | null>(null);
22
- const startAnimation = () => {
23
- intervalRef.current = setInterval(() => {
24
- setCurrentPlaceholder((prev) => (prev + 1) % placeholders.length);
25
- }, 3000);
26
- };
27
- const handleVisibilityChange = () => {
28
- if (document.visibilityState !== "visible" && intervalRef.current) {
29
- clearInterval(intervalRef.current); // Clear the interval when the tab is not visible
30
- intervalRef.current = null;
31
- } else if (document.visibilityState === "visible") {
32
- startAnimation(); // Restart the interval when the tab becomes visible
33
- }
34
- };
35
-
36
- useEffect(() => {
37
- startAnimation();
38
- document.addEventListener("visibilitychange", handleVisibilityChange);
39
-
40
- return () => {
41
- if (intervalRef.current) {
42
- clearInterval(intervalRef.current);
43
- }
44
- document.removeEventListener("visibilitychange", handleVisibilityChange);
45
- };
46
- }, [placeholders]);
47
-
48
- const canvasRef = useRef<HTMLCanvasElement>(null);
49
- const newDataRef = useRef<any[]>([]);
50
- const inputRef = useRef<HTMLInputElement>(null);
51
- const [value, setValue] = useState("");
52
- const [animating, setAnimating] = useState(false);
53
-
54
- const draw = useCallback(() => {
55
- if (!inputRef.current) return;
56
- const canvas = canvasRef.current;
57
- if (!canvas) return;
58
- const ctx = canvas.getContext("2d");
59
- if (!ctx) return;
60
-
61
- canvas.width = 800;
62
- canvas.height = 800;
63
- ctx.clearRect(0, 0, 800, 800);
64
- const computedStyles = getComputedStyle(inputRef.current);
65
-
66
- const fontSize = parseFloat(computedStyles.getPropertyValue("font-size"));
67
- ctx.font = `${fontSize * 2}px ${computedStyles.fontFamily}`;
68
- ctx.fillStyle = "#FFF";
69
- ctx.fillText(value, 16, 40);
70
-
71
- const imageData = ctx.getImageData(0, 0, 800, 800);
72
- const pixelData = imageData.data;
73
- const newData: any[] = [];
74
-
75
- for (let t = 0; t < 800; t++) {
76
- let i = 4 * t * 800;
77
- for (let n = 0; n < 800; n++) {
78
- let e = i + 4 * n;
79
- if (
80
- pixelData[e] !== 0 &&
81
- pixelData[e + 1] !== 0 &&
82
- pixelData[e + 2] !== 0
83
- ) {
84
- newData.push({
85
- x: n,
86
- y: t,
87
- color: [
88
- pixelData[e],
89
- pixelData[e + 1],
90
- pixelData[e + 2],
91
- pixelData[e + 3],
92
- ],
93
- });
94
- }
95
- }
96
- }
97
-
98
- newDataRef.current = newData.map(({ x, y, color }) => ({
99
- x,
100
- y,
101
- r: 1,
102
- color: `rgba(${color[0]}, ${color[1]}, ${color[2]}, ${color[3]})`,
103
- }));
104
- }, [value]);
105
-
106
- useEffect(() => {
107
- draw();
108
- }, [value, draw]);
109
-
110
- const animate = (start: number) => {
111
- const animateFrame = (pos: number = 0) => {
112
- requestAnimationFrame(() => {
113
- const newArr = [];
114
- for (let i = 0; i < newDataRef.current.length; i++) {
115
- const current = newDataRef.current[i];
116
- if (current.x < pos) {
117
- newArr.push(current);
118
- } else {
119
- if (current.r <= 0) {
120
- current.r = 0;
121
- continue;
122
- }
123
- current.x += Math.random() > 0.5 ? 1 : -1;
124
- current.y += Math.random() > 0.5 ? 1 : -1;
125
- current.r -= 0.05 * Math.random();
126
- newArr.push(current);
127
- }
128
- }
129
- newDataRef.current = newArr;
130
- const ctx = canvasRef.current?.getContext("2d");
131
- if (ctx) {
132
- ctx.clearRect(pos, 0, 800, 800);
133
- newDataRef.current.forEach((t) => {
134
- const { x: n, y: i, r: s, color: color } = t;
135
- if (n > pos) {
136
- ctx.beginPath();
137
- ctx.rect(n, i, s, s);
138
- ctx.fillStyle = color;
139
- ctx.strokeStyle = color;
140
- ctx.stroke();
141
- }
142
- });
143
- }
144
- if (newDataRef.current.length > 0) {
145
- animateFrame(pos - 8);
146
- } else {
147
- setValue("");
148
- setAnimating(false);
149
- }
150
- });
151
- };
152
- animateFrame(start);
153
- };
154
-
155
- const handleKeyDown = (e: React.KeyboardEvent<HTMLInputElement>) => {
156
- if (e.key === "Enter" && !animating) {
157
- vanishAndSubmit();
158
- }
159
- };
160
-
161
- const vanishAndSubmit = () => {
162
- setAnimating(true);
163
- draw();
164
-
165
- const value = inputRef.current?.value || "";
166
- if (value && inputRef.current) {
167
- const maxX = newDataRef.current.reduce(
168
- (prev, current) => (current.x > prev ? current.x : prev),
169
- 0
170
- );
171
- animate(maxX);
172
- }
173
- };
174
-
175
- const handleSubmit = (e: React.FormEvent<HTMLFormElement>) => {
176
- e.preventDefault();
177
- vanishAndSubmit();
178
- onSubmit && onSubmit(e);
179
- };
180
-
181
- return (
182
- <form
183
-
184
- suppressHydrationWarning
185
- className={cn(
186
- "w-full relative max-w-xl mx-auto h-9 rounded-sm overflow-hidden shadow-[0px_2px_3px_-1px_rgba(0,0,0,0.1),_0px_1px_0px_0px_rgba(25,28,33,0.02),_0px_0px_0px_1px_rgba(25,28,33,0.08)] transition duration-200",
187
- )}
188
- onSubmit={handleSubmit}
189
- >
190
- <canvas
191
- className={cn(
192
- "absolute pointer-events-none text-base transform scale-50 top-[20%] left-2 sm:left-8 origin-top-left filter invert dark:invert-0 pr-20",
193
- !animating ? "opacity-0" : "opacity-100"
194
- )}
195
- ref={canvasRef}
196
- />
197
- <input
198
- disabled={disabled}
199
- onChange={(e) => {
200
- if (!animating) {
201
- setValue(e.target.value);
202
- onChange && onChange(e);
203
- }
204
- }}
205
- onKeyDown={handleKeyDown}
206
- ref={inputRef}
207
- value={value}
208
- type="text"
209
- className={cn(
210
- "w-full relative text-sm sm:text-base z-50 border-none dark:text-white bg-transparent text-black h-full focus:outline-none focus:ring-0 pl-4 sm:pl-10 pr-20",
211
- animating && "text-transparent dark:text-transparent"
212
- )}
213
- />
214
-
215
- <button
216
- disabled={!value || disabled}
217
- type="submit"
218
- className="absolute right-2 top-1/2 z-50 -translate-y-1/2 h-5 w-5 rounded-full disabled:bg-gray-100 bg-black dark:bg-zinc-900 dark:disabled:bg-zinc-800 transition duration-200 flex items-center justify-center"
219
- >
220
- <motion.svg
221
- xmlns="http://www.w3.org/2000/svg"
222
- width="24"
223
- height="24"
224
- viewBox="0 0 24 24"
225
- fill="none"
226
- stroke="currentColor"
227
- strokeWidth="2"
228
- strokeLinecap="round"
229
- strokeLinejoin="round"
230
- className="text-gray-300 h-4 w-4"
231
- >
232
- <path stroke="none" d="M0 0h24v24H0z" fill="none" />
233
- <motion.path
234
- d="M5 12l14 0"
235
- initial={{
236
- strokeDasharray: "50%",
237
- strokeDashoffset: "50%",
238
- }}
239
- animate={{
240
- strokeDashoffset: value ? 0 : "50%",
241
- }}
242
- transition={{
243
- duration: 0.3,
244
- ease: "linear",
245
- }}
246
- />
247
- <path d="M13 18l6 -6" />
248
- <path d="M13 6l6 6" />
249
- </motion.svg>
250
- </button>
251
-
252
- <div className="absolute inset-0 flex items-center rounded-full pointer-events-none">
253
- <AnimatePresence mode="wait">
254
- {!value && (
255
- <motion.p
256
- initial={{
257
- y: 5,
258
- opacity: 0,
259
- }}
260
- key={`current-placeholder-${currentPlaceholder}`}
261
- animate={{
262
- y: 0,
263
- opacity: 1,
264
- }}
265
- exit={{
266
- y: -15,
267
- opacity: 0,
268
- }}
269
- transition={{
270
- duration: 0.3,
271
- ease: "linear",
272
- }}
273
- className="dark:text-zinc-500 text-sm sm:text-base font-normal text-neutral-500 pl-4 sm:pl-12 text-left w-[calc(100%-2rem)] truncate"
274
- >
275
- {placeholders[currentPlaceholder]}
276
- </motion.p>
277
- )}
278
- </AnimatePresence>
279
- </div>
280
- </form>
281
- );
282
- }
@@ -1,89 +0,0 @@
1
- import * as React from "react"
2
- import { Slot } from "@radix-ui/react-slot"
3
- import { cva, type VariantProps } from "class-variance-authority"
4
-
5
- import { cn } from "@/lib/utils"
6
-
7
- import {
8
- Tooltip,
9
- TooltipContent,
10
- TooltipProvider,
11
- TooltipTrigger,
12
- } from "@/components/ui/tooltip"
13
-
14
-
15
- const buttonVariants = cva(
16
- "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
17
- {
18
- variants: {
19
- variant: {
20
- default:
21
- "bg-primary text-primary-foreground shadow hover:bg-primary/90",
22
- destructive:
23
- "bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",
24
- outline:
25
- "border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",
26
- secondary:
27
- "bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",
28
- ghost: "hover:bg-accent hover:text-accent-foreground",
29
- link: "text-primary underline-offset-4 hover:underline",
30
- transparent:"bg-transparent border border-input"
31
- },
32
- size: {
33
- default: "h-9 px-4 py-2",
34
- sm: "h-8 rounded-md px-3 text-xs",
35
- lg: "h-10 rounded-md px-8",
36
- icon: "h-9 w-9",
37
- Toolbar:"h-7 w-7 p-3 ",
38
- custom:""
39
- },
40
- },
41
- defaultVariants: {
42
- variant: "default",
43
- size: "default",
44
- },
45
- }
46
- )
47
-
48
- export interface ButtonProps
49
- extends React.ButtonHTMLAttributes<HTMLButtonElement>,
50
- VariantProps<typeof buttonVariants> {
51
- asChild?: boolean
52
- tip?:string
53
- }
54
-
55
- const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
56
- ({ className, variant, tip, size, asChild = false, ...props }, ref) => {
57
- const Comp = asChild ? Slot : "button";
58
- return (
59
- <>
60
- {!!tip ? (
61
- <TooltipProvider >
62
- <Tooltip >
63
- <TooltipTrigger asChild >
64
- <Comp
65
-
66
- className={cn(buttonVariants({ variant, size, className }))}
67
- ref={ref}
68
- {...props}
69
- />
70
- </TooltipTrigger>
71
- <TooltipContent>
72
- <p>{tip}</p>
73
- </TooltipContent>
74
- </Tooltip>
75
- </TooltipProvider>
76
- ) : (
77
- <Comp
78
- className={cn(buttonVariants({ variant, size, className }))}
79
- ref={ref}
80
- {...props}
81
- />
82
- )}
83
- </>
84
- );
85
- }
86
- );
87
- Button.displayName = "Button"
88
-
89
- export { Button, buttonVariants }
@@ -1,76 +0,0 @@
1
- import * as React from "react"
2
-
3
- import { cn } from "@/lib/utils"
4
-
5
- const Card = React.forwardRef<
6
- HTMLDivElement,
7
- React.HTMLAttributes<HTMLDivElement>
8
- >(({ className, ...props }, ref) => (
9
- <div
10
- ref={ref}
11
- className={cn(
12
- "rounded-xl border bg-card text-card-foreground shadow",
13
- className
14
- )}
15
- {...props}
16
- />
17
- ))
18
- Card.displayName = "Card"
19
-
20
- const CardHeader = React.forwardRef<
21
- HTMLDivElement,
22
- React.HTMLAttributes<HTMLDivElement>
23
- >(({ className, ...props }, ref) => (
24
- <div
25
- ref={ref}
26
- className={cn("flex flex-col space-y-1.5 p-6", className)}
27
- {...props}
28
- />
29
- ))
30
- CardHeader.displayName = "CardHeader"
31
-
32
- const CardTitle = React.forwardRef<
33
- HTMLDivElement,
34
- React.HTMLAttributes<HTMLDivElement>
35
- >(({ className, ...props }, ref) => (
36
- <div
37
- ref={ref}
38
- className={cn("font-semibold leading-none tracking-tight", className)}
39
- {...props}
40
- />
41
- ))
42
- CardTitle.displayName = "CardTitle"
43
-
44
- const CardDescription = React.forwardRef<
45
- HTMLDivElement,
46
- React.HTMLAttributes<HTMLDivElement>
47
- >(({ className, ...props }, ref) => (
48
- <div
49
- ref={ref}
50
- className={cn("text-sm text-muted-foreground", className)}
51
- {...props}
52
- />
53
- ))
54
- CardDescription.displayName = "CardDescription"
55
-
56
- const CardContent = React.forwardRef<
57
- HTMLDivElement,
58
- React.HTMLAttributes<HTMLDivElement>
59
- >(({ className, ...props }, ref) => (
60
- <div ref={ref} className={cn("p-6 ", className)} {...props} />
61
- ))
62
- CardContent.displayName = "CardContent"
63
-
64
- const CardFooter = React.forwardRef<
65
- HTMLDivElement,
66
- React.HTMLAttributes<HTMLDivElement>
67
- >(({ className, ...props }, ref) => (
68
- <div
69
- ref={ref}
70
- className={cn("flex items-center p-6 ", className)}
71
- {...props}
72
- />
73
- ))
74
- CardFooter.displayName = "CardFooter"
75
-
76
- export { Card, CardHeader, CardFooter, CardTitle, CardDescription, CardContent }
@@ -1,30 +0,0 @@
1
- "use client"
2
-
3
- import * as React from "react"
4
- import * as CheckboxPrimitive from "@radix-ui/react-checkbox"
5
- import { Check } from "lucide-react"
6
-
7
- import { cn } from "@/lib/utils"
8
-
9
- const Checkbox = React.forwardRef<
10
- React.ElementRef<typeof CheckboxPrimitive.Root>,
11
- React.ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root>
12
- >(({ className, ...props }, ref) => (
13
- <CheckboxPrimitive.Root
14
- ref={ref}
15
- className={cn(
16
- "peer h-4 w-4 shrink-0 rounded-sm border border-primary shadow focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",
17
- className
18
- )}
19
- {...props}
20
- >
21
- <CheckboxPrimitive.Indicator
22
- className={cn("flex items-center justify-center text-current")}
23
- >
24
- <Check className="h-4 w-4" />
25
- </CheckboxPrimitive.Indicator>
26
- </CheckboxPrimitive.Root>
27
- ))
28
- Checkbox.displayName = CheckboxPrimitive.Root.displayName
29
-
30
- export { Checkbox }