@hanzo/ui 4.6.0 → 4.8.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 (184) hide show
  1. package/assets/general.tsx +1 -1
  2. package/assets/hanzo-logo.tsx +3 -1
  3. package/assets/index.ts +119 -5
  4. package/blocks/auth/index.ts +6 -0
  5. package/blocks/auth/login-2fa.tsx +165 -0
  6. package/blocks/auth/login-basic.tsx +94 -0
  7. package/blocks/auth/login-social.tsx +148 -0
  8. package/blocks/auth/magic-link.tsx +129 -0
  9. package/blocks/auth/password-reset.tsx +97 -0
  10. package/blocks/auth/signup.tsx +157 -0
  11. package/blocks/data-display/activity-feed.tsx +242 -0
  12. package/blocks/data-display/data-table.tsx +235 -0
  13. package/blocks/data-display/stats-grid.tsx +194 -0
  14. package/blocks/ecommerce/checkout.tsx +242 -0
  15. package/blocks/ecommerce/index.ts +7 -0
  16. package/blocks/ecommerce/product-detail.tsx +257 -0
  17. package/blocks/ecommerce/product-grid.tsx +148 -0
  18. package/blocks/ecommerce/shopping-cart.tsx +181 -0
  19. package/blocks/marketing/cta-section.tsx +207 -0
  20. package/blocks/marketing/faq.tsx +159 -0
  21. package/blocks/marketing/features-grid.tsx +156 -0
  22. package/blocks/marketing/hero-section.tsx +192 -0
  23. package/blocks/marketing/index.ts +6 -0
  24. package/blocks/marketing/pricing-table.tsx +121 -0
  25. package/blocks/marketing/testimonials.tsx +196 -0
  26. package/components/index.ts +4 -51
  27. package/dist/index.js +9351 -0
  28. package/dist/index.mjs +9340 -0
  29. package/dist/lib/utils.js +47 -0
  30. package/dist/lib/utils.mjs +28 -0
  31. package/dist/src/utils.js +47 -0
  32. package/dist/src/utils.mjs +28 -0
  33. package/dist/tailwind/index.js +2050 -0
  34. package/dist/tailwind/index.mjs +2019 -0
  35. package/dist/types/index.js +79 -0
  36. package/dist/types/index.mjs +56 -0
  37. package/dist/util/format-text.js +51 -0
  38. package/dist/util/format-text.mjs +32 -0
  39. package/dist/util/index.js +384 -0
  40. package/dist/util/index.mjs +363 -0
  41. package/frameworks/core/index.ts +6 -0
  42. package/frameworks/core/utils/index.ts +64 -0
  43. package/frameworks/react/components/button.tsx +26 -0
  44. package/frameworks/react/components/index.ts +5 -0
  45. package/frameworks/react/hooks/index.ts +5 -0
  46. package/frameworks/react/index.ts +9 -0
  47. package/frameworks/react/package.json +8 -0
  48. package/frameworks/react/utils/index.ts +2 -0
  49. package/frameworks/react-native/index.ts +9 -0
  50. package/frameworks/react-native/package.json +8 -0
  51. package/frameworks/registry.json +371 -0
  52. package/frameworks/setup.sh +69 -0
  53. package/frameworks/svelte/index.ts +9 -0
  54. package/frameworks/svelte/package.json +8 -0
  55. package/frameworks/tracker.json +1854 -0
  56. package/frameworks/vue/index.ts +9 -0
  57. package/frameworks/vue/package.json +8 -0
  58. package/package.json +192 -28
  59. package/primitives/accordion.tsx +1 -1
  60. package/primitives/alert-dialog.tsx +1 -1
  61. package/primitives/alert.tsx +1 -1
  62. package/primitives/avatar.tsx +1 -1
  63. package/primitives/badge.tsx +2 -1
  64. package/primitives/breadcrumb.tsx +1 -1
  65. package/primitives/button.tsx +37 -47
  66. package/primitives/card.tsx +1 -1
  67. package/primitives/carousel.tsx +3 -2
  68. package/primitives/chat/chat-input-area.tsx +5 -4
  69. package/primitives/chat/chat-input.tsx +2 -2
  70. package/primitives/chat/files-preview.tsx +5 -4
  71. package/primitives/chat/message-list.tsx +2 -1
  72. package/primitives/chat/sqlite-preview.tsx +8 -8
  73. package/primitives/checkbox.tsx +2 -1
  74. package/primitives/command.tsx +3 -1
  75. package/primitives/context-menu.tsx +1 -1
  76. package/primitives/dialog.tsx +6 -1
  77. package/primitives/drawer.tsx +4 -1
  78. package/primitives/dropdown-menu.tsx +1 -1
  79. package/primitives/file-uploader.tsx +4 -2
  80. package/primitives/form.tsx +1 -1
  81. package/primitives/hover-card.tsx +1 -1
  82. package/primitives/icons/github.tsx +2 -2
  83. package/primitives/icons/youtube-logo.tsx +1 -1
  84. package/primitives/index-common.ts +7 -6
  85. package/primitives/input-otp.tsx +1 -1
  86. package/primitives/input.tsx +2 -1
  87. package/primitives/label.tsx +2 -1
  88. package/primitives/markdown-preview.tsx +3 -0
  89. package/primitives/mermaid.tsx +13 -18
  90. package/primitives/next/image.tsx +2 -1
  91. package/primitives/next/inline-icon.tsx +14 -14
  92. package/primitives/next/media-stack.tsx +2 -19
  93. package/primitives/pagination.tsx +1 -1
  94. package/primitives/popover.tsx +4 -2
  95. package/primitives/progress.tsx +2 -1
  96. package/primitives/prompt-textarea.tsx +1 -1
  97. package/primitives/radio-group.tsx +1 -1
  98. package/primitives/scroll-area.tsx +1 -1
  99. package/primitives/search-input.tsx +1 -1
  100. package/primitives/select.tsx +1 -1
  101. package/primitives/separator.tsx +2 -1
  102. package/primitives/sheet.tsx +1 -1
  103. package/primitives/skeleton.tsx +1 -0
  104. package/primitives/slider.tsx +2 -1
  105. package/primitives/stepper.tsx +1 -1
  106. package/primitives/switch.tsx +2 -1
  107. package/primitives/table.tsx +1 -1
  108. package/primitives/tabs.tsx +1 -1
  109. package/primitives/textarea.tsx +2 -1
  110. package/primitives/textfield.tsx +1 -0
  111. package/primitives/toggle-group.tsx +1 -1
  112. package/primitives/toggle.tsx +1 -1
  113. package/primitives/tooltip.tsx +1 -1
  114. package/src/hooks/use-copy-clipboard.ts +1 -1
  115. package/src/index-lean.ts +87 -0
  116. package/src/index.ts +54 -0
  117. package/src/registry/api.ts +1 -1
  118. package/src/utils.ts +19 -1
  119. package/tailwind/tailwind.config.hanzo-preset.js +7 -7
  120. package/tailwind/typo-plugin/index.js +1 -1
  121. package/types/animation-def.ts +1 -1
  122. package/types/index.ts +2 -1
  123. package/util/blob.ts +9 -4
  124. package/util/date.ts +2 -1
  125. package/util/format-text.ts +2 -1
  126. package/util/index.ts +103 -0
  127. package/util/spread-to-transform.ts +9 -8
  128. package/MCP-INSTRUCTIONS.md +0 -73
  129. package/README-MCP.md +0 -175
  130. package/dist/button.d.ts +0 -1
  131. package/dist/button.js +0 -1
  132. package/dist/hooks/index.d.ts +0 -7
  133. package/dist/hooks/index.js +0 -7
  134. package/dist/hooks/use-click-away.d.ts +0 -2
  135. package/dist/hooks/use-click-away.js +0 -23
  136. package/dist/hooks/use-combined-refs.d.ts +0 -3
  137. package/dist/hooks/use-combined-refs.js +0 -18
  138. package/dist/hooks/use-copy-clipboard.d.ts +0 -9
  139. package/dist/hooks/use-copy-clipboard.js +0 -21
  140. package/dist/hooks/use-debounce.d.ts +0 -1
  141. package/dist/hooks/use-debounce.js +0 -13
  142. package/dist/hooks/use-fill-ids.d.ts +0 -8
  143. package/dist/hooks/use-fill-ids.js +0 -20
  144. package/dist/hooks/use-map.d.ts +0 -1
  145. package/dist/hooks/use-map.js +0 -20
  146. package/dist/hooks/use-measure.d.ts +0 -8
  147. package/dist/hooks/use-measure.js +0 -25
  148. package/dist/hooks/use-reverse-video-playback.d.ts +0 -1
  149. package/dist/hooks/use-reverse-video-playback.js +0 -41
  150. package/dist/hooks/use-scroll-restoration.d.ts +0 -8
  151. package/dist/hooks/use-scroll-restoration.js +0 -36
  152. package/dist/mcp/enhanced-server.d.ts +0 -29
  153. package/dist/mcp/enhanced-server.js +0 -1128
  154. package/dist/mcp/index.d.ts +0 -28
  155. package/dist/mcp/index.js +0 -436
  156. package/dist/registry/api.d.ts +0 -37
  157. package/dist/registry/api.js +0 -129
  158. package/dist/registry/index.d.ts +0 -353
  159. package/dist/registry/index.js +0 -45
  160. package/dist/utils.d.ts +0 -1
  161. package/dist/utils.js +0 -1
  162. package/environment.d.ts +0 -6
  163. package/public/r/accordion.json +0 -11
  164. package/public/r/alert.json +0 -11
  165. package/public/r/avatar.json +0 -11
  166. package/public/r/badge.json +0 -11
  167. package/public/r/button.json +0 -11
  168. package/public/r/card.json +0 -11
  169. package/public/r/checkbox.json +0 -11
  170. package/public/r/default.json +0 -6
  171. package/public/r/dialog.json +0 -11
  172. package/public/r/input.json +0 -11
  173. package/public/r/label.json +0 -11
  174. package/public/r/new-york.json +0 -6
  175. package/public/r/popover.json +0 -11
  176. package/public/r/select.json +0 -11
  177. package/public/r/table.json +0 -11
  178. package/public/r/tabs.json +0 -11
  179. package/public/r/toast.json +0 -11
  180. package/registry.json +0 -184
  181. package/test/test-registry.js +0 -73
  182. package/test-imports.mjs +0 -19
  183. package/tsconfig.json +0 -22
  184. package/utils.ts +0 -9
@@ -1,13 +0,0 @@
1
- import React from 'react';
2
- export function useDebounce(value, delay = 500) {
3
- const [debouncedValue, setDebouncedValue] = React.useState(value);
4
- React.useEffect(() => {
5
- const handler = setTimeout(() => {
6
- setDebouncedValue(value);
7
- }, delay);
8
- return () => {
9
- clearTimeout(handler);
10
- };
11
- }, [value, delay]);
12
- return debouncedValue;
13
- }
@@ -1,8 +0,0 @@
1
- export declare const useFillId: (namespace: string) => {
2
- fill: string;
3
- id: string;
4
- };
5
- export declare const useFillIds: (namespace: string, length: number) => {
6
- fill: string;
7
- id: string;
8
- }[];
@@ -1,20 +0,0 @@
1
- import { useMemo } from 'react';
2
- export const useFillId = (namespace) => {
3
- const id = `lobe-icons-${namespace.toLowerCase()}-fill`;
4
- return useMemo(() => ({
5
- fill: `url(#${id})`,
6
- id,
7
- }), [namespace]);
8
- };
9
- export const useFillIds = (namespace, length) => {
10
- return useMemo(() => {
11
- const ids = Array.from({ length }, (_, i) => {
12
- const id = `lobe-icons-${namespace.toLowerCase()}-fill-${i}`;
13
- return {
14
- fill: `url(#${id})`,
15
- id,
16
- };
17
- });
18
- return ids;
19
- }, [namespace]);
20
- };
@@ -1 +0,0 @@
1
- export declare function useMap<Key, Value>(initialState?: [Key, Value][]): Map<Key, Value>;
@@ -1,20 +0,0 @@
1
- import React from 'react';
2
- export function useMap(initialState = []) {
3
- const mapRef = React.useRef(new Map(initialState));
4
- const [, reRender] = React.useReducer((x) => x + 1, 0);
5
- mapRef.current.set = (...args) => {
6
- Map.prototype.set.apply(mapRef.current, args);
7
- reRender();
8
- return mapRef.current;
9
- };
10
- mapRef.current.clear = (...args) => {
11
- Map.prototype.clear.apply(mapRef.current, args);
12
- reRender();
13
- };
14
- mapRef.current.delete = (...args) => {
15
- const res = Map.prototype.delete.apply(mapRef.current, args);
16
- reRender();
17
- return res;
18
- };
19
- return mapRef.current;
20
- }
@@ -1,8 +0,0 @@
1
- import React from 'react';
2
- export declare function useMeasure<T extends Element>(): [
3
- React.RefCallback<T>,
4
- {
5
- width: number | null;
6
- height: number | null;
7
- }
8
- ];
@@ -1,25 +0,0 @@
1
- import React from 'react';
2
- export function useMeasure() {
3
- const [dimensions, setDimensions] = React.useState({
4
- width: null,
5
- height: null,
6
- });
7
- const previousObserver = React.useRef(null);
8
- const customRef = React.useCallback((node) => {
9
- if (previousObserver.current) {
10
- previousObserver.current.disconnect();
11
- previousObserver.current = null;
12
- }
13
- if (node?.nodeType === Node.ELEMENT_NODE) {
14
- const observer = new ResizeObserver(([entry]) => {
15
- if (entry && entry.borderBoxSize) {
16
- const { inlineSize: width, blockSize: height } = entry.borderBoxSize[0];
17
- setDimensions({ width, height });
18
- }
19
- });
20
- observer.observe(node);
21
- previousObserver.current = observer;
22
- }
23
- }, []);
24
- return [customRef, dimensions];
25
- }
@@ -1 +0,0 @@
1
- export declare const useReverseVideoPlayback: () => import("react").RefObject<HTMLVideoElement>;
@@ -1,41 +0,0 @@
1
- import { useEffect, useRef, useState } from 'react';
2
- export const useReverseVideoPlayback = () => {
3
- const videoRef = useRef(null);
4
- const [isReversing, setIsReversing] = useState(false);
5
- const playReverse = () => {
6
- if (!videoRef.current)
7
- return;
8
- const video = videoRef.current;
9
- const reversePlayback = () => {
10
- if (video.currentTime <= 0) {
11
- setIsReversing(false);
12
- void video.play();
13
- return;
14
- }
15
- video.currentTime -= 0.023;
16
- requestAnimationFrame(reversePlayback);
17
- };
18
- reversePlayback();
19
- };
20
- useEffect(() => {
21
- const videoElement = videoRef.current;
22
- if (videoElement) {
23
- const handleVideoEnd = () => {
24
- if (isReversing) {
25
- setIsReversing(false);
26
- videoElement.currentTime = 0;
27
- void videoElement.play();
28
- }
29
- else {
30
- setIsReversing(true);
31
- playReverse();
32
- }
33
- };
34
- videoElement.addEventListener('ended', handleVideoEnd);
35
- return () => {
36
- videoElement.removeEventListener('ended', handleVideoEnd);
37
- };
38
- }
39
- }, [isReversing]);
40
- return videoRef;
41
- };
@@ -1,8 +0,0 @@
1
- import React from 'react';
2
- export declare const useScrollRestoration: ({ key, containerRef, scrollTopStateRef, }: {
3
- key: string;
4
- containerRef: React.RefObject<HTMLElement | null>;
5
- scrollTopStateRef: React.RefObject<{
6
- [key: string]: number;
7
- } | null>;
8
- }) => void;
@@ -1,36 +0,0 @@
1
- import React from 'react';
2
- export const useScrollRestoration = ({ key, containerRef, scrollTopStateRef, }) => {
3
- const saveScroll = React.useCallback(() => {
4
- if (scrollTopStateRef.current) {
5
- scrollTopStateRef.current[`${key}-scrollTop`] =
6
- containerRef?.current?.scrollTop ?? 0;
7
- }
8
- }, [containerRef, scrollTopStateRef, key]);
9
- const restoreScroll = React.useCallback(() => {
10
- if (containerRef.current) {
11
- containerRef.current.scrollTo({
12
- top: scrollTopStateRef?.current?.[`${key}-scrollTop`] ?? 0,
13
- });
14
- }
15
- }, [containerRef, key, scrollTopStateRef]);
16
- React.useLayoutEffect(() => {
17
- return () => {
18
- saveScroll();
19
- };
20
- }, [saveScroll]);
21
- React.useEffect(() => {
22
- // Small delay to ensure content is rendered
23
- const timeoutId = setTimeout(restoreScroll, 100);
24
- return () => clearTimeout(timeoutId);
25
- }, [restoreScroll]);
26
- React.useEffect(() => {
27
- restoreScroll();
28
- }, [restoreScroll]);
29
- React.useEffect(() => {
30
- const element = containerRef?.current;
31
- element?.addEventListener('scroll', saveScroll);
32
- return () => {
33
- element?.removeEventListener('scroll', saveScroll);
34
- };
35
- }, [containerRef, saveScroll]);
36
- };
@@ -1,29 +0,0 @@
1
- import { Server } from "@modelcontextprotocol/sdk/server/index.js";
2
- /**
3
- * Enhanced MCP Server implementation for @hanzo/ui registry
4
- * Provides comprehensive tools, resources, and prompts for AI-assisted development
5
- */
6
- export declare const server: Server<{
7
- method: string;
8
- params?: {
9
- [x: string]: unknown;
10
- _meta?: {
11
- [x: string]: unknown;
12
- progressToken?: string | number | undefined;
13
- } | undefined;
14
- } | undefined;
15
- }, {
16
- method: string;
17
- params?: {
18
- [x: string]: unknown;
19
- _meta?: {
20
- [x: string]: unknown;
21
- } | undefined;
22
- } | undefined;
23
- }, {
24
- [x: string]: unknown;
25
- _meta?: {
26
- [x: string]: unknown;
27
- } | undefined;
28
- }>;
29
- export default server;