@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.
- package/assets/general.tsx +1 -1
- package/assets/hanzo-logo.tsx +3 -1
- package/assets/index.ts +119 -5
- package/blocks/auth/index.ts +6 -0
- package/blocks/auth/login-2fa.tsx +165 -0
- package/blocks/auth/login-basic.tsx +94 -0
- package/blocks/auth/login-social.tsx +148 -0
- package/blocks/auth/magic-link.tsx +129 -0
- package/blocks/auth/password-reset.tsx +97 -0
- package/blocks/auth/signup.tsx +157 -0
- package/blocks/data-display/activity-feed.tsx +242 -0
- package/blocks/data-display/data-table.tsx +235 -0
- package/blocks/data-display/stats-grid.tsx +194 -0
- package/blocks/ecommerce/checkout.tsx +242 -0
- package/blocks/ecommerce/index.ts +7 -0
- package/blocks/ecommerce/product-detail.tsx +257 -0
- package/blocks/ecommerce/product-grid.tsx +148 -0
- package/blocks/ecommerce/shopping-cart.tsx +181 -0
- package/blocks/marketing/cta-section.tsx +207 -0
- package/blocks/marketing/faq.tsx +159 -0
- package/blocks/marketing/features-grid.tsx +156 -0
- package/blocks/marketing/hero-section.tsx +192 -0
- package/blocks/marketing/index.ts +6 -0
- package/blocks/marketing/pricing-table.tsx +121 -0
- package/blocks/marketing/testimonials.tsx +196 -0
- package/components/index.ts +4 -51
- package/dist/index.js +9351 -0
- package/dist/index.mjs +9340 -0
- package/dist/lib/utils.js +47 -0
- package/dist/lib/utils.mjs +28 -0
- package/dist/src/utils.js +47 -0
- package/dist/src/utils.mjs +28 -0
- package/dist/tailwind/index.js +2050 -0
- package/dist/tailwind/index.mjs +2019 -0
- package/dist/types/index.js +79 -0
- package/dist/types/index.mjs +56 -0
- package/dist/util/format-text.js +51 -0
- package/dist/util/format-text.mjs +32 -0
- package/dist/util/index.js +384 -0
- package/dist/util/index.mjs +363 -0
- package/frameworks/core/index.ts +6 -0
- package/frameworks/core/utils/index.ts +64 -0
- package/frameworks/react/components/button.tsx +26 -0
- package/frameworks/react/components/index.ts +5 -0
- package/frameworks/react/hooks/index.ts +5 -0
- package/frameworks/react/index.ts +9 -0
- package/frameworks/react/package.json +8 -0
- package/frameworks/react/utils/index.ts +2 -0
- package/frameworks/react-native/index.ts +9 -0
- package/frameworks/react-native/package.json +8 -0
- package/frameworks/registry.json +371 -0
- package/frameworks/setup.sh +69 -0
- package/frameworks/svelte/index.ts +9 -0
- package/frameworks/svelte/package.json +8 -0
- package/frameworks/tracker.json +1854 -0
- package/frameworks/vue/index.ts +9 -0
- package/frameworks/vue/package.json +8 -0
- package/package.json +192 -28
- package/primitives/accordion.tsx +1 -1
- package/primitives/alert-dialog.tsx +1 -1
- package/primitives/alert.tsx +1 -1
- package/primitives/avatar.tsx +1 -1
- package/primitives/badge.tsx +2 -1
- package/primitives/breadcrumb.tsx +1 -1
- package/primitives/button.tsx +37 -47
- package/primitives/card.tsx +1 -1
- package/primitives/carousel.tsx +3 -2
- package/primitives/chat/chat-input-area.tsx +5 -4
- package/primitives/chat/chat-input.tsx +2 -2
- package/primitives/chat/files-preview.tsx +5 -4
- package/primitives/chat/message-list.tsx +2 -1
- package/primitives/chat/sqlite-preview.tsx +8 -8
- package/primitives/checkbox.tsx +2 -1
- package/primitives/command.tsx +3 -1
- package/primitives/context-menu.tsx +1 -1
- package/primitives/dialog.tsx +6 -1
- package/primitives/drawer.tsx +4 -1
- package/primitives/dropdown-menu.tsx +1 -1
- package/primitives/file-uploader.tsx +4 -2
- package/primitives/form.tsx +1 -1
- package/primitives/hover-card.tsx +1 -1
- package/primitives/icons/github.tsx +2 -2
- package/primitives/icons/youtube-logo.tsx +1 -1
- package/primitives/index-common.ts +7 -6
- package/primitives/input-otp.tsx +1 -1
- package/primitives/input.tsx +2 -1
- package/primitives/label.tsx +2 -1
- package/primitives/markdown-preview.tsx +3 -0
- package/primitives/mermaid.tsx +13 -18
- package/primitives/next/image.tsx +2 -1
- package/primitives/next/inline-icon.tsx +14 -14
- package/primitives/next/media-stack.tsx +2 -19
- package/primitives/pagination.tsx +1 -1
- package/primitives/popover.tsx +4 -2
- package/primitives/progress.tsx +2 -1
- package/primitives/prompt-textarea.tsx +1 -1
- package/primitives/radio-group.tsx +1 -1
- package/primitives/scroll-area.tsx +1 -1
- package/primitives/search-input.tsx +1 -1
- package/primitives/select.tsx +1 -1
- package/primitives/separator.tsx +2 -1
- package/primitives/sheet.tsx +1 -1
- package/primitives/skeleton.tsx +1 -0
- package/primitives/slider.tsx +2 -1
- package/primitives/stepper.tsx +1 -1
- package/primitives/switch.tsx +2 -1
- package/primitives/table.tsx +1 -1
- package/primitives/tabs.tsx +1 -1
- package/primitives/textarea.tsx +2 -1
- package/primitives/textfield.tsx +1 -0
- package/primitives/toggle-group.tsx +1 -1
- package/primitives/toggle.tsx +1 -1
- package/primitives/tooltip.tsx +1 -1
- package/src/hooks/use-copy-clipboard.ts +1 -1
- package/src/index-lean.ts +87 -0
- package/src/index.ts +54 -0
- package/src/registry/api.ts +1 -1
- package/src/utils.ts +19 -1
- package/tailwind/tailwind.config.hanzo-preset.js +7 -7
- package/tailwind/typo-plugin/index.js +1 -1
- package/types/animation-def.ts +1 -1
- package/types/index.ts +2 -1
- package/util/blob.ts +9 -4
- package/util/date.ts +2 -1
- package/util/format-text.ts +2 -1
- package/util/index.ts +103 -0
- package/util/spread-to-transform.ts +9 -8
- package/MCP-INSTRUCTIONS.md +0 -73
- package/README-MCP.md +0 -175
- package/dist/button.d.ts +0 -1
- package/dist/button.js +0 -1
- package/dist/hooks/index.d.ts +0 -7
- package/dist/hooks/index.js +0 -7
- package/dist/hooks/use-click-away.d.ts +0 -2
- package/dist/hooks/use-click-away.js +0 -23
- package/dist/hooks/use-combined-refs.d.ts +0 -3
- package/dist/hooks/use-combined-refs.js +0 -18
- package/dist/hooks/use-copy-clipboard.d.ts +0 -9
- package/dist/hooks/use-copy-clipboard.js +0 -21
- package/dist/hooks/use-debounce.d.ts +0 -1
- package/dist/hooks/use-debounce.js +0 -13
- package/dist/hooks/use-fill-ids.d.ts +0 -8
- package/dist/hooks/use-fill-ids.js +0 -20
- package/dist/hooks/use-map.d.ts +0 -1
- package/dist/hooks/use-map.js +0 -20
- package/dist/hooks/use-measure.d.ts +0 -8
- package/dist/hooks/use-measure.js +0 -25
- package/dist/hooks/use-reverse-video-playback.d.ts +0 -1
- package/dist/hooks/use-reverse-video-playback.js +0 -41
- package/dist/hooks/use-scroll-restoration.d.ts +0 -8
- package/dist/hooks/use-scroll-restoration.js +0 -36
- package/dist/mcp/enhanced-server.d.ts +0 -29
- package/dist/mcp/enhanced-server.js +0 -1128
- package/dist/mcp/index.d.ts +0 -28
- package/dist/mcp/index.js +0 -436
- package/dist/registry/api.d.ts +0 -37
- package/dist/registry/api.js +0 -129
- package/dist/registry/index.d.ts +0 -353
- package/dist/registry/index.js +0 -45
- package/dist/utils.d.ts +0 -1
- package/dist/utils.js +0 -1
- package/environment.d.ts +0 -6
- package/public/r/accordion.json +0 -11
- package/public/r/alert.json +0 -11
- package/public/r/avatar.json +0 -11
- package/public/r/badge.json +0 -11
- package/public/r/button.json +0 -11
- package/public/r/card.json +0 -11
- package/public/r/checkbox.json +0 -11
- package/public/r/default.json +0 -6
- package/public/r/dialog.json +0 -11
- package/public/r/input.json +0 -11
- package/public/r/label.json +0 -11
- package/public/r/new-york.json +0 -6
- package/public/r/popover.json +0 -11
- package/public/r/select.json +0 -11
- package/public/r/table.json +0 -11
- package/public/r/tabs.json +0 -11
- package/public/r/toast.json +0 -11
- package/registry.json +0 -184
- package/test/test-registry.js +0 -73
- package/test-imports.mjs +0 -19
- package/tsconfig.json +0 -22
- 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,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
|
-
};
|
package/dist/hooks/use-map.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function useMap<Key, Value>(initialState?: [Key, Value][]): Map<Key, Value>;
|
package/dist/hooks/use-map.js
DELETED
|
@@ -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,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;
|