@hanzo/ui 5.0.2 → 5.1.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 (371) hide show
  1. package/dist/accordion.js +1 -0
  2. package/dist/accordion.mjs +1 -0
  3. package/dist/alert-dialog.js +1 -0
  4. package/dist/alert-dialog.mjs +1 -0
  5. package/dist/alert.js +1 -0
  6. package/dist/alert.mjs +1 -0
  7. package/dist/avatar.js +1 -0
  8. package/dist/avatar.mjs +1 -0
  9. package/dist/badge.js +1 -0
  10. package/dist/badge.mjs +1 -0
  11. package/dist/breadcrumb.js +1 -0
  12. package/dist/breadcrumb.mjs +1 -0
  13. package/dist/calendar.js +1 -0
  14. package/dist/calendar.mjs +1 -0
  15. package/dist/carousel.js +1 -0
  16. package/dist/carousel.mjs +1 -0
  17. package/dist/checkbox.js +1 -0
  18. package/dist/checkbox.mjs +1 -0
  19. package/dist/chunk-3H5S2OQ3.mjs +1 -0
  20. package/dist/chunk-5GRJ7UQX.js +1 -0
  21. package/dist/chunk-63HNMH7C.js +1 -0
  22. package/dist/chunk-72TOQ4DM.mjs +1 -0
  23. package/dist/chunk-7AEFTV5R.mjs +1 -0
  24. package/dist/chunk-7M4AVV2R.js +1 -0
  25. package/dist/chunk-DKPVJSBC.js +1 -0
  26. package/dist/chunk-EI7MMDWY.js +1 -0
  27. package/dist/chunk-GANGDIZG.mjs +1 -0
  28. package/dist/chunk-GRGT2Z4K.js +1 -0
  29. package/dist/chunk-JCUUC6NY.mjs +1 -0
  30. package/dist/chunk-JUQMWLIN.js +1 -0
  31. package/dist/chunk-PRVEIITE.js +1 -0
  32. package/dist/chunk-SH52AKNZ.js +1 -0
  33. package/dist/chunk-TU67EJEW.mjs +1 -0
  34. package/dist/chunk-WN5KN73U.mjs +1 -0
  35. package/dist/chunk-YSXGDEY5.mjs +1 -0
  36. package/dist/chunk-Z76OOVUE.mjs +1 -0
  37. package/dist/collapsible.js +1 -0
  38. package/dist/collapsible.mjs +1 -0
  39. package/dist/command.js +1 -0
  40. package/dist/command.mjs +1 -0
  41. package/dist/context-menu.js +1 -0
  42. package/dist/context-menu.mjs +1 -0
  43. package/dist/dialog.js +1 -0
  44. package/dist/dialog.mjs +1 -0
  45. package/dist/drawer.js +1 -0
  46. package/dist/drawer.mjs +1 -0
  47. package/dist/dropdown-menu.js +1 -0
  48. package/dist/dropdown-menu.mjs +1 -0
  49. package/dist/form.js +1 -0
  50. package/dist/form.mjs +1 -0
  51. package/dist/hover-card.js +1 -0
  52. package/dist/hover-card.mjs +1 -0
  53. package/dist/index.js +1 -9079
  54. package/dist/index.mjs +1 -8700
  55. package/dist/input-otp.js +1 -0
  56. package/dist/input-otp.mjs +1 -0
  57. package/dist/lib/utils.js +1 -0
  58. package/dist/lib/utils.mjs +1 -0
  59. package/dist/navigation-menu.js +1 -0
  60. package/dist/navigation-menu.mjs +1 -0
  61. package/dist/popover.js +1 -0
  62. package/dist/popover.mjs +1 -0
  63. package/dist/progress.js +1 -0
  64. package/dist/progress.mjs +1 -0
  65. package/dist/radio-group.js +1 -0
  66. package/dist/radio-group.mjs +1 -0
  67. package/dist/resizable.js +1 -0
  68. package/dist/resizable.mjs +1 -0
  69. package/dist/scroll-area.js +1 -0
  70. package/dist/scroll-area.mjs +1 -0
  71. package/dist/select.js +1 -0
  72. package/dist/select.mjs +1 -0
  73. package/dist/separator.js +1 -0
  74. package/dist/separator.mjs +1 -0
  75. package/dist/sheet.js +1 -0
  76. package/dist/sheet.mjs +1 -0
  77. package/dist/skeleton.js +1 -0
  78. package/dist/skeleton.mjs +1 -0
  79. package/dist/slider.js +1 -0
  80. package/dist/slider.mjs +1 -0
  81. package/dist/sonner.js +1 -0
  82. package/dist/sonner.mjs +1 -0
  83. package/dist/src/utils.js +1 -0
  84. package/dist/src/utils.mjs +1 -0
  85. package/dist/switch.js +1 -0
  86. package/dist/switch.mjs +1 -0
  87. package/dist/table.js +1 -0
  88. package/dist/table.mjs +1 -0
  89. package/dist/tabs.js +1 -0
  90. package/dist/tabs.mjs +1 -0
  91. package/dist/tailwind/index.js +1 -0
  92. package/dist/tailwind/index.mjs +1 -0
  93. package/dist/textarea.js +1 -0
  94. package/dist/textarea.mjs +1 -0
  95. package/dist/toggle-group.js +1 -0
  96. package/dist/toggle-group.mjs +1 -0
  97. package/dist/toggle.js +1 -0
  98. package/dist/toggle.mjs +1 -0
  99. package/dist/tooltip.js +1 -0
  100. package/dist/tooltip.mjs +1 -0
  101. package/dist/types/index.js +1 -0
  102. package/dist/types/index.mjs +1 -0
  103. package/package.json +110 -81
  104. package/assets/ai-icons.tsx +0 -207
  105. package/assets/crypto.tsx +0 -33
  106. package/assets/file-type-icon.tsx +0 -66
  107. package/assets/file.tsx +0 -45
  108. package/assets/general.tsx +0 -2318
  109. package/assets/hanzo-logo.svg +0 -9
  110. package/assets/hanzo-logo.tsx +0 -17
  111. package/assets/index.ts +0 -122
  112. package/assets/index.tsx +0 -4
  113. package/assets/llm-provider.tsx +0 -1094
  114. package/blocks/auth/index.ts +0 -6
  115. package/blocks/auth/login-2fa.tsx +0 -165
  116. package/blocks/auth/login-basic.tsx +0 -94
  117. package/blocks/auth/login-social.tsx +0 -148
  118. package/blocks/auth/magic-link.tsx +0 -129
  119. package/blocks/auth/password-reset.tsx +0 -97
  120. package/blocks/auth/signup.tsx +0 -157
  121. package/blocks/components/accordian-block.tsx +0 -48
  122. package/blocks/components/block-component-props.ts +0 -11
  123. package/blocks/components/bullet-cards-block.tsx +0 -46
  124. package/blocks/components/card-block/index.tsx +0 -171
  125. package/blocks/components/card-block/link-out-button.tsx +0 -20
  126. package/blocks/components/card-block/util.ts +0 -28
  127. package/blocks/components/carte-blanche-block/index.tsx +0 -127
  128. package/blocks/components/carte-blanche-block/variant-content-left.tsx +0 -49
  129. package/blocks/components/content.tsx +0 -70
  130. package/blocks/components/cta-block.tsx +0 -115
  131. package/blocks/components/enh-heading-block.tsx +0 -204
  132. package/blocks/components/grid-block/grid-block-mutator.ts +0 -12
  133. package/blocks/components/grid-block/index.tsx +0 -83
  134. package/blocks/components/grid-block/mutator-registry.ts +0 -10
  135. package/blocks/components/grid-block/table-borders.mutator.ts +0 -47
  136. package/blocks/components/group-block.tsx +0 -83
  137. package/blocks/components/heading-block.tsx +0 -88
  138. package/blocks/components/image-block.tsx +0 -111
  139. package/blocks/components/index.ts +0 -30
  140. package/blocks/components/screenful-block/content.tsx +0 -123
  141. package/blocks/components/screenful-block/index.tsx +0 -107
  142. package/blocks/components/screenful-block/poster-background.tsx +0 -34
  143. package/blocks/components/screenful-block/video-background.tsx +0 -45
  144. package/blocks/components/space-block.tsx +0 -66
  145. package/blocks/components/video-block.tsx +0 -138
  146. package/blocks/data-display/activity-feed.tsx +0 -242
  147. package/blocks/data-display/data-table.tsx +0 -235
  148. package/blocks/data-display/stats-grid.tsx +0 -194
  149. package/blocks/def/accordian-block.ts +0 -14
  150. package/blocks/def/block.ts +0 -7
  151. package/blocks/def/bullet-cards-block.ts +0 -22
  152. package/blocks/def/card-block.ts +0 -22
  153. package/blocks/def/carte-blanche-block.ts +0 -21
  154. package/blocks/def/cta-block.ts +0 -19
  155. package/blocks/def/element-block.ts +0 -11
  156. package/blocks/def/enh-heading-block.ts +0 -44
  157. package/blocks/def/grid-block.ts +0 -16
  158. package/blocks/def/group-block.ts +0 -11
  159. package/blocks/def/heading-block.ts +0 -15
  160. package/blocks/def/image-block.ts +0 -31
  161. package/blocks/def/index.ts +0 -35
  162. package/blocks/def/screenful-block.ts +0 -54
  163. package/blocks/def/space-block.ts +0 -64
  164. package/blocks/def/video-block.ts +0 -9
  165. package/blocks/ecommerce/checkout.tsx +0 -242
  166. package/blocks/ecommerce/index.ts +0 -7
  167. package/blocks/ecommerce/product-detail.tsx +0 -257
  168. package/blocks/ecommerce/product-grid.tsx +0 -148
  169. package/blocks/ecommerce/shopping-cart.tsx +0 -181
  170. package/blocks/index.ts +0 -2
  171. package/blocks/marketing/cta-section.tsx +0 -207
  172. package/blocks/marketing/faq.tsx +0 -159
  173. package/blocks/marketing/features-grid.tsx +0 -156
  174. package/blocks/marketing/hero-section.tsx +0 -192
  175. package/blocks/marketing/index.ts +0 -6
  176. package/blocks/marketing/pricing-table.tsx +0 -121
  177. package/blocks/marketing/testimonials.tsx +0 -196
  178. package/components/index.ts +0 -9
  179. package/dist/index.js.map +0 -1
  180. package/dist/index.mjs.map +0 -1
  181. package/dist/tailwind.js +0 -2025
  182. package/dist/tailwind.js.map +0 -1
  183. package/dist/tailwind.mjs +0 -2013
  184. package/dist/tailwind.mjs.map +0 -1
  185. package/dist/types.js +0 -59
  186. package/dist/types.js.map +0 -1
  187. package/dist/types.mjs +0 -53
  188. package/dist/types.mjs.map +0 -1
  189. package/dist/utils.js +0 -30
  190. package/dist/utils.js.map +0 -1
  191. package/dist/utils.mjs +0 -26
  192. package/dist/utils.mjs.map +0 -1
  193. package/frameworks/core/index.ts +0 -6
  194. package/frameworks/core/utils/index.ts +0 -64
  195. package/frameworks/react/components/button.tsx +0 -26
  196. package/frameworks/react/components/index.ts +0 -5
  197. package/frameworks/react/hooks/index.ts +0 -5
  198. package/frameworks/react/index.ts +0 -9
  199. package/frameworks/react/package.json +0 -8
  200. package/frameworks/react/utils/index.ts +0 -2
  201. package/frameworks/react-native/index.ts +0 -9
  202. package/frameworks/react-native/package.json +0 -8
  203. package/frameworks/registry.json +0 -371
  204. package/frameworks/setup.sh +0 -69
  205. package/frameworks/svelte/index.ts +0 -9
  206. package/frameworks/svelte/package.json +0 -8
  207. package/frameworks/tracker.json +0 -1854
  208. package/frameworks/vue/index.ts +0 -9
  209. package/frameworks/vue/package.json +0 -8
  210. package/helpers/file.ts +0 -33
  211. package/helpers/memoization.ts +0 -40
  212. package/primitives/accordion.tsx +0 -74
  213. package/primitives/action-button.tsx +0 -42
  214. package/primitives/alert-dialog.tsx +0 -185
  215. package/primitives/alert.tsx +0 -74
  216. package/primitives/apply-typography.tsx +0 -55
  217. package/primitives/aspect-ratio.tsx +0 -5
  218. package/primitives/avatar.tsx +0 -57
  219. package/primitives/background-beams.tsx +0 -142
  220. package/primitives/badge.tsx +0 -45
  221. package/primitives/breadcrumb.tsx +0 -130
  222. package/primitives/breakpoint-indicator.tsx +0 -19
  223. package/primitives/button.tsx +0 -72
  224. package/primitives/calendar.tsx +0 -72
  225. package/primitives/card.tsx +0 -97
  226. package/primitives/carousel.tsx +0 -238
  227. package/primitives/chat/chat-input-area.tsx +0 -88
  228. package/primitives/chat/chat-input.tsx +0 -71
  229. package/primitives/chat/files-preview.tsx +0 -331
  230. package/primitives/chat/index.ts +0 -6
  231. package/primitives/chat/json-form.tsx +0 -8
  232. package/primitives/chat/message-list.tsx +0 -308
  233. package/primitives/chat/message.tsx +0 -569
  234. package/primitives/chat/sqlite-preview.tsx +0 -215
  235. package/primitives/checkbox.tsx +0 -32
  236. package/primitives/collapsible.tsx +0 -9
  237. package/primitives/combobox.tsx +0 -239
  238. package/primitives/command.tsx +0 -151
  239. package/primitives/context-menu.tsx +0 -206
  240. package/primitives/copy-to-clipboard-icon.tsx +0 -60
  241. package/primitives/dialog-video-controller.tsx +0 -38
  242. package/primitives/dialog.tsx +0 -128
  243. package/primitives/dot-pattern.tsx +0 -57
  244. package/primitives/dots-loader.tsx +0 -13
  245. package/primitives/drawer.tsx +0 -113
  246. package/primitives/dropdown-menu.tsx +0 -199
  247. package/primitives/error-message.tsx +0 -19
  248. package/primitives/file-uploader.tsx +0 -203
  249. package/primitives/form.tsx +0 -185
  250. package/primitives/hover-card.tsx +0 -28
  251. package/primitives/icons/github.tsx +0 -14
  252. package/primitives/icons/index.ts +0 -18
  253. package/primitives/icons/youtube-logo.tsx +0 -59
  254. package/primitives/index-client.ts +0 -4
  255. package/primitives/index-common.ts +0 -304
  256. package/primitives/index-next.ts +0 -4
  257. package/primitives/input-otp.tsx +0 -65
  258. package/primitives/input.tsx +0 -128
  259. package/primitives/label.tsx +0 -21
  260. package/primitives/list-adaptor.ts +0 -12
  261. package/primitives/list-box.tsx +0 -74
  262. package/primitives/loading-spinner.tsx +0 -33
  263. package/primitives/markdown-preview.tsx +0 -612
  264. package/primitives/mermaid.tsx +0 -196
  265. package/primitives/navigation-menu.tsx +0 -147
  266. package/primitives/next/image.tsx +0 -91
  267. package/primitives/next/index.ts +0 -7
  268. package/primitives/next/inline-icon.tsx +0 -36
  269. package/primitives/next/link-element.tsx +0 -109
  270. package/primitives/next/mdx-link.tsx +0 -22
  271. package/primitives/next/media-stack.tsx +0 -52
  272. package/primitives/next/nav-items.tsx +0 -45
  273. package/primitives/next/youtube-embed.tsx +0 -83
  274. package/primitives/pagination.tsx +0 -117
  275. package/primitives/popover.tsx +0 -34
  276. package/primitives/pretty-json-print.tsx +0 -28
  277. package/primitives/progress.tsx +0 -27
  278. package/primitives/prompt-textarea.tsx +0 -72
  279. package/primitives/qr-code.tsx +0 -112
  280. package/primitives/radio-group.tsx +0 -42
  281. package/primitives/resizable.tsx +0 -47
  282. package/primitives/scroll-area.tsx +0 -57
  283. package/primitives/search-input.tsx +0 -66
  284. package/primitives/select.tsx +0 -122
  285. package/primitives/separator.tsx +0 -26
  286. package/primitives/sheet.tsx +0 -139
  287. package/primitives/skeleton.tsx +0 -18
  288. package/primitives/slider.tsx +0 -63
  289. package/primitives/sonner.tsx +0 -35
  290. package/primitives/step-indicator.tsx +0 -69
  291. package/primitives/stepper.tsx +0 -272
  292. package/primitives/switch.tsx +0 -27
  293. package/primitives/table.tsx +0 -105
  294. package/primitives/tabs.tsx +0 -50
  295. package/primitives/text-area.tsx +0 -26
  296. package/primitives/text-link.tsx +0 -27
  297. package/primitives/textarea.tsx +0 -64
  298. package/primitives/textfield.tsx +0 -78
  299. package/primitives/toast.tsx +0 -30
  300. package/primitives/toggle-group.tsx +0 -63
  301. package/primitives/toggle.tsx +0 -44
  302. package/primitives/tooltip.tsx +0 -47
  303. package/primitives/video-player.tsx +0 -23
  304. package/src/button.ts +0 -1
  305. package/src/hooks/index.ts +0 -7
  306. package/src/hooks/use-click-away.ts +0 -31
  307. package/src/hooks/use-combined-refs.ts +0 -22
  308. package/src/hooks/use-copy-clipboard.ts +0 -30
  309. package/src/hooks/use-debounce.ts +0 -17
  310. package/src/hooks/use-fill-ids.ts +0 -25
  311. package/src/hooks/use-map.ts +0 -26
  312. package/src/hooks/use-measure.ts +0 -42
  313. package/src/hooks/use-reverse-video-playback.ts +0 -43
  314. package/src/hooks/use-scroll-restoration.ts +0 -50
  315. package/src/index-lean.ts +0 -87
  316. package/src/index.ts +0 -54
  317. package/src/mcp/README.md +0 -141
  318. package/src/mcp/enhanced-server.ts +0 -1208
  319. package/src/mcp/index.ts +0 -518
  320. package/src/mcp/package.json +0 -10
  321. package/src/registry/api.ts +0 -164
  322. package/src/registry/index.ts +0 -60
  323. package/src/registry/package.json +0 -10
  324. package/src/utils.ts +0 -19
  325. package/tailwind/colors.tailwind.js +0 -53
  326. package/tailwind/fontFamily.tailwind.ts +0 -7
  327. package/tailwind/fontSize.tailwind.ts +0 -13
  328. package/tailwind/index.ts +0 -7
  329. package/tailwind/safelist.tailwind.js +0 -26
  330. package/tailwind/screens.tailwind.js +0 -8
  331. package/tailwind/spacing.tailwind.js +0 -65
  332. package/tailwind/tailwind.config.hanzo-preset.d.ts +0 -5
  333. package/tailwind/tailwind.config.hanzo-preset.js +0 -915
  334. package/tailwind/tw-font-desc.ts +0 -15
  335. package/tailwind/typo-plugin/get-plugin-styles.js +0 -679
  336. package/tailwind/typo-plugin/index.d.ts +0 -9
  337. package/tailwind/typo-plugin/index.js +0 -141
  338. package/tailwind/typo-plugin/utils.js +0 -60
  339. package/tailwind/typography-test.mdx +0 -35
  340. package/tailwind/z-index.tailwind.js +0 -71
  341. package/types/animation-def.ts +0 -3
  342. package/types/breakpoints.ts +0 -11
  343. package/types/bullet-item.ts +0 -10
  344. package/types/button-def.ts +0 -39
  345. package/types/dimensions.ts +0 -8
  346. package/types/grid-def.ts +0 -56
  347. package/types/image-def.ts +0 -32
  348. package/types/index.ts +0 -30
  349. package/types/link-def.ts +0 -56
  350. package/types/media-stack-def.ts +0 -31
  351. package/types/t-shirt-size.ts +0 -5
  352. package/types/tshirt-dimensions.ts +0 -20
  353. package/types/video-def.ts +0 -25
  354. package/util/blob.ts +0 -33
  355. package/util/copy-to-clipboard.ts +0 -17
  356. package/util/create-shadow-root.ts +0 -22
  357. package/util/date.ts +0 -84
  358. package/util/debounce.ts +0 -11
  359. package/util/file.ts +0 -15
  360. package/util/format-and-abbreviate-as-currency.ts +0 -125
  361. package/util/format-text.ts +0 -34
  362. package/util/format-to-max-char.ts +0 -68
  363. package/util/index-client.ts +0 -3
  364. package/util/index.ts +0 -112
  365. package/util/number-abbreviate.ts +0 -49
  366. package/util/specifier.ts +0 -43
  367. package/util/spread-to-transform.ts +0 -25
  368. package/util/step-animation.ts +0 -90
  369. package/util/timing.ts +0 -3
  370. package/util/toasts.tsx +0 -17
  371. package/util/two-way-map.ts +0 -19
@@ -1,199 +0,0 @@
1
- import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
2
- import { Check, ChevronRight } from 'lucide-react';
3
- import React from 'react';
4
-
5
- import { cn } from '../src/utils';
6
-
7
- const DropdownMenu = DropdownMenuPrimitive.Root;
8
-
9
- const DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;
10
-
11
- const DropdownMenuGroup = DropdownMenuPrimitive.Group;
12
-
13
- const DropdownMenuPortal = DropdownMenuPrimitive.Portal;
14
-
15
- const DropdownMenuSub = DropdownMenuPrimitive.Sub;
16
-
17
- const DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;
18
-
19
- const DropdownMenuSubTrigger = ({
20
- className,
21
- inset,
22
- children,
23
- ...props
24
- }: React.ComponentProps<typeof DropdownMenuPrimitive.SubTrigger> & {
25
- inset?: boolean;
26
- }) => (
27
- <DropdownMenuPrimitive.SubTrigger
28
- className={cn(
29
- 'focus:bg-accent data-[state=open]:bg-accent flex cursor-default items-center rounded-xs px-2 py-1.5 text-sm outline-hidden select-none',
30
- inset && 'pl-8',
31
- className,
32
- )}
33
- {...props}
34
- >
35
- {children}
36
- <ChevronRight className="ml-auto h-4 w-4" />
37
- </DropdownMenuPrimitive.SubTrigger>
38
- );
39
- DropdownMenuSubTrigger.displayName =
40
- DropdownMenuPrimitive.SubTrigger.displayName;
41
-
42
- const DropdownMenuSubContent = ({
43
- className,
44
- ...props
45
- }: React.ComponentProps<typeof DropdownMenuPrimitive.SubContent>) => (
46
- <DropdownMenuPrimitive.SubContent
47
- className={cn(
48
- 'data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-[2000000000] min-w-[8rem] space-y-3 overflow-hidden rounded-md bg-gray-300 text-white shadow-lg',
49
- className,
50
- )}
51
- {...props}
52
- />
53
- );
54
- DropdownMenuSubContent.displayName =
55
- DropdownMenuPrimitive.SubContent.displayName;
56
-
57
- const DropdownMenuContent = ({
58
- className,
59
- sideOffset = 4,
60
- ...props
61
- }: React.ComponentProps<typeof DropdownMenuPrimitive.Content>) => (
62
- <DropdownMenuPrimitive.Portal>
63
- <DropdownMenuPrimitive.Content
64
- className={cn(
65
- 'font-inter border-divider data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 bg-bg-dark z-[2000000000] min-w-[8rem] overflow-hidden rounded-lg border px-4 py-6 text-white shadow-md',
66
- className,
67
- )}
68
- sideOffset={sideOffset}
69
- {...props}
70
- />
71
- </DropdownMenuPrimitive.Portal>
72
- );
73
- DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;
74
-
75
- const DropdownMenuItem = ({
76
- className,
77
- inset,
78
- ...props
79
- }: React.ComponentProps<typeof DropdownMenuPrimitive.Item> & {
80
- inset?: boolean;
81
- }) => (
82
- <DropdownMenuPrimitive.Item
83
- className={cn(
84
- 'focus:bg-bg-secondary relative flex cursor-default items-center rounded-lg px-2 py-2 text-sm outline-hidden transition-colors select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50',
85
- inset && 'pl-8',
86
- className,
87
- )}
88
- {...props}
89
- />
90
- );
91
- DropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;
92
-
93
- const DropdownMenuCheckboxItem = ({
94
- className,
95
- children,
96
- checked,
97
- ...props
98
- }: React.ComponentProps<typeof DropdownMenuPrimitive.CheckboxItem>) => (
99
- <DropdownMenuPrimitive.CheckboxItem
100
- checked={checked}
101
- className={cn(
102
- 'focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center rounded-xs py-1.5 pr-2 pl-8 text-sm outline-hidden transition-colors select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50',
103
- className,
104
- )}
105
- {...props}
106
- >
107
- <span className="absolute left-2 flex h-3.5 w-3.5 items-center justify-center rounded-xs bg-gray-300">
108
- <DropdownMenuPrimitive.ItemIndicator>
109
- <Check className="h-3 w-3" />
110
- </DropdownMenuPrimitive.ItemIndicator>
111
- </span>
112
- {children}
113
- </DropdownMenuPrimitive.CheckboxItem>
114
- );
115
- DropdownMenuCheckboxItem.displayName =
116
- DropdownMenuPrimitive.CheckboxItem.displayName;
117
-
118
- const DropdownMenuRadioItem = ({
119
- className,
120
- children,
121
- ...props
122
- }: React.ComponentProps<typeof DropdownMenuPrimitive.RadioItem>) => (
123
- <DropdownMenuPrimitive.RadioItem
124
- className={cn(
125
- 'focus:bg-bg-secondary relative flex cursor-default items-center rounded-xs py-1.5 pr-2 pl-8 text-sm outline-hidden transition-colors select-none focus:text-white data-[disabled]:pointer-events-none data-[disabled]:opacity-50',
126
- 'hover:bg-bg-secondary data-[state=checked]:bg-bg-secondary',
127
- className,
128
- )}
129
- {...props}
130
- >
131
- {/*<span className="absolute left-2 flex items-center justify-center">*/}
132
- {/* <DropdownMenuPrimitive.ItemIndicator>*/}
133
- {/* <Check className="h-4 w-4 text-inherit" />*/}
134
- {/* </DropdownMenuPrimitive.ItemIndicator>*/}
135
- {/*</span>*/}
136
- {children}
137
- </DropdownMenuPrimitive.RadioItem>
138
- );
139
- DropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName;
140
-
141
- const DropdownMenuLabel = ({
142
- className,
143
- inset,
144
- ...props
145
- }: React.ComponentProps<typeof DropdownMenuPrimitive.Label> & {
146
- inset?: boolean;
147
- }) => (
148
- <DropdownMenuPrimitive.Label
149
- className={cn(
150
- 'text-text-secondary text-xs tracking-[2px] uppercase',
151
- inset && 'pl-8',
152
- className,
153
- )}
154
- {...props}
155
- />
156
- );
157
- DropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;
158
-
159
- const DropdownMenuSeparator = ({
160
- className,
161
- ...props
162
- }: React.ComponentProps<typeof DropdownMenuPrimitive.Separator>) => (
163
- <DropdownMenuPrimitive.Separator
164
- className={cn('bg-divider -mx-1 my-1 h-px', className)}
165
- {...props}
166
- />
167
- );
168
- DropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName;
169
-
170
- const DropdownMenuShortcut = ({
171
- className,
172
- ...props
173
- }: React.HTMLAttributes<HTMLSpanElement>) => {
174
- return (
175
- <span
176
- className={cn('ml-auto text-xs tracking-widest opacity-60', className)}
177
- {...props}
178
- />
179
- );
180
- };
181
- DropdownMenuShortcut.displayName = 'DropdownMenuShortcut';
182
-
183
- export {
184
- DropdownMenu,
185
- DropdownMenuTrigger,
186
- DropdownMenuContent,
187
- DropdownMenuItem,
188
- DropdownMenuCheckboxItem,
189
- DropdownMenuRadioItem,
190
- DropdownMenuLabel,
191
- DropdownMenuSeparator,
192
- DropdownMenuShortcut,
193
- DropdownMenuGroup,
194
- DropdownMenuPortal,
195
- DropdownMenuSub,
196
- DropdownMenuSubContent,
197
- DropdownMenuSubTrigger,
198
- DropdownMenuRadioGroup,
199
- };
@@ -1,19 +0,0 @@
1
- import React from 'react';
2
-
3
- interface ErrorMessageProps extends React.HTMLAttributes<HTMLDivElement> {
4
- message: string;
5
- }
6
-
7
- const ErrorMessage = ({ message, ...props }: ErrorMessageProps) => {
8
- return (
9
- <div
10
- className="rounded-sm bg-red-500/10 px-4 py-2 text-sm text-red-700"
11
- {...props}
12
- >
13
- <strong className="font-bold">Error: </strong>
14
- <span className="block sm:inline"> {message} </span>
15
- </div>
16
- );
17
- };
18
-
19
- export { ErrorMessage };
@@ -1,203 +0,0 @@
1
- // import { useTranslation } from '@hanzo_network/hanzo-i18n';
2
- const useTranslation = () => ({ t: (key) => key });
3
- // import { partial } from 'filesize';
4
- const partial = () => (bytes) => `${(bytes / 1024 / 1024).toFixed(2)} MB`;
5
- import { Loader2, Trash, Upload } from 'lucide-react';
6
- import React, { useEffect, useState } from 'react';
7
- import { useDropzone } from 'react-dropzone';
8
-
9
- import { fileIconMap, FileTypeIcon, PaperClipIcon } from '../assets';
10
- import { getFileExt } from '../helpers/file';
11
- import { cn } from '../src/utils';
12
- import { Button } from './button';
13
- import { ScrollArea } from './scroll-area';
14
-
15
- const openFile = (file: File): void => {
16
- if (typeof window === 'undefined') return;
17
- const fileURL = window.URL.createObjectURL(file);
18
- window.open(fileURL, '_blank');
19
- URL.revokeObjectURL(fileURL);
20
- };
21
-
22
- export const FileItem = ({
23
- file,
24
- actions,
25
- }: {
26
- file: File;
27
- actions?: {
28
- label: string;
29
- icon: React.ReactNode;
30
- onClick: (file: File) => void;
31
- }[];
32
- }) => {
33
- const size = partial({ standard: 'jedec' });
34
- const hasPreviewImage = file?.type?.includes('image/');
35
-
36
- return (
37
- <div className="bg-bg-quaternary relative flex items-center gap-2 rounded-xl px-3 py-1.5 pr-2">
38
- <span className="flex w-[30px] items-center justify-center">
39
- {hasPreviewImage ? (
40
- <FileImagePreview
41
- className="h-full rounded-md object-cover"
42
- file={file}
43
- />
44
- ) : fileIconMap[getFileExt(file.name)] ? (
45
- <FileTypeIcon
46
- className="text-text-secondary"
47
- type={getFileExt(file.name)}
48
- />
49
- ) : (
50
- <PaperClipIcon className="text-text-secondary h-4 w-4" />
51
- )}
52
- </span>
53
- <div className="line-clamp-1 flex flex-1 flex-col gap-1">
54
- <button
55
- className="text-left hover:underline"
56
- onClick={() => openFile(file)}
57
- type="button"
58
- >
59
- <span className="text-text-default line-clamp-1 text-sm">
60
- {decodeURIComponent(file.name)}
61
- </span>
62
- </button>
63
- {file.size && (
64
- <span className="text-text-tertiary shrink-0 text-xs">
65
- {size(file.size)}
66
- </span>
67
- )}
68
- </div>
69
- {!!actions?.length && (
70
- <div className="shrink-0">
71
- {actions?.map((action) => (
72
- <Button
73
- className="h-8 w-8 border-0 bg-transparent"
74
- key={action.label}
75
- onClick={() => action.onClick(file)}
76
- size="icon"
77
- type="button"
78
- variant="outline"
79
- >
80
- <span className="sr-only">{action.label}</span>
81
- {action.icon}
82
- </Button>
83
- ))}
84
- </div>
85
- )}
86
- </div>
87
- );
88
- };
89
-
90
- export const FileUploader = ({
91
- value,
92
- onChange,
93
- maxFiles,
94
- accept,
95
- allowMultiple,
96
- disabled,
97
- descriptionText,
98
- shouldDisableScrolling,
99
- }: {
100
- value: File[];
101
- onChange: (files: File[]) => void;
102
- maxFiles?: number;
103
- accept?: string;
104
- allowMultiple?: boolean;
105
- disabled?: boolean;
106
- descriptionText?: string;
107
- shouldDisableScrolling?: boolean;
108
- }) => {
109
- const { t } = useTranslation();
110
- const { getRootProps: getRootFileProps, getInputProps: getInputFileProps } =
111
- useDropzone({
112
- multiple: allowMultiple,
113
- maxFiles: maxFiles,
114
- onDrop: (acceptedFiles) => {
115
- onChange(acceptedFiles);
116
- },
117
- disabled: disabled,
118
- });
119
-
120
- return (
121
- <div className="flex w-full flex-col gap-2.5">
122
- <div
123
- {...getRootFileProps({
124
- className:
125
- 'dropzone py-4 bg-bg-secondary group relative mt-3 flex cursor-pointer items-center justify-center overflow-hidden rounded-lg border border-dashed border-divider transition-colors hover:border-border-input-focus',
126
- })}
127
- >
128
- <div className="flex flex-col items-center justify-center space-y-1 px-2">
129
- <div className="bg-bg-tertiary rounded-full p-2 shadow-xs">
130
- <Upload className="h-4 w-4" />
131
- </div>
132
- <p className="text-sm text-white">{t('common.clickToUpload')}</p>
133
- {descriptionText && (
134
- <p className="text-text-tertiary line-clamp-1 text-xs">
135
- {descriptionText}
136
- </p>
137
- )}
138
- </div>
139
-
140
- <input
141
- {...getInputFileProps({
142
- accept: accept,
143
- })}
144
- />
145
- </div>
146
-
147
- {!!value?.length && (
148
- <ScrollArea
149
- className={cn(
150
- 'max-h-[40vh] flex-1 grow overflow-y-scroll pr-1 [&>div>div]:!block',
151
- shouldDisableScrolling && 'max-h-full overflow-y-auto pr-0',
152
- )}
153
- >
154
- <div className="flex flex-col gap-2">
155
- {value?.map((file, idx) => (
156
- <FileItem
157
- actions={[
158
- {
159
- label: 'Delete',
160
- icon: <Trash className="text-text-tertiary h-4 w-4" />,
161
- onClick: (file) => {
162
- const newFiles = [...value];
163
- newFiles.splice(newFiles.indexOf(file), 1);
164
- onChange(newFiles);
165
- },
166
- },
167
- ]}
168
- file={file}
169
- key={file.name + idx}
170
- />
171
- ))}
172
- </div>
173
- </ScrollArea>
174
- )}
175
- </div>
176
- );
177
- };
178
-
179
- interface FileImagePreview extends React.HTMLAttributes<HTMLDivElement> {
180
- file: File;
181
- }
182
-
183
- const FileImagePreview = ({ file, ...props }: FileImagePreview) => {
184
- const [imageSrc, setImageSrc] = useState('');
185
- useEffect(() => {
186
- const reader = new FileReader();
187
- reader.addEventListener(
188
- 'load',
189
- function () {
190
- setImageSrc(reader.result as string);
191
- },
192
- false,
193
- );
194
- if (file) {
195
- reader.readAsDataURL(file);
196
- }
197
- }, [file]);
198
- return imageSrc ? (
199
- <img alt="preview" src={imageSrc} {...props} />
200
- ) : (
201
- <Loader2 />
202
- );
203
- };
@@ -1,185 +0,0 @@
1
- 'use client';
2
-
3
- import type * as LabelPrimitive from '@radix-ui/react-label';
4
- import { Slot } from '@radix-ui/react-slot';
5
- import React from 'react';
6
- import {
7
- Controller,
8
- type ControllerProps,
9
- type FieldPath,
10
- type FieldValues,
11
- FormProvider,
12
- useFormContext,
13
- } from 'react-hook-form';
14
-
15
- import { cn } from '../src/utils';
16
- import { Label } from './label';
17
-
18
- const Form = FormProvider;
19
-
20
- type FormFieldContextValue<
21
- TFieldValues extends FieldValues = FieldValues,
22
- TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,
23
- > = {
24
- name: TName;
25
- };
26
-
27
- const FormFieldContext = React.createContext<FormFieldContextValue>(
28
- {} as FormFieldContextValue,
29
- );
30
-
31
- const FormField = <
32
- TFieldValues extends FieldValues = FieldValues,
33
- TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,
34
- >({
35
- ...props
36
- }: ControllerProps<TFieldValues, TName>) => {
37
- return (
38
- <FormFieldContext.Provider value={{ name: props.name }}>
39
- <Controller {...props} />
40
- </FormFieldContext.Provider>
41
- );
42
- };
43
-
44
- const useFormField = () => {
45
- const fieldContext = React.useContext(FormFieldContext);
46
- const itemContext = React.useContext(FormItemContext);
47
- const { getFieldState, formState } = useFormContext();
48
-
49
- const fieldState = getFieldState(fieldContext.name, formState);
50
-
51
- if (!fieldContext) {
52
- throw new Error('useFormField should be used within <FormField>');
53
- }
54
-
55
- const { id } = itemContext;
56
-
57
- return {
58
- id,
59
- name: fieldContext.name,
60
- formItemId: `${id}-form-item`,
61
- formDescriptionId: `${id}-form-item-description`,
62
- formMessageId: `${id}-form-item-message`,
63
- ...fieldState,
64
- };
65
- };
66
-
67
- type FormItemContextValue = {
68
- id: string;
69
- };
70
-
71
- const FormItemContext = React.createContext<FormItemContextValue>(
72
- {} as FormItemContextValue,
73
- );
74
-
75
- const FormItem = ({
76
- className,
77
- ...props
78
- }: React.HTMLAttributes<HTMLDivElement>) => {
79
- const id = React.useId();
80
-
81
- return (
82
- <FormItemContext.Provider value={{ id }}>
83
- <div className={cn('relative', className)} {...props} />
84
- </FormItemContext.Provider>
85
- );
86
- };
87
- FormItem.displayName = 'FormItem';
88
-
89
- const FormLabel = ({
90
- className,
91
- ...props
92
- }: React.ComponentProps<typeof LabelPrimitive.Root>) => {
93
- const { error, formItemId } = useFormField();
94
-
95
- return (
96
- <Label
97
- className={cn(
98
- 'text-text-secondary pointer-events-none absolute top-3 left-4 flex text-xs leading-tight font-medium transition-all select-none',
99
- // input
100
- 'peer-placeholder-shown:text-text-tertiary z-[1] peer-placeholder-shown:text-base peer-placeholder-shown:leading-[2.3]',
101
- 'peer-focus:text-text-secondary peer-disabled:peer-placeholder-shown:text-text-tertiary peer-disabled:text-text-tertiary peer-focus:text-xs peer-focus:leading-tight',
102
- // select
103
- 'peer-data-[placeholder]/select:top-5 peer-data-[placeholder]/select:text-base',
104
- // adornment
105
- 'peer-[.adornment]/adornment:text-xs',
106
- error && 'text-red-500',
107
- className,
108
- )}
109
- htmlFor={formItemId}
110
- {...props}
111
- />
112
- );
113
- };
114
- FormLabel.displayName = 'FormLabel';
115
-
116
- const FormControl = ({ ...props }: React.ComponentProps<typeof Slot>) => {
117
- const { error, formItemId, formDescriptionId, formMessageId } =
118
- useFormField();
119
-
120
- return (
121
- <Slot
122
- aria-describedby={
123
- error ? `${formDescriptionId} ${formMessageId}` : `${formDescriptionId}`
124
- }
125
- aria-invalid={!!error}
126
- id={formItemId}
127
- {...props}
128
- />
129
- );
130
- };
131
- FormControl.displayName = 'FormControl';
132
-
133
- const FormDescription = ({
134
- className,
135
- ...props
136
- }: React.HTMLAttributes<HTMLParagraphElement>) => {
137
- const { formDescriptionId } = useFormField();
138
-
139
- return (
140
- <p
141
- className={cn('text-text-secondary py-1 text-[0.75rem]', className)}
142
- id={formDescriptionId}
143
- {...props}
144
- />
145
- );
146
- };
147
- FormDescription.displayName = 'FormDescription';
148
-
149
- const FormMessage = ({
150
- className,
151
- children,
152
- ...props
153
- }: React.HTMLAttributes<HTMLParagraphElement>) => {
154
- const { error, formMessageId } = useFormField();
155
- const body = error ? String(error?.message) : children;
156
-
157
- if (!body) {
158
- return null;
159
- }
160
-
161
- return (
162
- <p
163
- className={cn(
164
- 'text-red text-[0.75rem] font-medium dark:text-red-900',
165
- className,
166
- )}
167
- id={formMessageId}
168
- {...props}
169
- >
170
- {body}
171
- </p>
172
- );
173
- };
174
- FormMessage.displayName = 'FormMessage';
175
-
176
- export {
177
- useFormField,
178
- Form,
179
- FormItem,
180
- FormLabel,
181
- FormControl,
182
- FormDescription,
183
- FormMessage,
184
- FormField,
185
- };
@@ -1,28 +0,0 @@
1
- import * as HoverCardPrimitive from '@radix-ui/react-hover-card';
2
- import React from 'react';
3
-
4
- import { cn } from '../src/utils';
5
-
6
- const HoverCard = HoverCardPrimitive.Root;
7
-
8
- const HoverCardTrigger = HoverCardPrimitive.Trigger;
9
-
10
- const HoverCardContent = ({
11
- className,
12
- align = 'center',
13
- sideOffset = 4,
14
- ...props
15
- }: React.ComponentProps<typeof HoverCardPrimitive.Content>) => (
16
- <HoverCardPrimitive.Content
17
- align={align}
18
- className={cn(
19
- 'data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 bg-bg-dark border-divider z-[1500000000] flex flex-col gap-3 rounded-md border pt-1 shadow-none outline-hidden data-[side=top]:flex-col-reverse',
20
- className,
21
- )}
22
- sideOffset={sideOffset}
23
- {...props}
24
- />
25
- );
26
- HoverCardContent.displayName = HoverCardPrimitive.Content.displayName;
27
-
28
- export { HoverCard, HoverCardTrigger, HoverCardContent };
@@ -1,14 +0,0 @@
1
- import React from 'react'
2
- // import type { LucideProps } from 'lucide-react'
3
-
4
-
5
- const GitHub = (props) => (
6
- <svg viewBox="0 0 438.549 438.549" {...props}>
7
- <path
8
- fill="currentColor"
9
- d="M409.132 114.573c-19.608-33.596-46.205-60.194-79.798-79.8-33.598-19.607-70.277-29.408-110.063-29.408-39.781 0-76.472 9.804-110.063 29.408-33.596 19.605-60.192 46.204-79.8 79.8C9.803 148.168 0 184.854 0 224.63c0 47.78 13.94 90.745 41.827 128.906 27.884 38.164 63.906 64.572 108.063 79.227 5.14.954 8.945.283 11.419-1.996 2.475-2.282 3.711-5.14 3.711-8.562 0-.571-.049-5.708-.144-15.417a2549.81 2549.81 0 01-.144-25.406l-6.567 1.136c-4.187.767-9.469 1.092-15.846 1-6.374-.089-12.991-.757-19.842-1.999-6.854-1.231-13.229-4.086-19.13-8.559-5.898-4.473-10.085-10.328-12.56-17.556l-2.855-6.57c-1.903-4.374-4.899-9.233-8.992-14.559-4.093-5.331-8.232-8.945-12.419-10.848l-1.999-1.431c-1.332-.951-2.568-2.098-3.711-3.429-1.142-1.331-1.997-2.663-2.568-3.997-.572-1.335-.098-2.43 1.427-3.289 1.525-.859 4.281-1.276 8.28-1.276l5.708.853c3.807.763 8.516 3.042 14.133 6.851 5.614 3.806 10.229 8.754 13.846 14.842 4.38 7.806 9.657 13.754 15.846 17.847 6.184 4.093 12.419 6.136 18.699 6.136 6.28 0 11.704-.476 16.274-1.423 4.565-.952 8.848-2.383 12.847-4.285 1.713-12.758 6.377-22.559 13.988-29.41-10.848-1.14-20.601-2.857-29.264-5.14-8.658-2.286-17.605-5.996-26.835-11.14-9.235-5.137-16.896-11.516-22.985-19.126-6.09-7.614-11.088-17.61-14.987-29.979-3.901-12.374-5.852-26.648-5.852-42.826 0-23.035 7.52-42.637 22.557-58.817-7.044-17.318-6.379-36.732 1.997-58.24 5.52-1.715 13.706-.428 24.554 3.853 10.85 4.283 18.794 7.952 23.84 10.994 5.046 3.041 9.089 5.618 12.135 7.708 17.705-4.947 35.976-7.421 54.818-7.421s37.117 2.474 54.823 7.421l10.849-6.849c7.419-4.57 16.18-8.758 26.262-12.565 10.088-3.805 17.802-4.853 23.134-3.138 8.562 21.509 9.325 40.922 2.279 58.24 15.036 16.18 22.559 35.787 22.559 58.817 0 16.178-1.958 30.497-5.853 42.966-3.9 12.471-8.941 22.457-15.125 29.979-6.191 7.521-13.901 13.85-23.131 18.986-9.232 5.14-18.182 8.85-26.84 11.136-8.662 2.286-18.415 4.004-29.263 5.146 9.894 8.562 14.842 22.077 14.842 40.539v60.237c0 3.422 1.19 6.279 3.572 8.562 2.379 2.279 6.136 2.95 11.276 1.995 44.163-14.653 80.185-41.062 108.068-79.226 27.88-38.161 41.825-81.126 41.825-128.906-.01-39.771-9.818-76.454-29.414-110.049z"
10
- ></path>
11
- </svg>
12
- )
13
-
14
- export default GitHub
@@ -1,18 +0,0 @@
1
- import {
2
- Moon as moon,
3
- SunMedium as sun,
4
- Menu as burger,
5
- ArrowUpRight as linkOut,
6
- } from 'lucide-react'
7
-
8
- import youtube from './youtube-logo'
9
- import gitHub from './github'
10
-
11
- export {
12
- sun,
13
- moon,
14
- burger,
15
- gitHub,
16
- linkOut,
17
- youtube,
18
- }