@hanzo/ui 4.5.0 → 4.5.2

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 (311) hide show
  1. package/MCP-INSTRUCTIONS.md +73 -0
  2. package/README-MCP.md +175 -0
  3. package/bin/cli.js +100 -0
  4. package/bin/create-registry.js +108 -0
  5. package/bin/mcp.js +403 -0
  6. package/bin/npx-registry-mcp.js +15 -0
  7. package/bin/registry-mcp-wrapper.sh +19 -0
  8. package/bin/registry-mcp.js +100 -0
  9. package/bin/start-mcp-server.sh +22 -0
  10. package/bin/test-mcp.sh +52 -0
  11. package/bin/update-registry.js +196 -0
  12. package/blocks/components/screenful-block/index.tsx +2 -0
  13. package/dist/blocks/components/accordian-block.d.ts +4 -0
  14. package/dist/blocks/components/accordian-block.jsx +25 -0
  15. package/dist/blocks/components/block-component-props.d.ts +7 -0
  16. package/dist/blocks/components/block-component-props.js +1 -0
  17. package/dist/blocks/components/bullet-cards-block.d.ts +4 -0
  18. package/dist/blocks/components/bullet-cards-block.jsx +25 -0
  19. package/dist/blocks/components/card-block/index.d.ts +6 -0
  20. package/dist/blocks/components/card-block/index.jsx +87 -0
  21. package/dist/blocks/components/card-block/link-out-button.d.ts +6 -0
  22. package/dist/blocks/components/card-block/link-out-button.jsx +4 -0
  23. package/dist/blocks/components/card-block/util.d.ts +4 -0
  24. package/dist/blocks/components/card-block/util.js +6 -0
  25. package/dist/blocks/components/carte-blanche-block/index.d.ts +4 -0
  26. package/dist/blocks/components/carte-blanche-block/index.jsx +82 -0
  27. package/dist/blocks/components/carte-blanche-block/variant-content-left.d.ts +10 -0
  28. package/dist/blocks/components/carte-blanche-block/variant-content-left.jsx +23 -0
  29. package/dist/blocks/components/content.d.ts +10 -0
  30. package/dist/blocks/components/content.jsx +47 -0
  31. package/dist/blocks/components/cta-block.d.ts +12 -0
  32. package/dist/blocks/components/cta-block.jsx +69 -0
  33. package/dist/blocks/components/enh-heading-block.d.ts +7 -0
  34. package/dist/blocks/components/enh-heading-block.jsx +142 -0
  35. package/dist/blocks/components/grid-block/grid-block-mutator.d.ts +5 -0
  36. package/dist/blocks/components/grid-block/grid-block-mutator.js +1 -0
  37. package/dist/blocks/components/grid-block/index.d.ts +9 -0
  38. package/dist/blocks/components/grid-block/index.jsx +56 -0
  39. package/dist/blocks/components/grid-block/mutator-registry.d.ts +3 -0
  40. package/dist/blocks/components/grid-block/mutator-registry.js +5 -0
  41. package/dist/blocks/components/grid-block/table-borders.mutator.d.ts +3 -0
  42. package/dist/blocks/components/grid-block/table-borders.mutator.js +36 -0
  43. package/dist/blocks/components/group-block.d.ts +7 -0
  44. package/dist/blocks/components/group-block.jsx +61 -0
  45. package/dist/blocks/components/heading-block.d.ts +4 -0
  46. package/dist/blocks/components/heading-block.jsx +99 -0
  47. package/dist/blocks/components/image-block.d.ts +7 -0
  48. package/dist/blocks/components/image-block.jsx +69 -0
  49. package/dist/blocks/components/index.d.ts +14 -0
  50. package/dist/blocks/components/index.js +13 -0
  51. package/dist/blocks/components/screenful-block/content.d.ts +8 -0
  52. package/dist/blocks/components/screenful-block/content.jsx +71 -0
  53. package/dist/blocks/components/screenful-block/index.d.ts +12 -0
  54. package/dist/blocks/components/screenful-block/index.jsx +57 -0
  55. package/dist/blocks/components/screenful-block/poster-background.d.ts +7 -0
  56. package/dist/blocks/components/screenful-block/poster-background.jsx +14 -0
  57. package/dist/blocks/components/screenful-block/video-background.d.ts +8 -0
  58. package/dist/blocks/components/screenful-block/video-background.jsx +20 -0
  59. package/dist/blocks/components/space-block.d.ts +4 -0
  60. package/dist/blocks/components/space-block.jsx +42 -0
  61. package/dist/blocks/components/video-block.d.ts +9 -0
  62. package/dist/blocks/components/video-block.jsx +83 -0
  63. package/dist/blocks/def/accordian-block.d.ts +10 -0
  64. package/dist/blocks/def/accordian-block.js +2 -0
  65. package/dist/blocks/def/block.d.ts +4 -0
  66. package/dist/blocks/def/block.js +1 -0
  67. package/dist/blocks/def/bullet-cards-block.d.ts +17 -0
  68. package/dist/blocks/def/bullet-cards-block.js +1 -0
  69. package/dist/blocks/def/card-block.d.ts +17 -0
  70. package/dist/blocks/def/card-block.js +2 -0
  71. package/dist/blocks/def/carte-blanche-block.d.ts +12 -0
  72. package/dist/blocks/def/carte-blanche-block.js +1 -0
  73. package/dist/blocks/def/cta-block.d.ts +8 -0
  74. package/dist/blocks/def/cta-block.js +1 -0
  75. package/dist/blocks/def/element-block.d.ts +7 -0
  76. package/dist/blocks/def/element-block.js +2 -0
  77. package/dist/blocks/def/enh-heading-block.d.ts +22 -0
  78. package/dist/blocks/def/enh-heading-block.js +1 -0
  79. package/dist/blocks/def/grid-block.d.ts +12 -0
  80. package/dist/blocks/def/grid-block.js +1 -0
  81. package/dist/blocks/def/group-block.d.ts +7 -0
  82. package/dist/blocks/def/group-block.js +1 -0
  83. package/dist/blocks/def/heading-block.d.ts +11 -0
  84. package/dist/blocks/def/heading-block.js +1 -0
  85. package/dist/blocks/def/image-block.d.ts +26 -0
  86. package/dist/blocks/def/image-block.js +1 -0
  87. package/dist/blocks/def/index.d.ts +17 -0
  88. package/dist/blocks/def/index.js +2 -0
  89. package/dist/blocks/def/screenful-block.d.ts +41 -0
  90. package/dist/blocks/def/screenful-block.js +1 -0
  91. package/dist/blocks/def/space-block.d.ts +47 -0
  92. package/dist/blocks/def/space-block.js +8 -0
  93. package/dist/blocks/def/video-block.d.ts +5 -0
  94. package/dist/blocks/def/video-block.js +1 -0
  95. package/dist/blocks/index.d.ts +2 -0
  96. package/dist/blocks/index.js +2 -0
  97. package/dist/mcp/enhanced-server.d.ts +29 -0
  98. package/dist/mcp/enhanced-server.js +1128 -0
  99. package/dist/mcp/index.d.ts +28 -0
  100. package/dist/mcp/index.js +436 -0
  101. package/dist/primitives/accordion.d.ts +10 -0
  102. package/dist/primitives/accordion.jsx +21 -0
  103. package/dist/primitives/action-button.d.ts +9 -0
  104. package/dist/primitives/action-button.jsx +16 -0
  105. package/dist/primitives/apply-typography.d.ts +7 -0
  106. package/dist/primitives/apply-typography.jsx +38 -0
  107. package/dist/primitives/aspect-ratio.d.ts +3 -0
  108. package/dist/primitives/aspect-ratio.jsx +4 -0
  109. package/dist/primitives/avatar.d.ts +6 -0
  110. package/dist/primitives/avatar.jsx +11 -0
  111. package/dist/primitives/badge.d.ts +9 -0
  112. package/dist/primitives/badge.jsx +18 -0
  113. package/dist/primitives/breadcrumb.d.ts +19 -0
  114. package/dist/primitives/breadcrumb.jsx +27 -0
  115. package/dist/primitives/breakpoint-indicator.d.ts +3 -0
  116. package/dist/primitives/breakpoint-indicator.jsx +14 -0
  117. package/dist/primitives/button.d.ts +12 -0
  118. package/dist/primitives/button.jsx +55 -0
  119. package/dist/primitives/calendar.d.ts +8 -0
  120. package/dist/primitives/calendar.jsx +40 -0
  121. package/dist/primitives/card.d.ts +8 -0
  122. package/dist/primitives/card.jsx +18 -0
  123. package/dist/primitives/carousel.d.ts +18 -0
  124. package/dist/primitives/carousel.jsx +106 -0
  125. package/dist/primitives/checkbox.d.ts +4 -0
  126. package/dist/primitives/checkbox.jsx +15 -0
  127. package/dist/primitives/combobox.d.ts +41 -0
  128. package/dist/primitives/combobox.jsx +77 -0
  129. package/dist/primitives/command.d.ts +17 -0
  130. package/dist/primitives/command.jsx +38 -0
  131. package/dist/primitives/context-menu.d.ts +27 -0
  132. package/dist/primitives/context-menu.jsx +57 -0
  133. package/dist/primitives/dialog-video-controller.d.ts +3 -0
  134. package/dist/primitives/dialog-video-controller.jsx +24 -0
  135. package/dist/primitives/dialog.d.ts +28 -0
  136. package/dist/primitives/dialog.jsx +37 -0
  137. package/dist/primitives/drawer.d.ts +29 -0
  138. package/dist/primitives/drawer.jsx +34 -0
  139. package/dist/primitives/form.d.ts +12 -0
  140. package/dist/primitives/form.jsx +69 -0
  141. package/dist/primitives/icons/github.d.ts +4 -0
  142. package/dist/primitives/icons/github.jsx +6 -0
  143. package/dist/primitives/icons/index.d.ts +4 -0
  144. package/dist/primitives/icons/index.js +4 -0
  145. package/dist/primitives/icons/youtube-logo.d.ts +4 -0
  146. package/dist/primitives/icons/youtube-logo.jsx +39 -0
  147. package/dist/primitives/index-common.d.ts +47 -0
  148. package/dist/primitives/index-common.js +46 -0
  149. package/dist/primitives/index-next.d.ts +2 -0
  150. package/dist/primitives/index-next.js +2 -0
  151. package/dist/primitives/input-otp.d.ts +7 -0
  152. package/dist/primitives/input-otp.jsx +24 -0
  153. package/dist/primitives/input.d.ts +5 -0
  154. package/dist/primitives/input.jsx +11 -0
  155. package/dist/primitives/label.d.ts +5 -0
  156. package/dist/primitives/label.jsx +11 -0
  157. package/dist/primitives/list-adaptor.d.ts +9 -0
  158. package/dist/primitives/list-adaptor.js +1 -0
  159. package/dist/primitives/list-box.d.ts +10 -0
  160. package/dist/primitives/list-box.jsx +14 -0
  161. package/dist/primitives/loading-spinner.d.ts +5 -0
  162. package/dist/primitives/loading-spinner.jsx +8 -0
  163. package/dist/primitives/navigation-menu.d.ts +12 -0
  164. package/dist/primitives/navigation-menu.jsx +38 -0
  165. package/dist/primitives/next/image.d.ts +11 -0
  166. package/dist/primitives/next/image.jsx +42 -0
  167. package/dist/primitives/next/index.d.ts +7 -0
  168. package/dist/primitives/next/index.js +7 -0
  169. package/dist/primitives/next/inline-icon.d.ts +13 -0
  170. package/dist/primitives/next/inline-icon.jsx +15 -0
  171. package/dist/primitives/next/link-element.d.ts +23 -0
  172. package/dist/primitives/next/link-element.jsx +56 -0
  173. package/dist/primitives/next/mdx-link.d.ts +3 -0
  174. package/dist/primitives/next/mdx-link.jsx +12 -0
  175. package/dist/primitives/next/media-stack.d.ts +8 -0
  176. package/dist/primitives/next/media-stack.jsx +28 -0
  177. package/dist/primitives/next/nav-items.d.ts +10 -0
  178. package/dist/primitives/next/nav-items.jsx +24 -0
  179. package/dist/primitives/next/youtube-embed.d.ts +11 -0
  180. package/dist/primitives/next/youtube-embed.jsx +23 -0
  181. package/dist/primitives/popover.d.ts +9 -0
  182. package/dist/primitives/popover.jsx +18 -0
  183. package/dist/primitives/progress.d.ts +4 -0
  184. package/dist/primitives/progress.jsx +9 -0
  185. package/dist/primitives/radio-group.d.ts +7 -0
  186. package/dist/primitives/radio-group.jsx +18 -0
  187. package/dist/primitives/scroll-area.d.ts +5 -0
  188. package/dist/primitives/scroll-area.jsx +19 -0
  189. package/dist/primitives/select.d.ts +13 -0
  190. package/dist/primitives/select.jsx +62 -0
  191. package/dist/primitives/separator.d.ts +4 -0
  192. package/dist/primitives/separator.jsx +7 -0
  193. package/dist/primitives/sheet.d.ts +30 -0
  194. package/dist/primitives/sheet.jsx +56 -0
  195. package/dist/primitives/skeleton.d.ts +4 -0
  196. package/dist/primitives/skeleton.jsx +3 -0
  197. package/dist/primitives/slider.d.ts +9 -0
  198. package/dist/primitives/slider.jsx +30 -0
  199. package/dist/primitives/sonner.d.ts +5 -0
  200. package/dist/primitives/sonner.jsx +16 -0
  201. package/dist/primitives/step-indicator.d.ts +9 -0
  202. package/dist/primitives/step-indicator.jsx +23 -0
  203. package/dist/primitives/switch.d.ts +6 -0
  204. package/dist/primitives/switch.jsx +14 -0
  205. package/dist/primitives/table.d.ts +10 -0
  206. package/dist/primitives/table.jsx +21 -0
  207. package/dist/primitives/tabs.d.ts +7 -0
  208. package/dist/primitives/tabs.jsx +18 -0
  209. package/dist/primitives/text-area.d.ts +5 -0
  210. package/dist/primitives/text-area.jsx +9 -0
  211. package/dist/primitives/toggle-group.d.ts +14 -0
  212. package/dist/primitives/toggle-group.jsx +28 -0
  213. package/dist/primitives/toggle.d.ts +14 -0
  214. package/dist/primitives/toggle.jsx +52 -0
  215. package/dist/primitives/tooltip.d.ts +11 -0
  216. package/dist/primitives/tooltip.jsx +18 -0
  217. package/dist/primitives/video-player.d.ts +6 -0
  218. package/dist/primitives/video-player.jsx +8 -0
  219. package/dist/registry/api.d.ts +37 -0
  220. package/dist/registry/api.js +130 -0
  221. package/dist/registry/index.d.ts +9 -0
  222. package/dist/registry/index.js +45 -0
  223. package/dist/style/theme-provider.d.ts +4 -0
  224. package/dist/style/theme-provider.jsx +11 -0
  225. package/dist/tailwind/fontFamily.tailwind.d.ts +8 -0
  226. package/dist/tailwind/fontFamily.tailwind.js +7 -0
  227. package/dist/tailwind/fontSize.tailwind.d.ts +36 -0
  228. package/dist/tailwind/fontSize.tailwind.js +13 -0
  229. package/dist/tailwind/index.d.ts +3 -0
  230. package/dist/tailwind/index.js +2 -0
  231. package/dist/tailwind/screens.tailwind.d.ts +9 -0
  232. package/dist/tailwind/screens.tailwind.js +8 -0
  233. package/dist/tailwind/tw-font-desc.d.ts +6 -0
  234. package/dist/tailwind/tw-font-desc.js +6 -0
  235. package/dist/types/animation-def.d.ts +2 -0
  236. package/dist/types/animation-def.js +1 -0
  237. package/dist/types/breakpoints.d.ts +4 -0
  238. package/dist/types/breakpoints.js +4 -0
  239. package/dist/types/bullet-item.d.ts +6 -0
  240. package/dist/types/bullet-item.js +2 -0
  241. package/dist/types/button-def.d.ts +29 -0
  242. package/dist/types/button-def.js +2 -0
  243. package/dist/types/dimensions.d.ts +5 -0
  244. package/dist/types/dimensions.js +1 -0
  245. package/dist/types/grid-def.d.ts +36 -0
  246. package/dist/types/grid-def.js +33 -0
  247. package/dist/types/image-def.d.ts +27 -0
  248. package/dist/types/image-def.js +1 -0
  249. package/dist/types/index.d.ts +13 -0
  250. package/dist/types/index.js +2 -0
  251. package/dist/types/link-def.d.ts +44 -0
  252. package/dist/types/link-def.js +1 -0
  253. package/dist/types/media-stack-def.d.ts +25 -0
  254. package/dist/types/media-stack-def.js +1 -0
  255. package/dist/types/t-shirt-size.d.ts +2 -0
  256. package/dist/types/t-shirt-size.js +1 -0
  257. package/dist/types/tshirt-dimensions.d.ts +12 -0
  258. package/dist/types/tshirt-dimensions.js +1 -0
  259. package/dist/types/video-def.d.ts +9 -0
  260. package/dist/types/video-def.js +1 -0
  261. package/dist/util/format-and-abbreviate-as-currency.d.ts +11 -0
  262. package/dist/util/format-and-abbreviate-as-currency.js +91 -0
  263. package/dist/util/format-to-max-char.d.ts +5 -0
  264. package/dist/util/format-to-max-char.js +57 -0
  265. package/dist/util/index-client.d.ts +2 -0
  266. package/dist/util/index-client.js +3 -0
  267. package/dist/util/index.d.ts +17 -0
  268. package/dist/util/index.js +41 -0
  269. package/dist/util/number-abbreviate.d.ts +9 -0
  270. package/dist/util/number-abbreviate.js +30 -0
  271. package/dist/util/specifier.d.ts +7 -0
  272. package/dist/util/specifier.js +31 -0
  273. package/dist/util/spread-to-transform.d.ts +7 -0
  274. package/dist/util/spread-to-transform.js +18 -0
  275. package/dist/util/step-animation.d.ts +5 -0
  276. package/dist/util/step-animation.js +60 -0
  277. package/dist/util/two-way-map.d.ts +8 -0
  278. package/dist/util/two-way-map.js +16 -0
  279. package/mcp/README.md +141 -0
  280. package/mcp/enhanced-server.ts +1208 -0
  281. package/mcp/index.ts +518 -0
  282. package/mcp/package.json +10 -0
  283. package/package.json +34 -14
  284. package/primitives/accordion.tsx +5 -5
  285. package/primitives/button.tsx +6 -3
  286. package/primitives/dialog.tsx +12 -7
  287. package/primitives/tabs.tsx +1 -1
  288. package/primitives/tooltip.tsx +1 -1
  289. package/public/r/accordion.json +11 -0
  290. package/public/r/alert.json +11 -0
  291. package/public/r/avatar.json +11 -0
  292. package/public/r/badge.json +11 -0
  293. package/public/r/button.json +11 -0
  294. package/public/r/card.json +11 -0
  295. package/public/r/checkbox.json +11 -0
  296. package/public/r/default.json +6 -0
  297. package/public/r/dialog.json +11 -0
  298. package/public/r/input.json +11 -0
  299. package/public/r/label.json +11 -0
  300. package/public/r/new-york.json +6 -0
  301. package/public/r/popover.json +11 -0
  302. package/public/r/select.json +11 -0
  303. package/public/r/table.json +11 -0
  304. package/public/r/tabs.json +11 -0
  305. package/public/r/toast.json +11 -0
  306. package/registry/api.ts +164 -0
  307. package/registry/index.ts +60 -0
  308. package/registry/package.json +10 -0
  309. package/registry.json +184 -0
  310. package/test/test-registry.js +73 -0
  311. package/tsconfig.json +8 -1
@@ -0,0 +1,38 @@
1
+ 'use client';
2
+ import React from 'react';
3
+ import * as NavigationMenuPrimitive from '@radix-ui/react-navigation-menu';
4
+ import { cva } from 'class-variance-authority';
5
+ import { ChevronDown } from 'lucide-react';
6
+ import { cn } from '../util';
7
+ const NavigationMenu = React.forwardRef(({ className, children, ...props }, ref) => (<NavigationMenuPrimitive.Root ref={ref} className={cn('relative z-10 flex max-w-max flex-1 items-center justify-center', className)} {...props}>
8
+ {children}
9
+ {/* <NavigationMenuViewport /> */}
10
+ </NavigationMenuPrimitive.Root>));
11
+ NavigationMenu.displayName = NavigationMenuPrimitive.Root.displayName;
12
+ const NavigationMenuList = React.forwardRef(({ className, ...props }, ref) => (<NavigationMenuPrimitive.List ref={ref} className={cn('group flex flex-1 list-none items-center justify-center space-x-1', className)} {...props}/>));
13
+ NavigationMenuList.displayName = NavigationMenuPrimitive.List.displayName;
14
+ const NavigationMenuItem = React.forwardRef(({ className, ...props }, ref) => (<NavigationMenuPrimitive.Item ref={ref} className={cn("relative", className)} {...props}/>));
15
+ NavigationMenuItem.displayName = 'NavigationMenuItem';
16
+ const navigationMenuTriggerStyle = cva('group inline-flex h-10 w-max items-center justify-center rounded-md bg-background px-4 py-2 ' +
17
+ 'text-sm font-medium transition-colors hover:bg-level-1 text-foreground hover:text-accent ' +
18
+ ' focus:text-accent focus:outline-none disabled:pointer-events-none disabled:opacity-50 ' +
19
+ 'data-[active]:bg-level-1/50 data-[state=open]:bg-level-1/50');
20
+ const NavigationMenuTrigger = React.forwardRef(({ className, children, ...props }, ref) => (<NavigationMenuPrimitive.Trigger ref={ref} className={cn(navigationMenuTriggerStyle(), 'group', className)} {...props}>
21
+ {children}{' '}
22
+ <ChevronDown className='relative top-[1px] ml-1 h-3 w-3 transition duration-200 group-data-[state=open]:rotate-180' aria-hidden='true'/>
23
+ </NavigationMenuPrimitive.Trigger>));
24
+ NavigationMenuTrigger.displayName = NavigationMenuPrimitive.Trigger.displayName;
25
+ const NavigationMenuContent = React.forwardRef(({ className, ...props }, ref) => (<NavigationMenuPrimitive.Content ref={ref} className={cn("right-0 absolute", "absolute top-full w-fit bg-popover mt-[5px]", "data-[motion^=from-]:animate-in data-[motion^=to-]:animate-out data-[motion^=from-]:fade-in data-[motion^=to-]:fade-out data-[motion=from-end]:slide-in-from-right-52 data-[motion=from-start]:slide-in-from-left-52 data-[motion=to-end]:slide-out-to-right-52 data-[motion=to-start]:slide-out-to-left-52 bg-background overflow-hidden rounded-md border", className)} {...props}/>));
26
+ NavigationMenuContent.displayName = NavigationMenuPrimitive.Content.displayName;
27
+ const NavigationMenuLink = NavigationMenuPrimitive.Link;
28
+ const NavigationMenuViewport = React.forwardRef(({ className, ...props }, ref) => (<div className={cn('absolute left-0 top-full flex justify-center')}>
29
+ <NavigationMenuPrimitive.Viewport className={cn('origin-top-center relative mt-1.5 h-[var(--radix-navigation-menu-viewport-height)] w-full overflow-hidden rounded-md border ', 'bg-background text-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-90 md:w-[var(--radix-navigation-menu-viewport-width)]', className)} ref={ref} {...props}/>
30
+ </div>));
31
+ NavigationMenuViewport.displayName =
32
+ NavigationMenuPrimitive.Viewport.displayName;
33
+ const NavigationMenuIndicator = React.forwardRef(({ className, ...props }, ref) => (<NavigationMenuPrimitive.Indicator ref={ref} className={cn('top-full z-[1] flex h-1.5 items-end justify-center overflow-hidden', 'data-[state=visible]:animate-in data-[state=hidden]:animate-out data-[state=hidden]:fade-out data-[state=visible]:fade-in', className)} {...props}>
34
+ <div className='relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm bg-border shadow-md'/>
35
+ </NavigationMenuPrimitive.Indicator>));
36
+ NavigationMenuIndicator.displayName =
37
+ NavigationMenuPrimitive.Indicator.displayName;
38
+ export { navigationMenuTriggerStyle, NavigationMenu, NavigationMenuList, NavigationMenuItem, NavigationMenuContent, NavigationMenuTrigger, NavigationMenuLink, NavigationMenuIndicator, NavigationMenuViewport, };
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ import type { ImageDef, Dimensions, MediaTransform } from '../../types';
3
+ declare const Image: React.FC<{
4
+ def: ImageDef;
5
+ constrainTo?: Dimensions;
6
+ transform?: MediaTransform;
7
+ fullWidth?: boolean;
8
+ className?: string;
9
+ preload?: boolean;
10
+ }>;
11
+ export default Image;
@@ -0,0 +1,42 @@
1
+ import React from 'react';
2
+ import NextImage from 'next/image';
3
+ import { constrain, cn, spreadToTransform } from '../../util';
4
+ const Image = ({ def, constrainTo, transform = {}, fullWidth = false, className = '', preload = false }) => {
5
+ const { src, alt: _alt, dim, sizes, svgFillClass: _svgFillClass, } = def;
6
+ const toSpread = {};
7
+ if (fullWidth) {
8
+ toSpread.style = {
9
+ width: '100%',
10
+ height: 'auto',
11
+ ...spreadToTransform(transform)
12
+ };
13
+ if (constrainTo) {
14
+ toSpread.style.maxWidth = constrainTo.w;
15
+ toSpread.style.maxHeight = constrainTo.h;
16
+ }
17
+ }
18
+ else {
19
+ const resolved = constrainTo ? constrain(dim, constrainTo) : dim;
20
+ toSpread.width = resolved.w;
21
+ toSpread.height = resolved.h;
22
+ toSpread.style = { ...spreadToTransform(transform) };
23
+ }
24
+ if (sizes) {
25
+ toSpread.sizes = sizes;
26
+ }
27
+ // Note: cannot be spread (a Next thing)
28
+ let alt;
29
+ if (_alt) {
30
+ alt = _alt;
31
+ }
32
+ else {
33
+ const tokens = src.split('/');
34
+ // Something remotely meaningful
35
+ alt = (tokens.length > 0) ? tokens[tokens.length - 1] : src;
36
+ }
37
+ const svgFillClass = _svgFillClass ?? '';
38
+ return (fullWidth) ? (<div className='relative flex flex-col items-center justify-center w-full'>
39
+ <NextImage src={src} alt={alt} {...toSpread} priority={preload} loading={preload ? 'eager' : 'lazy'} className={cn(svgFillClass, className)}/>
40
+ </div>) : (<NextImage src={src} alt={alt} {...toSpread} priority={preload} loading={preload ? 'eager' : 'lazy'} className={cn(svgFillClass, className)}/>);
41
+ };
42
+ export default Image;
@@ -0,0 +1,7 @@
1
+ export { default as Image } from './image';
2
+ export { default as InlineIcon } from './inline-icon';
3
+ export { default as LinkElement } from './link-element';
4
+ export { default as MDXLink } from './mdx-link';
5
+ export { default as MediaStack } from './media-stack';
6
+ export { default as NavItems } from './nav-items';
7
+ export { default as YouTubeEmbed } from './youtube-embed';
@@ -0,0 +1,7 @@
1
+ export { default as Image } from './image';
2
+ export { default as InlineIcon } from './inline-icon';
3
+ export { default as LinkElement } from './link-element';
4
+ export { default as MDXLink } from './mdx-link';
5
+ export { default as MediaStack } from './media-stack';
6
+ export { default as NavItems } from './nav-items';
7
+ export { default as YouTubeEmbed } from './youtube-embed';
@@ -0,0 +1,13 @@
1
+ import React from 'react';
2
+ declare const InlineIcon: React.FC<{
3
+ /**
4
+ * If a ReactNode is passed in, it should be set to 'w-full h-auto' so that it can be sized
5
+ * according to width of parent.
6
+ */
7
+ icon: React.ReactNode;
8
+ /** default should be handled by calling code. */
9
+ size?: number;
10
+ agent?: string;
11
+ className?: string;
12
+ }>;
13
+ export default InlineIcon;
@@ -0,0 +1,15 @@
1
+ import React from 'react';
2
+ import Image from 'next/image';
3
+ const InlineIcon = ({ icon, size, agent, className = '' }) => {
4
+ if (!icon)
5
+ return null;
6
+ const phone = agent === 'phone';
7
+ if (typeof icon === 'string') {
8
+ const _size = (phone && size) ? (size * .75) : size;
9
+ return (<Image src={icon} width={_size} height={_size} alt='icon' className={className}/>);
10
+ }
11
+ return (<div className={className}>
12
+ {icon}
13
+ </div>);
14
+ };
15
+ export default InlineIcon;
@@ -0,0 +1,23 @@
1
+ import React, { type PropsWithChildren } from 'react';
2
+ import type { LinkDef } from '../../types';
3
+ import { buttonVariants } from '../button';
4
+ import { type VariantProps } from '../../util';
5
+ /**
6
+ * If this is rendered directly (and not auto generated in a Block)
7
+ * and it has any children, title, icon, and iconAfter
8
+ * are ignore.
9
+ */
10
+ declare const LinkElement: React.FC<PropsWithChildren & VariantProps<typeof buttonVariants> & {
11
+ def: LinkDef;
12
+ /**
13
+ * Use to trigger other events in addition to the
14
+ * link action itself. For example, to also close a drawer menu.
15
+ */
16
+ onClick?: () => void;
17
+ /** overrides def (eg, for title area)*/
18
+ icon?: React.ReactNode;
19
+ /** overrides def */
20
+ iconAfter?: boolean;
21
+ className?: string;
22
+ }>;
23
+ export default LinkElement;
@@ -0,0 +1,56 @@
1
+ import React, {} from 'react';
2
+ import Link from 'next/link';
3
+ import { buttonVariants } from '../button';
4
+ import { cn } from '../../util';
5
+ /**
6
+ * If this is rendered directly (and not auto generated in a Block)
7
+ * and it has any children, title, icon, and iconAfter
8
+ * are ignore.
9
+ */
10
+ const LinkElement = ({ def,
11
+ // DO NOT provide a default to any of the props that also appear in def!
12
+ onClick, size, variant, rounded, icon, iconAfter, className = '', children, }) => {
13
+ const { href, newTab, variant: defVariant, size: defSize, rounded: defRounded, title } = def;
14
+ const linkProps = {};
15
+ // As per LinkDef docs
16
+ if (href.startsWith('http') || href.startsWith('mailto')) {
17
+ linkProps.rel = 'noreferrer noopener';
18
+ if (newTab ?? true) {
19
+ linkProps.target = '_blank';
20
+ }
21
+ }
22
+ else if (newTab) {
23
+ linkProps.target = '_blank';
24
+ }
25
+ const toSpread = {
26
+ href,
27
+ ...(onClick ? { onClick } : {}),
28
+ ...linkProps
29
+ };
30
+ const Contents = () => {
31
+ if (React.Children.count(children) > 0)
32
+ return children;
33
+ // Props > def fields > defaults.
34
+ const _icon = (icon) ? icon : (def.icon) ? def.icon : undefined;
35
+ const _iconAfter = (iconAfter) ? iconAfter : (def.iconAfter) ? def.iconAfter : false;
36
+ // 'title' is not guaranteed as it could be an icon only button / link
37
+ return (<>
38
+ {_icon && !_iconAfter && (<div className='pr-1'>{_icon}</div>)}
39
+ {title && (<div>{title}</div>)}
40
+ {_icon && _iconAfter && (<div className='pl-1'>{_icon}</div>)}
41
+ </>);
42
+ };
43
+ return (<Link className={cn(buttonVariants({
44
+ variant: variant ? variant : (defVariant ? defVariant : 'link'),
45
+ size: (!defVariant || defVariant.includes('link') || variant?.includes('link')) ?
46
+ 'link'
47
+ :
48
+ (size ? size : defSize),
49
+ rounded: rounded ? rounded : (defRounded ? defRounded : 'md'),
50
+ }),
51
+ // This is a "label only" LinkDef. cf: footer"
52
+ ((href.length > 0 || onClick) ? '' : 'pointer-events-none'), className)} {...toSpread}>
53
+ <Contents />
54
+ </Link>);
55
+ };
56
+ export default LinkElement;
@@ -0,0 +1,3 @@
1
+ import React, { type AnchorHTMLAttributes } from 'react';
2
+ declare const MDXLink: React.FC<AnchorHTMLAttributes<HTMLAnchorElement>>;
3
+ export default MDXLink;
@@ -0,0 +1,12 @@
1
+ import React, {} from 'react';
2
+ import Link from 'next/link';
3
+ const MDXLink = ({ href, children, ...rest }) => {
4
+ // internal link
5
+ if (href && (href.startsWith('/'))) {
6
+ return (<Link href={href} {...rest}>
7
+ {children}
8
+ </Link>);
9
+ }
10
+ return <a target="_blank" href={href} {...rest}>{children}</a>;
11
+ };
12
+ export default MDXLink;
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ import type { MediaStackDef, Dimensions } from '../../types';
3
+ declare const MediaStack: React.FC<{
4
+ media: MediaStackDef;
5
+ constrainTo?: Dimensions;
6
+ clx?: string;
7
+ }>;
8
+ export default MediaStack;
@@ -0,0 +1,28 @@
1
+ 'use client';
2
+ import React from 'react';
3
+ import Spline from '@splinetool/react-spline';
4
+ import { cn, constrain, spreadToTransform } from '../../util';
5
+ import Image from './image';
6
+ import VideoPlayer from '../video-player';
7
+ const MediaStack = ({ media, constrainTo: cnst = { w: 250, h: 250 }, clx = '' }) => {
8
+ const { img, video, animation, mediaTransform } = media;
9
+ const transform = mediaTransform ?? {};
10
+ // Order of precedence: 3D > MP4 > Image
11
+ if (animation) {
12
+ return (<Spline scene={animation} className={cn(clx, 'pointer-events-none')} data-vaul-no-drag style={{
13
+ // // !aspect-[12/10]
14
+ width: (6 / 5 * (typeof cnst.h === 'number' ? cnst.h : parseInt(cnst.h))),
15
+ height: cnst.h,
16
+ ...spreadToTransform(transform)
17
+ }}/>);
18
+ }
19
+ if (video) {
20
+ const dim = constrain(video.dim.md, cnst);
21
+ return (<VideoPlayer className={clx} sources={video.sources} width={dim.w} height={dim.h} style={{
22
+ minHeight: dim.h, // prevents layout jumps
23
+ ...spreadToTransform(transform)
24
+ }} {...video.videoProps}/>);
25
+ }
26
+ return img ? (<Image def={img} constrainTo={cnst} className={clx} transform={transform}/>) : (<div style={{ width: cnst.w, height: cnst.h }} className={cn('bg-level-2', clx)}/>);
27
+ };
28
+ export default MediaStack;
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ import type { LinkDef } from '../../types';
3
+ declare const NavItems: React.FC<{
4
+ items: LinkDef[];
5
+ className?: string;
6
+ as?: React.ElementType;
7
+ itemClx?: string | ((def: LinkDef) => string);
8
+ currentAs?: string;
9
+ }>;
10
+ export default NavItems;
@@ -0,0 +1,24 @@
1
+ import React from 'react';
2
+ import LinkElement from './link-element';
3
+ import { cn } from '../../util';
4
+ const NavItems = ({ items, className = '', itemClx, as: Tag = 'nav', currentAs }) => (items.length ? (<Tag className={className}>
5
+ {items.map((item, index) => {
6
+ const variant = item.variant ?? 'link';
7
+ let internalClx = '';
8
+ // note that linkFG (or any other variant of 'link')
9
+ // will not get assigned these classes,
10
+ // and will remain styles is 'foreground' (hence the name)
11
+ if (variant === 'link') {
12
+ internalClx += 'text-nav hover:text-nav-hover ';
13
+ if (currentAs && currentAs === item.href) {
14
+ internalClx += 'text-nav-current ';
15
+ }
16
+ }
17
+ else {
18
+ internalClx += 'min-w-0 lg:min-w-0 ';
19
+ }
20
+ const _itemClx = (itemClx) ? (typeof itemClx === 'string' ? itemClx : itemClx(item)) : '';
21
+ return (<LinkElement def={item} key={index} className={cn(internalClx, _itemClx)}/>);
22
+ })}
23
+ </Tag>) : null);
24
+ export default NavItems;
@@ -0,0 +1,11 @@
1
+ declare const YouTubeEmbed: React.FC<{
2
+ youtubeID: string;
3
+ width: number;
4
+ height: number;
5
+ buttonSize?: number;
6
+ timeAt?: string;
7
+ title?: string;
8
+ caption?: string;
9
+ className?: string;
10
+ }>;
11
+ export default YouTubeEmbed;
@@ -0,0 +1,23 @@
1
+ 'use client';
2
+ import { useState } from 'react';
3
+ import Image from 'next/image';
4
+ import * as Icons from '../icons';
5
+ // Concept based on https://www.youtube.com/watch?v=lLqRchtjN00
6
+ // (https://github.com/a-trost/fableton)
7
+ const YouTubeEmbed = ({ youtubeID, width, height, buttonSize = 100, timeAt, title, caption, className = '' }) => {
8
+ const [showVideo, setShowVideo] = useState(false);
9
+ // re autoplay: https://stackoverflow.com/a/45610557/11645689
10
+ return (<div className={className}>
11
+ {showVideo ? (<iframe width={width} height={height} src={`https://www.youtube-nocookie.com/embed/${youtubeID + ((timeAt) ? `?t=${timeAt}&` : '?')}rel=0&autoplay=1`} allow='accelerometer ; autoplay *; clipboard-write *; encrypted-media *; gyroscope *; picture-in-picture *;' allowFullScreen title={title || 'Youtube video'} className='aspect-[16/9] h-full w-full p-0 border-0 '/>) : (<button type='button' onClick={() => setShowVideo(true)} className='relative aspect-[16/9] w-full' aria-label={`Play video ${title}`}>
12
+ <Image src={`https://img.youtube.com/vi/${youtubeID}/maxresdefault.jpg`} alt='' className='h-full w-full' width={width} height={height} loading='lazy'/>
13
+ <div className={//https://stackoverflow.com/a/23384995/11645689
14
+ 'absolute z-above-content-2 left-[50%] top-[50%] -translate-y-2/4 -translate-x-2/4 ' +
15
+ 'grid place-items-center ' +
16
+ 'text-xl text-white opacity-90'}>
17
+ <Icons.youtube width={buttonSize} height={buttonSize} role='img' className='transform transition hover:scale-110' {...{ 'aria-hidden': true }}/>
18
+ </div>
19
+ {caption && <p className='hidden md:block whitespace-nowrap typography absolute z-above-content left-[50%] top-[20px] -translate-x-2/4 '>{caption}</p>}
20
+ </button>)}
21
+ </div>);
22
+ };
23
+ export default YouTubeEmbed;
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ import * as PopoverPrimitive from '@radix-ui/react-popover';
3
+ declare const Popover: React.FC<PopoverPrimitive.PopoverProps>;
4
+ declare const PopoverTrigger: React.ForwardRefExoticComponent<PopoverPrimitive.PopoverTriggerProps & React.RefAttributes<HTMLButtonElement>>;
5
+ declare const PopoverClose: React.ForwardRefExoticComponent<PopoverPrimitive.PopoverCloseProps & React.RefAttributes<HTMLButtonElement>>;
6
+ declare const PopoverAnchor: React.ForwardRefExoticComponent<PopoverPrimitive.PopoverAnchorProps & React.RefAttributes<HTMLDivElement>>;
7
+ declare const PopoverArrow: React.ForwardRefExoticComponent<PopoverPrimitive.PopoverArrowProps & React.RefAttributes<SVGSVGElement>>;
8
+ declare const PopoverContent: React.ForwardRefExoticComponent<Omit<PopoverPrimitive.PopoverContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
9
+ export { Popover, PopoverTrigger, PopoverContent, PopoverAnchor, PopoverClose, PopoverArrow };
@@ -0,0 +1,18 @@
1
+ 'use client';
2
+ import React from 'react';
3
+ import * as PopoverPrimitive from '@radix-ui/react-popover';
4
+ import { cn } from '../util';
5
+ const Popover = PopoverPrimitive.Root;
6
+ const PopoverTrigger = PopoverPrimitive.Trigger;
7
+ const PopoverClose = PopoverPrimitive.Close;
8
+ const PopoverAnchor = PopoverPrimitive.Anchor;
9
+ const PopoverArrow = PopoverPrimitive.Arrow;
10
+ const PopoverContent = React.forwardRef(({ className, align = 'center', sideOffset = 4, ...props }, ref) => (<PopoverPrimitive.Portal>
11
+ <PopoverPrimitive.Content ref={ref} align={align} sideOffset={sideOffset} className={cn('z-above-modal-2 w-72 rounded-md border bg-level-1 p-4 text-foreground shadow-md outline-none ' +
12
+ 'data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 ' +
13
+ 'data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 ' +
14
+ 'data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 ' +
15
+ 'data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2', className)} {...props}/>
16
+ </PopoverPrimitive.Portal>));
17
+ PopoverContent.displayName = PopoverPrimitive.Content.displayName;
18
+ export { Popover, PopoverTrigger, PopoverContent, PopoverAnchor, PopoverClose, PopoverArrow };
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import * as ProgressPrimitive from '@radix-ui/react-progress';
3
+ declare const Progress: React.ForwardRefExoticComponent<Omit<ProgressPrimitive.ProgressProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
4
+ export default Progress;
@@ -0,0 +1,9 @@
1
+ 'use client';
2
+ import React from 'react';
3
+ import * as ProgressPrimitive from '@radix-ui/react-progress';
4
+ import { cn } from '../util';
5
+ const Progress = React.forwardRef(({ className, value, ...props }, ref) => (<ProgressPrimitive.Root ref={ref} className={cn('relative h-4 w-full overflow-hidden rounded-full bg-level-2', className)} {...props}>
6
+ <ProgressPrimitive.Indicator className='h-full w-full flex-1 bg-accent transition-all' style={{ transform: `translateX(-${100 - (value || 0)}%)` }}/>
7
+ </ProgressPrimitive.Root>));
8
+ Progress.displayName = ProgressPrimitive.Root.displayName;
9
+ export default Progress;
@@ -0,0 +1,7 @@
1
+ import * as React from "react";
2
+ import * as RadioGroupPrimitive from "@radix-ui/react-radio-group";
3
+ declare const RadioGroup: React.ForwardRefExoticComponent<Omit<RadioGroupPrimitive.RadioGroupProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
4
+ declare const RadioGroupItem: React.ForwardRefExoticComponent<Omit<RadioGroupPrimitive.RadioGroupItemProps & React.RefAttributes<HTMLButtonElement>, "ref"> & {
5
+ larger?: boolean;
6
+ } & React.RefAttributes<HTMLButtonElement>>;
7
+ export { RadioGroup, RadioGroupItem };
@@ -0,0 +1,18 @@
1
+ "use client";
2
+ import * as React from "react";
3
+ import * as RadioGroupPrimitive from "@radix-ui/react-radio-group";
4
+ import { Circle } from "lucide-react";
5
+ import { cn } from "../util";
6
+ const RadioGroup = React.forwardRef(({ className, ...props }, ref) => {
7
+ return (<RadioGroupPrimitive.Root className={cn("grid gap-2", className)} {...props} ref={ref}/>);
8
+ });
9
+ RadioGroup.displayName = RadioGroupPrimitive.Root.displayName;
10
+ const RadioGroupItem = React.forwardRef(({ larger = false, className, ...props }, ref) => {
11
+ return (<RadioGroupPrimitive.Item ref={ref} className={cn(larger ? 'h-5 w-5' : 'h-4 w-4', 'aspect-square rounded-full border border-muted text-foreground ring-offset-background ', 'focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2', 'disabled:cursor-not-allowed disabled:opacity-50', className)} {...props}>
12
+ <RadioGroupPrimitive.Indicator className="w-full h-full flex items-center justify-center">
13
+ <div className={cn(larger ? 'h-[70%] w-[70%] ' : 'h-[75%] w-[75%]', 'rounded-full aspect-square bg-foreground')}/>
14
+ </RadioGroupPrimitive.Indicator>
15
+ </RadioGroupPrimitive.Item>);
16
+ });
17
+ RadioGroupItem.displayName = RadioGroupPrimitive.Item.displayName;
18
+ export { RadioGroup, RadioGroupItem };
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ import * as ScrollAreaPrimitive from '@radix-ui/react-scroll-area';
3
+ declare const ScrollArea: React.ForwardRefExoticComponent<Omit<ScrollAreaPrimitive.ScrollAreaProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
4
+ declare const ScrollBar: React.ForwardRefExoticComponent<Omit<ScrollAreaPrimitive.ScrollAreaScrollbarProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
5
+ export { ScrollArea, ScrollBar };
@@ -0,0 +1,19 @@
1
+ 'use client';
2
+ import React from 'react';
3
+ import * as ScrollAreaPrimitive from '@radix-ui/react-scroll-area';
4
+ import { cn } from '../util';
5
+ const ScrollArea = React.forwardRef(({ className, children, ...props }, ref) => (<ScrollAreaPrimitive.Root ref={ref} className={cn('relative overflow-hidden', className)} {...props}>
6
+ <ScrollAreaPrimitive.Viewport className='h-full w-full rounded-[inherit]'>
7
+ {children}
8
+ </ScrollAreaPrimitive.Viewport>
9
+ <ScrollBar />
10
+ <ScrollAreaPrimitive.Corner />
11
+ </ScrollAreaPrimitive.Root>));
12
+ ScrollArea.displayName = ScrollAreaPrimitive.Root.displayName;
13
+ const ScrollBar = React.forwardRef(({ className, orientation = 'vertical', ...props }, ref) => (<ScrollAreaPrimitive.ScrollAreaScrollbar ref={ref} orientation={orientation} className={cn('flex touch-none select-none transition-colors', orientation === 'vertical' &&
14
+ 'h-full w-2.5 border-l border-l-transparent p-[1px]', orientation === 'horizontal' &&
15
+ 'h-2.5 flex-col border-t border-t-transparent p-[1px]', className)} {...props}>
16
+ <ScrollAreaPrimitive.ScrollAreaThumb className='relative flex-1 rounded-full bg-muted-2'/>
17
+ </ScrollAreaPrimitive.ScrollAreaScrollbar>));
18
+ ScrollBar.displayName = ScrollAreaPrimitive.ScrollAreaScrollbar.displayName;
19
+ export { ScrollArea, ScrollBar };
@@ -0,0 +1,13 @@
1
+ import React from 'react';
2
+ import * as SelectPrimitive from '@radix-ui/react-select';
3
+ declare const Select: React.FC<SelectPrimitive.SelectProps>;
4
+ declare const SelectGroup: React.ForwardRefExoticComponent<SelectPrimitive.SelectGroupProps & React.RefAttributes<HTMLDivElement>>;
5
+ declare const SelectValue: React.ForwardRefExoticComponent<SelectPrimitive.SelectValueProps & React.RefAttributes<HTMLSpanElement>>;
6
+ declare const SelectTrigger: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectTriggerProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
7
+ declare const SelectScrollUpButton: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectScrollUpButtonProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
8
+ declare const SelectScrollDownButton: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectScrollDownButtonProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
9
+ declare const SelectContent: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
10
+ declare const SelectLabel: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectLabelProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
11
+ declare const SelectItem: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
12
+ declare const SelectSeparator: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectSeparatorProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
13
+ export { Select, SelectGroup, SelectValue, SelectTrigger, SelectContent, SelectLabel, SelectItem, SelectSeparator, SelectScrollUpButton, SelectScrollDownButton, };
@@ -0,0 +1,62 @@
1
+ 'use client';
2
+ import React from 'react';
3
+ import * as SelectPrimitive from '@radix-ui/react-select';
4
+ import { Check, ChevronDown, ChevronUp } from 'lucide-react';
5
+ import { cn } from '../util';
6
+ const Select = SelectPrimitive.Root;
7
+ const SelectGroup = SelectPrimitive.Group;
8
+ const SelectValue = SelectPrimitive.Value;
9
+ const SelectTrigger = React.forwardRef(({ className, children, ...props }, ref) => (<SelectPrimitive.Trigger ref={ref} className={cn('flex h-10 w-full items-center justify-between rounded-md border border-muted-3 ' +
10
+ 'bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-2 ' +
11
+ 'focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 ' +
12
+ 'disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1', className)} {...props}>
13
+ {children}
14
+ <SelectPrimitive.Icon asChild>
15
+ <ChevronDown className='h-4 w-4 opacity-50'/>
16
+ </SelectPrimitive.Icon>
17
+ </SelectPrimitive.Trigger>));
18
+ SelectTrigger.displayName = SelectPrimitive.Trigger.displayName;
19
+ const SelectScrollUpButton = React.forwardRef(({ className, ...props }, ref) => (<SelectPrimitive.ScrollUpButton ref={ref} className={cn('flex cursor-default items-center justify-center py-1', className)} {...props}>
20
+ <ChevronUp className='h-4 w-4'/>
21
+ </SelectPrimitive.ScrollUpButton>));
22
+ SelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName;
23
+ const SelectScrollDownButton = React.forwardRef(({ className, ...props }, ref) => (<SelectPrimitive.ScrollDownButton ref={ref} className={cn('flex cursor-default items-center justify-center py-1', className)} {...props}>
24
+ <ChevronDown className='h-4 w-4'/>
25
+ </SelectPrimitive.ScrollDownButton>));
26
+ SelectScrollDownButton.displayName =
27
+ SelectPrimitive.ScrollDownButton.displayName;
28
+ const SelectContent = React.forwardRef(({ className, children, position = 'popper', ...props }, ref) => (<SelectPrimitive.Portal>
29
+ <SelectPrimitive.Content ref={ref} className={cn('relative z-popup max-h-96 min-w-[8rem] overflow-hidden rounded-md border ' +
30
+ 'bg-level-1 text-foreground shadow-md data-[state=open]:animate-in ' +
31
+ 'data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 ' +
32
+ 'data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 ' +
33
+ 'data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 ' +
34
+ 'data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2', (position === 'popper') &&
35
+ 'data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 ' +
36
+ 'data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1', className)} position={position} {...props}>
37
+ <SelectScrollUpButton />
38
+ <SelectPrimitive.Viewport className={cn('p-1', position === 'popper' &&
39
+ 'h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]')}>
40
+ {children}
41
+ </SelectPrimitive.Viewport>
42
+ <SelectScrollDownButton />
43
+ </SelectPrimitive.Content>
44
+ </SelectPrimitive.Portal>));
45
+ SelectContent.displayName = SelectPrimitive.Content.displayName;
46
+ const SelectLabel = React.forwardRef(({ className, ...props }, ref) => (<SelectPrimitive.Label ref={ref} className={cn('py-1.5 pl-8 pr-2 text-sm font-semibold', className)} {...props}/>));
47
+ SelectLabel.displayName = SelectPrimitive.Label.displayName;
48
+ const SelectItem = React.forwardRef(({ className, children, ...props }, ref) => (<SelectPrimitive.Item ref={ref} className={cn('relative flex w-full cursor-default select-none items-center rounded-sm ' +
49
+ 'py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-level-2 focus:text-accent ' +
50
+ 'data-[disabled]:pointer-events-none data-[disabled]:opacity-50', className)} {...props}>
51
+ <span className='absolute left-2 flex h-3.5 w-3.5 items-center justify-center'>
52
+ <SelectPrimitive.ItemIndicator>
53
+ <Check className='h-4 w-4'/>
54
+ </SelectPrimitive.ItemIndicator>
55
+ </span>
56
+
57
+ <SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>
58
+ </SelectPrimitive.Item>));
59
+ SelectItem.displayName = SelectPrimitive.Item.displayName;
60
+ const SelectSeparator = React.forwardRef(({ className, ...props }, ref) => (<SelectPrimitive.Separator ref={ref} className={cn('-mx-1 my-1 h-px bg-level-1', className)} {...props}/>));
61
+ SelectSeparator.displayName = SelectPrimitive.Separator.displayName;
62
+ export { Select, SelectGroup, SelectValue, SelectTrigger, SelectContent, SelectLabel, SelectItem, SelectSeparator, SelectScrollUpButton, SelectScrollDownButton, };
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import * as SeparatorPrimitive from '@radix-ui/react-separator';
3
+ declare const Separator: React.ForwardRefExoticComponent<Omit<SeparatorPrimitive.SeparatorProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
4
+ export default Separator;
@@ -0,0 +1,7 @@
1
+ 'use client';
2
+ import React from 'react';
3
+ import * as SeparatorPrimitive from '@radix-ui/react-separator';
4
+ import { cn } from '../util';
5
+ const Separator = React.forwardRef(({ className, orientation = 'horizontal', decorative = true, ...props }, ref) => (<SeparatorPrimitive.Root ref={ref} decorative={decorative} orientation={orientation} className={cn('shrink-0 bg-muted-2', orientation === 'horizontal' ? 'h-[1px] w-full' : 'h-full w-[1px]', className)} {...props}/>));
6
+ Separator.displayName = SeparatorPrimitive.Root.displayName;
7
+ export default Separator;
@@ -0,0 +1,30 @@
1
+ import * as React from 'react';
2
+ import * as SheetPrimitive from '@radix-ui/react-dialog';
3
+ import { type VariantProps } from 'class-variance-authority';
4
+ declare const Sheet: React.FC<SheetPrimitive.DialogProps>;
5
+ declare const SheetTrigger: React.ForwardRefExoticComponent<SheetPrimitive.DialogTriggerProps & React.RefAttributes<HTMLButtonElement>>;
6
+ declare const SheetClose: React.ForwardRefExoticComponent<SheetPrimitive.DialogCloseProps & React.RefAttributes<HTMLButtonElement>>;
7
+ declare const SheetPortal: React.FC<SheetPrimitive.DialogPortalProps>;
8
+ declare const SheetOverlay: React.ForwardRefExoticComponent<Omit<SheetPrimitive.DialogOverlayProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
9
+ declare const sheetVariants: (props?: ({
10
+ side?: "top" | "right" | "bottom" | "left" | null | undefined;
11
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
12
+ interface SheetContentProps extends React.ComponentPropsWithoutRef<typeof SheetPrimitive.Content>, VariantProps<typeof sheetVariants> {
13
+ }
14
+ declare const SheetContent: React.ForwardRefExoticComponent<SheetContentProps & {
15
+ closeButtonClass?: string;
16
+ closeElement?: any;
17
+ centerElement?: any;
18
+ duplicateCloseOnBottom?: boolean;
19
+ } & React.RefAttributes<HTMLDivElement>>;
20
+ declare const SheetHeader: {
21
+ ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): React.JSX.Element;
22
+ displayName: string;
23
+ };
24
+ declare const SheetFooter: {
25
+ ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): React.JSX.Element;
26
+ displayName: string;
27
+ };
28
+ declare const SheetTitle: React.ForwardRefExoticComponent<Omit<SheetPrimitive.DialogTitleProps & React.RefAttributes<HTMLHeadingElement>, "ref"> & React.RefAttributes<HTMLHeadingElement>>;
29
+ declare const SheetDescription: React.ForwardRefExoticComponent<Omit<SheetPrimitive.DialogDescriptionProps & React.RefAttributes<HTMLParagraphElement>, "ref"> & React.RefAttributes<HTMLParagraphElement>>;
30
+ export { Sheet, SheetPortal, SheetOverlay, SheetTrigger, SheetClose, SheetContent, SheetHeader, SheetFooter, SheetTitle, SheetDescription, };