@hanzo/ui 4.5.3 → 4.5.4

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 (271) hide show
  1. package/dist/mcp/enhanced-server.js +1 -1
  2. package/dist/mcp/index.js +1 -1
  3. package/dist/registry/api.js +1 -2
  4. package/dist/registry/index.d.ts +348 -4
  5. package/package.json +1 -1
  6. package/tsconfig.json +9 -4
  7. package/dist/blocks/components/accordian-block.d.ts +0 -4
  8. package/dist/blocks/components/accordian-block.jsx +0 -25
  9. package/dist/blocks/components/block-component-props.d.ts +0 -7
  10. package/dist/blocks/components/block-component-props.js +0 -1
  11. package/dist/blocks/components/bullet-cards-block.d.ts +0 -4
  12. package/dist/blocks/components/bullet-cards-block.jsx +0 -25
  13. package/dist/blocks/components/card-block/index.d.ts +0 -6
  14. package/dist/blocks/components/card-block/index.jsx +0 -87
  15. package/dist/blocks/components/card-block/link-out-button.d.ts +0 -6
  16. package/dist/blocks/components/card-block/link-out-button.jsx +0 -4
  17. package/dist/blocks/components/card-block/util.d.ts +0 -4
  18. package/dist/blocks/components/card-block/util.js +0 -6
  19. package/dist/blocks/components/carte-blanche-block/index.d.ts +0 -4
  20. package/dist/blocks/components/carte-blanche-block/index.jsx +0 -82
  21. package/dist/blocks/components/carte-blanche-block/variant-content-left.d.ts +0 -10
  22. package/dist/blocks/components/carte-blanche-block/variant-content-left.jsx +0 -23
  23. package/dist/blocks/components/content.d.ts +0 -10
  24. package/dist/blocks/components/content.jsx +0 -47
  25. package/dist/blocks/components/cta-block.d.ts +0 -12
  26. package/dist/blocks/components/cta-block.jsx +0 -69
  27. package/dist/blocks/components/enh-heading-block.d.ts +0 -7
  28. package/dist/blocks/components/enh-heading-block.jsx +0 -142
  29. package/dist/blocks/components/grid-block/grid-block-mutator.d.ts +0 -5
  30. package/dist/blocks/components/grid-block/grid-block-mutator.js +0 -1
  31. package/dist/blocks/components/grid-block/index.d.ts +0 -9
  32. package/dist/blocks/components/grid-block/index.jsx +0 -56
  33. package/dist/blocks/components/grid-block/mutator-registry.d.ts +0 -3
  34. package/dist/blocks/components/grid-block/mutator-registry.js +0 -5
  35. package/dist/blocks/components/grid-block/table-borders.mutator.d.ts +0 -3
  36. package/dist/blocks/components/grid-block/table-borders.mutator.js +0 -36
  37. package/dist/blocks/components/group-block.d.ts +0 -7
  38. package/dist/blocks/components/group-block.jsx +0 -61
  39. package/dist/blocks/components/heading-block.d.ts +0 -4
  40. package/dist/blocks/components/heading-block.jsx +0 -99
  41. package/dist/blocks/components/image-block.d.ts +0 -7
  42. package/dist/blocks/components/image-block.jsx +0 -69
  43. package/dist/blocks/components/index.d.ts +0 -14
  44. package/dist/blocks/components/index.js +0 -13
  45. package/dist/blocks/components/screenful-block/content.d.ts +0 -8
  46. package/dist/blocks/components/screenful-block/content.jsx +0 -71
  47. package/dist/blocks/components/screenful-block/index.d.ts +0 -12
  48. package/dist/blocks/components/screenful-block/index.jsx +0 -57
  49. package/dist/blocks/components/screenful-block/poster-background.d.ts +0 -7
  50. package/dist/blocks/components/screenful-block/poster-background.jsx +0 -14
  51. package/dist/blocks/components/screenful-block/video-background.d.ts +0 -8
  52. package/dist/blocks/components/screenful-block/video-background.jsx +0 -20
  53. package/dist/blocks/components/space-block.d.ts +0 -4
  54. package/dist/blocks/components/space-block.jsx +0 -42
  55. package/dist/blocks/components/video-block.d.ts +0 -9
  56. package/dist/blocks/components/video-block.jsx +0 -83
  57. package/dist/blocks/def/accordian-block.d.ts +0 -10
  58. package/dist/blocks/def/accordian-block.js +0 -2
  59. package/dist/blocks/def/block.d.ts +0 -4
  60. package/dist/blocks/def/block.js +0 -1
  61. package/dist/blocks/def/bullet-cards-block.d.ts +0 -17
  62. package/dist/blocks/def/bullet-cards-block.js +0 -1
  63. package/dist/blocks/def/card-block.d.ts +0 -17
  64. package/dist/blocks/def/card-block.js +0 -2
  65. package/dist/blocks/def/carte-blanche-block.d.ts +0 -12
  66. package/dist/blocks/def/carte-blanche-block.js +0 -1
  67. package/dist/blocks/def/cta-block.d.ts +0 -8
  68. package/dist/blocks/def/cta-block.js +0 -1
  69. package/dist/blocks/def/element-block.d.ts +0 -7
  70. package/dist/blocks/def/element-block.js +0 -2
  71. package/dist/blocks/def/enh-heading-block.d.ts +0 -22
  72. package/dist/blocks/def/enh-heading-block.js +0 -1
  73. package/dist/blocks/def/grid-block.d.ts +0 -12
  74. package/dist/blocks/def/grid-block.js +0 -1
  75. package/dist/blocks/def/group-block.d.ts +0 -7
  76. package/dist/blocks/def/group-block.js +0 -1
  77. package/dist/blocks/def/heading-block.d.ts +0 -11
  78. package/dist/blocks/def/heading-block.js +0 -1
  79. package/dist/blocks/def/image-block.d.ts +0 -26
  80. package/dist/blocks/def/image-block.js +0 -1
  81. package/dist/blocks/def/index.d.ts +0 -17
  82. package/dist/blocks/def/index.js +0 -2
  83. package/dist/blocks/def/screenful-block.d.ts +0 -41
  84. package/dist/blocks/def/screenful-block.js +0 -1
  85. package/dist/blocks/def/space-block.d.ts +0 -47
  86. package/dist/blocks/def/space-block.js +0 -8
  87. package/dist/blocks/def/video-block.d.ts +0 -5
  88. package/dist/blocks/def/video-block.js +0 -1
  89. package/dist/blocks/index.d.ts +0 -2
  90. package/dist/blocks/index.js +0 -2
  91. package/dist/primitives/accordion.d.ts +0 -10
  92. package/dist/primitives/accordion.jsx +0 -21
  93. package/dist/primitives/action-button.d.ts +0 -9
  94. package/dist/primitives/action-button.jsx +0 -16
  95. package/dist/primitives/apply-typography.d.ts +0 -7
  96. package/dist/primitives/apply-typography.jsx +0 -38
  97. package/dist/primitives/aspect-ratio.d.ts +0 -3
  98. package/dist/primitives/aspect-ratio.jsx +0 -4
  99. package/dist/primitives/avatar.d.ts +0 -6
  100. package/dist/primitives/avatar.jsx +0 -11
  101. package/dist/primitives/badge.d.ts +0 -9
  102. package/dist/primitives/badge.jsx +0 -18
  103. package/dist/primitives/breadcrumb.d.ts +0 -19
  104. package/dist/primitives/breadcrumb.jsx +0 -27
  105. package/dist/primitives/breakpoint-indicator.d.ts +0 -3
  106. package/dist/primitives/breakpoint-indicator.jsx +0 -14
  107. package/dist/primitives/button.d.ts +0 -12
  108. package/dist/primitives/button.jsx +0 -55
  109. package/dist/primitives/calendar.d.ts +0 -8
  110. package/dist/primitives/calendar.jsx +0 -40
  111. package/dist/primitives/card.d.ts +0 -8
  112. package/dist/primitives/card.jsx +0 -18
  113. package/dist/primitives/carousel.d.ts +0 -18
  114. package/dist/primitives/carousel.jsx +0 -106
  115. package/dist/primitives/checkbox.d.ts +0 -4
  116. package/dist/primitives/checkbox.jsx +0 -15
  117. package/dist/primitives/combobox.d.ts +0 -41
  118. package/dist/primitives/combobox.jsx +0 -77
  119. package/dist/primitives/command.d.ts +0 -17
  120. package/dist/primitives/command.jsx +0 -38
  121. package/dist/primitives/context-menu.d.ts +0 -27
  122. package/dist/primitives/context-menu.jsx +0 -57
  123. package/dist/primitives/dialog-video-controller.d.ts +0 -3
  124. package/dist/primitives/dialog-video-controller.jsx +0 -24
  125. package/dist/primitives/dialog.d.ts +0 -28
  126. package/dist/primitives/dialog.jsx +0 -37
  127. package/dist/primitives/drawer.d.ts +0 -29
  128. package/dist/primitives/drawer.jsx +0 -34
  129. package/dist/primitives/form.d.ts +0 -12
  130. package/dist/primitives/form.jsx +0 -69
  131. package/dist/primitives/icons/github.d.ts +0 -4
  132. package/dist/primitives/icons/github.jsx +0 -6
  133. package/dist/primitives/icons/index.d.ts +0 -4
  134. package/dist/primitives/icons/index.js +0 -4
  135. package/dist/primitives/icons/youtube-logo.d.ts +0 -4
  136. package/dist/primitives/icons/youtube-logo.jsx +0 -39
  137. package/dist/primitives/index-common.d.ts +0 -47
  138. package/dist/primitives/index-common.js +0 -46
  139. package/dist/primitives/index-next.d.ts +0 -2
  140. package/dist/primitives/index-next.js +0 -2
  141. package/dist/primitives/input-otp.d.ts +0 -7
  142. package/dist/primitives/input-otp.jsx +0 -24
  143. package/dist/primitives/input.d.ts +0 -5
  144. package/dist/primitives/input.jsx +0 -11
  145. package/dist/primitives/label.d.ts +0 -5
  146. package/dist/primitives/label.jsx +0 -11
  147. package/dist/primitives/list-adaptor.d.ts +0 -9
  148. package/dist/primitives/list-adaptor.js +0 -1
  149. package/dist/primitives/list-box.d.ts +0 -10
  150. package/dist/primitives/list-box.jsx +0 -14
  151. package/dist/primitives/loading-spinner.d.ts +0 -5
  152. package/dist/primitives/loading-spinner.jsx +0 -8
  153. package/dist/primitives/navigation-menu.d.ts +0 -12
  154. package/dist/primitives/navigation-menu.jsx +0 -38
  155. package/dist/primitives/next/image.d.ts +0 -11
  156. package/dist/primitives/next/image.jsx +0 -42
  157. package/dist/primitives/next/index.d.ts +0 -7
  158. package/dist/primitives/next/index.js +0 -7
  159. package/dist/primitives/next/inline-icon.d.ts +0 -13
  160. package/dist/primitives/next/inline-icon.jsx +0 -15
  161. package/dist/primitives/next/link-element.d.ts +0 -23
  162. package/dist/primitives/next/link-element.jsx +0 -56
  163. package/dist/primitives/next/mdx-link.d.ts +0 -3
  164. package/dist/primitives/next/mdx-link.jsx +0 -12
  165. package/dist/primitives/next/media-stack.d.ts +0 -8
  166. package/dist/primitives/next/media-stack.jsx +0 -28
  167. package/dist/primitives/next/nav-items.d.ts +0 -10
  168. package/dist/primitives/next/nav-items.jsx +0 -24
  169. package/dist/primitives/next/youtube-embed.d.ts +0 -11
  170. package/dist/primitives/next/youtube-embed.jsx +0 -23
  171. package/dist/primitives/popover.d.ts +0 -9
  172. package/dist/primitives/popover.jsx +0 -18
  173. package/dist/primitives/progress.d.ts +0 -4
  174. package/dist/primitives/progress.jsx +0 -9
  175. package/dist/primitives/radio-group.d.ts +0 -7
  176. package/dist/primitives/radio-group.jsx +0 -18
  177. package/dist/primitives/scroll-area.d.ts +0 -5
  178. package/dist/primitives/scroll-area.jsx +0 -19
  179. package/dist/primitives/select.d.ts +0 -13
  180. package/dist/primitives/select.jsx +0 -62
  181. package/dist/primitives/separator.d.ts +0 -4
  182. package/dist/primitives/separator.jsx +0 -7
  183. package/dist/primitives/sheet.d.ts +0 -30
  184. package/dist/primitives/sheet.jsx +0 -56
  185. package/dist/primitives/skeleton.d.ts +0 -4
  186. package/dist/primitives/skeleton.jsx +0 -3
  187. package/dist/primitives/slider.d.ts +0 -9
  188. package/dist/primitives/slider.jsx +0 -30
  189. package/dist/primitives/sonner.d.ts +0 -5
  190. package/dist/primitives/sonner.jsx +0 -16
  191. package/dist/primitives/step-indicator.d.ts +0 -9
  192. package/dist/primitives/step-indicator.jsx +0 -23
  193. package/dist/primitives/switch.d.ts +0 -6
  194. package/dist/primitives/switch.jsx +0 -14
  195. package/dist/primitives/table.d.ts +0 -10
  196. package/dist/primitives/table.jsx +0 -21
  197. package/dist/primitives/tabs.d.ts +0 -7
  198. package/dist/primitives/tabs.jsx +0 -18
  199. package/dist/primitives/text-area.d.ts +0 -5
  200. package/dist/primitives/text-area.jsx +0 -9
  201. package/dist/primitives/toggle-group.d.ts +0 -14
  202. package/dist/primitives/toggle-group.jsx +0 -28
  203. package/dist/primitives/toggle.d.ts +0 -14
  204. package/dist/primitives/toggle.jsx +0 -52
  205. package/dist/primitives/tooltip.d.ts +0 -11
  206. package/dist/primitives/tooltip.jsx +0 -18
  207. package/dist/primitives/video-player.d.ts +0 -6
  208. package/dist/primitives/video-player.jsx +0 -8
  209. package/dist/style/theme-provider.d.ts +0 -4
  210. package/dist/style/theme-provider.jsx +0 -11
  211. package/dist/tailwind/fontFamily.tailwind.d.ts +0 -8
  212. package/dist/tailwind/fontFamily.tailwind.js +0 -7
  213. package/dist/tailwind/fontSize.tailwind.d.ts +0 -36
  214. package/dist/tailwind/fontSize.tailwind.js +0 -13
  215. package/dist/tailwind/index.d.ts +0 -3
  216. package/dist/tailwind/index.js +0 -2
  217. package/dist/tailwind/screens.tailwind.d.ts +0 -9
  218. package/dist/tailwind/screens.tailwind.js +0 -8
  219. package/dist/tailwind/tw-font-desc.d.ts +0 -6
  220. package/dist/tailwind/tw-font-desc.js +0 -6
  221. package/dist/types/animation-def.d.ts +0 -2
  222. package/dist/types/animation-def.js +0 -1
  223. package/dist/types/breakpoints.d.ts +0 -4
  224. package/dist/types/breakpoints.js +0 -4
  225. package/dist/types/bullet-item.d.ts +0 -6
  226. package/dist/types/bullet-item.js +0 -2
  227. package/dist/types/button-def.d.ts +0 -29
  228. package/dist/types/button-def.js +0 -2
  229. package/dist/types/dimensions.d.ts +0 -5
  230. package/dist/types/dimensions.js +0 -1
  231. package/dist/types/grid-def.d.ts +0 -36
  232. package/dist/types/grid-def.js +0 -33
  233. package/dist/types/image-def.d.ts +0 -27
  234. package/dist/types/image-def.js +0 -1
  235. package/dist/types/index.d.ts +0 -13
  236. package/dist/types/index.js +0 -2
  237. package/dist/types/link-def.d.ts +0 -44
  238. package/dist/types/link-def.js +0 -1
  239. package/dist/types/media-stack-def.d.ts +0 -25
  240. package/dist/types/media-stack-def.js +0 -1
  241. package/dist/types/t-shirt-size.d.ts +0 -2
  242. package/dist/types/t-shirt-size.js +0 -1
  243. package/dist/types/tshirt-dimensions.d.ts +0 -12
  244. package/dist/types/tshirt-dimensions.js +0 -1
  245. package/dist/types/video-def.d.ts +0 -9
  246. package/dist/types/video-def.js +0 -1
  247. package/dist/util/format-and-abbreviate-as-currency.d.ts +0 -11
  248. package/dist/util/format-and-abbreviate-as-currency.js +0 -91
  249. package/dist/util/format-to-max-char.d.ts +0 -5
  250. package/dist/util/format-to-max-char.js +0 -57
  251. package/dist/util/index-client.d.ts +0 -2
  252. package/dist/util/index-client.js +0 -3
  253. package/dist/util/index.d.ts +0 -17
  254. package/dist/util/index.js +0 -41
  255. package/dist/util/number-abbreviate.d.ts +0 -9
  256. package/dist/util/number-abbreviate.js +0 -30
  257. package/dist/util/specifier.d.ts +0 -7
  258. package/dist/util/specifier.js +0 -31
  259. package/dist/util/spread-to-transform.d.ts +0 -7
  260. package/dist/util/spread-to-transform.js +0 -18
  261. package/dist/util/step-animation.d.ts +0 -5
  262. package/dist/util/step-animation.js +0 -60
  263. package/dist/util/two-way-map.d.ts +0 -8
  264. package/dist/util/two-way-map.js +0 -16
  265. /package/{mcp → src/mcp}/README.md +0 -0
  266. /package/{mcp → src/mcp}/enhanced-server.ts +0 -0
  267. /package/{mcp → src/mcp}/index.ts +0 -0
  268. /package/{mcp → src/mcp}/package.json +0 -0
  269. /package/{registry → src/registry}/api.ts +0 -0
  270. /package/{registry → src/registry}/index.ts +0 -0
  271. /package/{registry → src/registry}/package.json +0 -0
@@ -1,56 +0,0 @@
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;
@@ -1,3 +0,0 @@
1
- import React, { type AnchorHTMLAttributes } from 'react';
2
- declare const MDXLink: React.FC<AnchorHTMLAttributes<HTMLAnchorElement>>;
3
- export default MDXLink;
@@ -1,12 +0,0 @@
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;
@@ -1,8 +0,0 @@
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;
@@ -1,28 +0,0 @@
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;
@@ -1,10 +0,0 @@
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;
@@ -1,24 +0,0 @@
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;
@@ -1,11 +0,0 @@
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;
@@ -1,23 +0,0 @@
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;
@@ -1,9 +0,0 @@
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 };
@@ -1,18 +0,0 @@
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 };
@@ -1,4 +0,0 @@
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;
@@ -1,9 +0,0 @@
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;
@@ -1,7 +0,0 @@
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 };
@@ -1,18 +0,0 @@
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 };
@@ -1,5 +0,0 @@
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 };
@@ -1,19 +0,0 @@
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 };
@@ -1,13 +0,0 @@
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, };
@@ -1,62 +0,0 @@
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, };
@@ -1,4 +0,0 @@
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;
@@ -1,7 +0,0 @@
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;
@@ -1,30 +0,0 @@
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, };
@@ -1,56 +0,0 @@
1
- // @ts-nocheck
2
- 'use client';
3
- import * as React from 'react';
4
- import * as SheetPrimitive from '@radix-ui/react-dialog';
5
- import { cva } from 'class-variance-authority';
6
- import { cn } from '../util';
7
- const Sheet = SheetPrimitive.Root;
8
- const SheetTrigger = SheetPrimitive.Trigger;
9
- const SheetClose = SheetPrimitive.Close;
10
- const SheetPortal = SheetPrimitive.Portal;
11
- const SheetOverlay = React.forwardRef(({ className, ...props }, ref) => (<SheetPrimitive.Overlay className={cn('fixed inset-0 z-below-modal bg-overlay backdrop-blur-sm', 'data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0', className)} {...props} ref={ref}/>));
12
- SheetOverlay.displayName = SheetPrimitive.Overlay.displayName;
13
- const sheetVariants = cva('fixed z-modal gap-4 bg-background p-3 sm:p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-300', {
14
- variants: {
15
- side: {
16
- top: 'inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top',
17
- bottom: 'inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom',
18
- left: 'inset-y-0 left-0 h-full w-5/6 sm:w-2/3 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm',
19
- right: 'inset-y-0 right-0 h-full w-5/6 sm:w-2/3 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm',
20
- },
21
- },
22
- defaultVariants: {
23
- side: 'right',
24
- },
25
- });
26
- const closeUIclx = 'rounded-sm opacity-70 ring-offset-background ' +
27
- 'transition-opacity hover:opacity-100 disabled:pointer-events-none data-[state=open]:bg-primary';
28
- const SheetContent = React.forwardRef(({ side = 'right', className, children, closeElement, centerElement, duplicateCloseOnBottom = false, closeButtonClass, ...props }, ref) => {
29
- const xOfCloseUIClass = (side === 'right') ? 'left-2' : 'right-2';
30
- return (<SheetPortal>
31
- <SheetOverlay />
32
- <SheetPrimitive.Content ref={ref} className={cn(sheetVariants({ side }), className)} {...props}>
33
- {children}
34
-
35
- {closeElement && (<SheetPrimitive.Close className={cn(closeUIclx, 'absolute z-above-content top-3', xOfCloseUIClass, closeButtonClass)}>
36
- {closeElement}
37
- </SheetPrimitive.Close>)}
38
- {closeElement && duplicateCloseOnBottom && (<SheetPrimitive.Close className={cn(closeUIclx, 'absolute z-above-content bottom-3', xOfCloseUIClass, closeButtonClass)}>
39
- {closeElement}
40
- </SheetPrimitive.Close>)}
41
- {centerElement && (<div className={'absolute z-content top-3 left-0 right-0 flex flex-row justify-center align-start'}>
42
- {centerElement}
43
- </div>)}
44
- </SheetPrimitive.Content>
45
- </SheetPortal>);
46
- });
47
- SheetContent.displayName = SheetPrimitive.Content.displayName;
48
- const SheetHeader = ({ className, ...props }) => (<div className={cn('flex flex-col space-y-2 text-center sm:text-left', className)} {...props}/>);
49
- SheetHeader.displayName = 'SheetHeader';
50
- const SheetFooter = ({ className, ...props }) => (<div className={cn('flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2', className)} {...props}/>);
51
- SheetFooter.displayName = 'SheetFooter';
52
- const SheetTitle = React.forwardRef(({ className, ...props }, ref) => (<SheetPrimitive.Title ref={ref} className={cn('text-lg font-semibold text-foreground', className)} {...props}/>));
53
- SheetTitle.displayName = SheetPrimitive.Title.displayName;
54
- const SheetDescription = React.forwardRef(({ className, ...props }, ref) => (<SheetPrimitive.Description ref={ref} className={cn('text-sm text-muted-1', className)} {...props}/>));
55
- SheetDescription.displayName = SheetPrimitive.Description.displayName;
56
- export { Sheet, SheetPortal, SheetOverlay, SheetTrigger, SheetClose, SheetContent, SheetHeader, SheetFooter, SheetTitle, SheetDescription, };
@@ -1,4 +0,0 @@
1
- declare const Skeleton: React.FC<{
2
- reverse?: boolean;
3
- } & React.HTMLAttributes<HTMLDivElement>>;
4
- export default Skeleton;
@@ -1,3 +0,0 @@
1
- import { cn } from '../util';
2
- const Skeleton = ({ reverse = false, className, ...props }) => (<div className={cn('rounded-md bg-level-2', reverse ? 'animate-pulsereverse' : 'animate-pulse', className)} {...props}/>);
3
- export default Skeleton;
@@ -1,9 +0,0 @@
1
- import * as React from 'react';
2
- import * as SliderPrimitive from '@radix-ui/react-slider';
3
- declare const Slider: React.ForwardRefExoticComponent<Omit<SliderPrimitive.SliderProps & React.RefAttributes<HTMLSpanElement>, "ref"> & {
4
- trackBgClx?: string;
5
- rangeBgClx?: string;
6
- thumbClx?: string;
7
- thumbSlidingClx?: string;
8
- } & React.RefAttributes<HTMLSpanElement>>;
9
- export default Slider;
@@ -1,30 +0,0 @@
1
- 'use client';
2
- import * as React from 'react';
3
- import * as SliderPrimitive from '@radix-ui/react-slider';
4
- import { cn } from '../util';
5
- import { useState } from 'react';
6
- const Slider = React.forwardRef(({ className, trackBgClx = 'bg-level-2', rangeBgClx = 'bg-primary', thumbClx = '', thumbSlidingClx = '', onValueChange, onValueCommit, ...rest }, ref) => {
7
- const [sliding, setSliding] = useState(false);
8
- const _onChange = (value) => {
9
- if (!sliding) {
10
- setSliding(true);
11
- }
12
- if (onValueChange) {
13
- onValueChange(value);
14
- }
15
- };
16
- const _onCommit = (value) => {
17
- setSliding(false);
18
- if (onValueCommit) {
19
- onValueCommit(value);
20
- }
21
- };
22
- return (<SliderPrimitive.Root ref={ref} className={cn('relative flex w-full touch-none select-none items-center', className)} onValueChange={_onChange} onValueCommit={_onCommit} {...rest}>
23
- <SliderPrimitive.Track data-vaul-no-drag className={'relative h-2 w-full grow overflow-hidden rounded-full ' + trackBgClx}>
24
- <SliderPrimitive.Range data-vaul-no-drag className={'absolute h-full ' + rangeBgClx}/>
25
- </SliderPrimitive.Track>
26
- <SliderPrimitive.Thumb data-vaul-no-drag className={cn('block h-5 w-5 rounded-full border-2 border-primary bg-background ', 'ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-1 ', 'focus-visible:ring-muted-2 focus-visible:ring-offset-1 disabled:pointer-events-none disabled:opacity-50', thumbClx, (sliding ? thumbSlidingClx : ''))}/>
27
- </SliderPrimitive.Root>);
28
- });
29
- Slider.displayName = SliderPrimitive.Root.displayName;
30
- export default Slider;
@@ -1,5 +0,0 @@
1
- import { Toaster as Sonner } from 'sonner';
2
- import { toast } from 'sonner';
3
- type ToasterProps = React.ComponentProps<typeof Sonner>;
4
- declare const Toaster: ({ ...props }: ToasterProps) => import("react").JSX.Element;
5
- export { toast, Toaster };
@@ -1,16 +0,0 @@
1
- 'use client';
2
- import { useTheme } from 'next-themes';
3
- import { Toaster as Sonner } from 'sonner';
4
- import { toast } from 'sonner';
5
- const Toaster = ({ ...props }) => {
6
- const { theme = 'system' } = useTheme();
7
- return (<Sonner theme={theme} className='toaster group' toastOptions={{
8
- classNames: {
9
- toast: 'group toast group-[.toaster]:bg-level-2 group-[.toaster]:text-foreground group-[.toaster]:border-muted-3 group-[.toaster]:shadow-lg',
10
- description: 'group-[.toast]:text-foreground',
11
- actionButton: 'group-[.toast]:bg-primary group-[.toast]:text-primary-fg',
12
- cancelButton: 'group-[.toast]:bg-transparent group-[.toast]:text-foreground',
13
- },
14
- }} {...props}/>);
15
- };
16
- export { toast, Toaster };
@@ -1,9 +0,0 @@
1
- import React from 'react';
2
- declare const StepIndicator: React.FC<{
3
- steps: string[];
4
- currentStep: number;
5
- dotSizeRem: number;
6
- className?: string;
7
- muted?: boolean;
8
- }>;
9
- export default StepIndicator;
@@ -1,23 +0,0 @@
1
- import React from 'react';
2
- import { cn } from '../util';
3
- const StepIndicator = ({ steps, currentStep, dotSizeRem, className = '', muted = false }) => {
4
- const pX = `calc(${1 / (steps.length * 2) * 100}% - ${dotSizeRem / 2}rem)`;
5
- // This code current throws 'Warning: Each child in a list should have a unique "key" prop.'
6
- // As is evident, we supply keys that should suffice. < shrug >
7
- return (<div className={cn('flex flex-col', className)}>
8
- <div key='one'
9
- /* id='FOO' */
10
- className='flex flex-row items-center justify-start w-full' style={{ paddingLeft: pX, paddingRight: pX }}>
11
- {steps.map((ignore, index) => (<>
12
- {index !== 0 && (<div key={`sep-${index}`} className={cn('h-[1px] grow', currentStep >= index ? (muted ? 'bg-muted' : 'bg-foreground') : (muted ? 'bg-muted-3' : 'bg-level-3'))}/>)}
13
- <div key={`circle-${index}`} style={{ width: `${dotSizeRem}rem`, height: `${dotSizeRem}rem` }} className={cn('shrink-0 rounded-full border-[1.5px]', currentStep >= index ? (muted ? 'bg-muted border-muted' : 'bg-foreground border-foreground') : '')}/>
14
- </>))}
15
- </div>
16
- <div key='two' className={'grid ' + `grid-cols-${steps.length}` /* These are white listed already */}>
17
- {steps.map((label, index) => (<div key={index} className={cn('text-center whitespace-nowrap', (muted ? 'text-muted' : 'text-foreground'))}>
18
- {label}
19
- </div>))}
20
- </div>
21
- </div>);
22
- };
23
- export default StepIndicator;
@@ -1,6 +0,0 @@
1
- import React from 'react';
2
- import * as SwitchPrimitives from '@radix-ui/react-switch';
3
- declare const Switch: React.ForwardRefExoticComponent<Omit<SwitchPrimitives.SwitchProps & React.RefAttributes<HTMLButtonElement>, "ref"> & {
4
- thumbClx?: string;
5
- } & React.RefAttributes<HTMLButtonElement>>;
6
- export default Switch;
@@ -1,14 +0,0 @@
1
- 'use client';
2
- import React from 'react';
3
- import * as SwitchPrimitives from '@radix-ui/react-switch';
4
- import { cn } from '../util';
5
- const Switch = React.forwardRef(({ className, thumbClx = '', ...props }, ref) => (<SwitchPrimitives.Root className={cn('peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full ' +
6
- 'border-2 border-transparent shadow-sm transition-colors focus-visible:outline-none ' +
7
- 'focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 ' +
8
- 'focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 ' +
9
- 'data-[state=checked]:bg-primary data-[state=unchecked]:bg-level-3', className)} {...props} ref={ref}>
10
- <SwitchPrimitives.Thumb className={cn('pointer-events-none block h-4 w-4 rounded-full bg-background shadow-lg ' +
11
- 'ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0', thumbClx)}/>
12
- </SwitchPrimitives.Root>));
13
- Switch.displayName = SwitchPrimitives.Root.displayName;
14
- export default Switch;