@hanzo/ui 5.3.31 → 5.3.33
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/dist/calendar-ext/index.js +203 -0
- package/dist/calendar-ext/index.mjs +165 -0
- package/dist/charts/index.js +278 -0
- package/dist/charts/index.mjs +250 -0
- package/dist/index.js +0 -1
- package/dist/index.mjs +0 -1
- package/dist/kanban/index.js +594 -0
- package/dist/kanban/index.mjs +572 -0
- package/dist/mermaid/index.js +275 -0
- package/dist/mermaid/index.mjs +249 -0
- package/dist/primitives/index.js +0 -1
- package/dist/primitives/index.mjs +0 -1
- package/dist/primitives-export.js +0 -1
- package/dist/primitives-export.mjs +0 -1
- package/dist/spline/index.js +211 -0
- package/dist/spline/index.mjs +202 -0
- package/dist/spline/media-stack.js +193 -0
- package/dist/spline/media-stack.mjs +185 -0
- package/dist/spline/player.js +37 -0
- package/dist/spline/player.mjs +31 -0
- package/package.json +69 -14
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import Spline from '@splinetool/react-spline';
|
|
3
|
+
import { clsx } from 'clsx';
|
|
4
|
+
import { twMerge } from 'tailwind-merge';
|
|
5
|
+
import NextImage from 'next/image';
|
|
6
|
+
import { jsx } from 'react/jsx-runtime';
|
|
7
|
+
import React from 'react';
|
|
8
|
+
|
|
9
|
+
var __defProp = Object.defineProperty;
|
|
10
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
11
|
+
|
|
12
|
+
// util/spread-to-transform.ts
|
|
13
|
+
function spreadToTransform(t) {
|
|
14
|
+
let transformStrings = [];
|
|
15
|
+
const scaleVal = "scale" in t ? t.scale : void 0;
|
|
16
|
+
if (scaleVal) {
|
|
17
|
+
if (typeof scaleVal === "number") {
|
|
18
|
+
transformStrings.push(`scale(${scaleVal})`);
|
|
19
|
+
} else if (Array.isArray(scaleVal) && scaleVal.length == 2 && typeof scaleVal[0] === "number") {
|
|
20
|
+
transformStrings.push(`scale(${scaleVal[0]}, ${scaleVal[1]})`);
|
|
21
|
+
} else {
|
|
22
|
+
throw new Error("parsing MediaTransform: Unrecognized value for 'scale'!");
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
return transformStrings.length > 0 ? { transform: transformStrings.join(" ") } : {};
|
|
26
|
+
}
|
|
27
|
+
__name(spreadToTransform, "spreadToTransform");
|
|
28
|
+
var spread_to_transform_default = spreadToTransform;
|
|
29
|
+
function cn(...inputs) {
|
|
30
|
+
return twMerge(clsx(inputs));
|
|
31
|
+
}
|
|
32
|
+
__name(cn, "cn");
|
|
33
|
+
|
|
34
|
+
// util/index.ts
|
|
35
|
+
function constrain(value, minOrConstrainTo, max) {
|
|
36
|
+
if (typeof value === "number" && typeof minOrConstrainTo === "number" && typeof max === "number") {
|
|
37
|
+
return Math.min(Math.max(value, minOrConstrainTo), max);
|
|
38
|
+
}
|
|
39
|
+
if (typeof value === "object" && typeof minOrConstrainTo === "object") {
|
|
40
|
+
const dim = value;
|
|
41
|
+
const constrainTo = minOrConstrainTo;
|
|
42
|
+
const aspectRatio = dim.w / dim.h;
|
|
43
|
+
const constrainAspectRatio = constrainTo.w / constrainTo.h;
|
|
44
|
+
if (aspectRatio > constrainAspectRatio) {
|
|
45
|
+
return {
|
|
46
|
+
w: constrainTo.w,
|
|
47
|
+
h: constrainTo.w / aspectRatio
|
|
48
|
+
};
|
|
49
|
+
} else {
|
|
50
|
+
return {
|
|
51
|
+
w: constrainTo.h * aspectRatio,
|
|
52
|
+
h: constrainTo.h
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
throw new Error("Invalid parameters for constrain function");
|
|
57
|
+
}
|
|
58
|
+
__name(constrain, "constrain");
|
|
59
|
+
var Image = /* @__PURE__ */ __name(({
|
|
60
|
+
def,
|
|
61
|
+
constrainTo,
|
|
62
|
+
transform = {},
|
|
63
|
+
fullWidth = false,
|
|
64
|
+
className = "",
|
|
65
|
+
preload = false
|
|
66
|
+
}) => {
|
|
67
|
+
const {
|
|
68
|
+
src,
|
|
69
|
+
alt: _alt,
|
|
70
|
+
dim,
|
|
71
|
+
sizes,
|
|
72
|
+
svgFillClass: _svgFillClass
|
|
73
|
+
} = def;
|
|
74
|
+
const toSpread = {};
|
|
75
|
+
if (fullWidth) {
|
|
76
|
+
toSpread.style = {
|
|
77
|
+
width: "100%",
|
|
78
|
+
height: "auto",
|
|
79
|
+
...spread_to_transform_default(transform)
|
|
80
|
+
};
|
|
81
|
+
if (constrainTo) {
|
|
82
|
+
toSpread.style.maxWidth = constrainTo.w;
|
|
83
|
+
toSpread.style.maxHeight = constrainTo.h;
|
|
84
|
+
}
|
|
85
|
+
} else {
|
|
86
|
+
const resolved = constrainTo ? constrain(dim, constrainTo) : dim;
|
|
87
|
+
toSpread.width = resolved.w;
|
|
88
|
+
toSpread.height = resolved.h;
|
|
89
|
+
toSpread.style = { ...spread_to_transform_default(transform) };
|
|
90
|
+
}
|
|
91
|
+
if (sizes) {
|
|
92
|
+
toSpread.sizes = sizes;
|
|
93
|
+
}
|
|
94
|
+
let alt;
|
|
95
|
+
if (_alt) {
|
|
96
|
+
alt = _alt;
|
|
97
|
+
} else {
|
|
98
|
+
const tokens = src.split("/");
|
|
99
|
+
alt = tokens.length > 0 ? tokens[tokens.length - 1] : src;
|
|
100
|
+
}
|
|
101
|
+
const svgFillClass = _svgFillClass ?? "";
|
|
102
|
+
return fullWidth ? /* @__PURE__ */ jsx("div", { className: "relative flex flex-col items-center justify-center w-full", children: /* @__PURE__ */ jsx(
|
|
103
|
+
NextImage,
|
|
104
|
+
{
|
|
105
|
+
src,
|
|
106
|
+
alt,
|
|
107
|
+
...toSpread,
|
|
108
|
+
priority: preload,
|
|
109
|
+
loading: preload ? "eager" : "lazy",
|
|
110
|
+
className: cn(svgFillClass, className)
|
|
111
|
+
}
|
|
112
|
+
) }) : /* @__PURE__ */ jsx(
|
|
113
|
+
NextImage,
|
|
114
|
+
{
|
|
115
|
+
src,
|
|
116
|
+
alt,
|
|
117
|
+
...toSpread,
|
|
118
|
+
priority: preload,
|
|
119
|
+
loading: preload ? "eager" : "lazy",
|
|
120
|
+
className: cn(svgFillClass, className)
|
|
121
|
+
}
|
|
122
|
+
);
|
|
123
|
+
}, "Image");
|
|
124
|
+
var image_default = Image;
|
|
125
|
+
var VideoPlayer = React.forwardRef(
|
|
126
|
+
({
|
|
127
|
+
sources,
|
|
128
|
+
...rest
|
|
129
|
+
}, ref) => {
|
|
130
|
+
return /* @__PURE__ */ jsx("video", { ref, ...rest, children: sources.map((source, index) => /* @__PURE__ */ jsx("source", { src: source }, index)) });
|
|
131
|
+
}
|
|
132
|
+
);
|
|
133
|
+
var video_player_default = VideoPlayer;
|
|
134
|
+
var MediaStack = /* @__PURE__ */ __name(({
|
|
135
|
+
media,
|
|
136
|
+
constrainTo: cnst = { w: 250, h: 250 },
|
|
137
|
+
clx = ""
|
|
138
|
+
}) => {
|
|
139
|
+
const { img, video, animation, mediaTransform } = media;
|
|
140
|
+
const transform = mediaTransform ?? {};
|
|
141
|
+
if (animation) {
|
|
142
|
+
return /* @__PURE__ */ jsx(
|
|
143
|
+
Spline,
|
|
144
|
+
{
|
|
145
|
+
scene: animation,
|
|
146
|
+
className: cn(clx, "pointer-events-none"),
|
|
147
|
+
"data-vaul-no-drag": true,
|
|
148
|
+
style: {
|
|
149
|
+
width: 6 / 5 * (typeof cnst.h === "number" ? cnst.h : parseInt(cnst.h)),
|
|
150
|
+
height: cnst.h,
|
|
151
|
+
...spread_to_transform_default(transform)
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
);
|
|
155
|
+
}
|
|
156
|
+
if (video) {
|
|
157
|
+
const dim = constrain(video.dim.md, cnst);
|
|
158
|
+
return /* @__PURE__ */ jsx(
|
|
159
|
+
video_player_default,
|
|
160
|
+
{
|
|
161
|
+
className: clx,
|
|
162
|
+
sources: video.sources,
|
|
163
|
+
width: dim.w,
|
|
164
|
+
height: dim.h,
|
|
165
|
+
style: {
|
|
166
|
+
minHeight: dim.h,
|
|
167
|
+
...spread_to_transform_default(transform)
|
|
168
|
+
},
|
|
169
|
+
...video.videoProps
|
|
170
|
+
}
|
|
171
|
+
);
|
|
172
|
+
}
|
|
173
|
+
return img ? /* @__PURE__ */ jsx(
|
|
174
|
+
image_default,
|
|
175
|
+
{
|
|
176
|
+
def: img,
|
|
177
|
+
constrainTo: cnst,
|
|
178
|
+
className: clx,
|
|
179
|
+
transform
|
|
180
|
+
}
|
|
181
|
+
) : /* @__PURE__ */ jsx("div", { style: { width: cnst.w, height: cnst.h }, className: cn("bg-level-2", clx) });
|
|
182
|
+
}, "MediaStack");
|
|
183
|
+
var media_stack_default = MediaStack;
|
|
184
|
+
|
|
185
|
+
export { media_stack_default as default };
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
var Spline = require('@splinetool/react-spline');
|
|
5
|
+
var clsx = require('clsx');
|
|
6
|
+
var tailwindMerge = require('tailwind-merge');
|
|
7
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
8
|
+
|
|
9
|
+
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
|
+
|
|
11
|
+
var Spline__default = /*#__PURE__*/_interopDefault(Spline);
|
|
12
|
+
|
|
13
|
+
var __defProp = Object.defineProperty;
|
|
14
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
15
|
+
function cn(...inputs) {
|
|
16
|
+
return tailwindMerge.twMerge(clsx.clsx(inputs));
|
|
17
|
+
}
|
|
18
|
+
__name(cn, "cn");
|
|
19
|
+
var SplinePlayer = /* @__PURE__ */ __name(({
|
|
20
|
+
scene,
|
|
21
|
+
className,
|
|
22
|
+
style,
|
|
23
|
+
onLoad
|
|
24
|
+
}) => {
|
|
25
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
26
|
+
Spline__default.default,
|
|
27
|
+
{
|
|
28
|
+
scene,
|
|
29
|
+
className: cn("pointer-events-none", className),
|
|
30
|
+
style,
|
|
31
|
+
onLoad
|
|
32
|
+
}
|
|
33
|
+
);
|
|
34
|
+
}, "SplinePlayer");
|
|
35
|
+
var player_default = SplinePlayer;
|
|
36
|
+
|
|
37
|
+
module.exports = player_default;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import Spline from '@splinetool/react-spline';
|
|
3
|
+
import { clsx } from 'clsx';
|
|
4
|
+
import { twMerge } from 'tailwind-merge';
|
|
5
|
+
import { jsx } from 'react/jsx-runtime';
|
|
6
|
+
|
|
7
|
+
var __defProp = Object.defineProperty;
|
|
8
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
9
|
+
function cn(...inputs) {
|
|
10
|
+
return twMerge(clsx(inputs));
|
|
11
|
+
}
|
|
12
|
+
__name(cn, "cn");
|
|
13
|
+
var SplinePlayer = /* @__PURE__ */ __name(({
|
|
14
|
+
scene,
|
|
15
|
+
className,
|
|
16
|
+
style,
|
|
17
|
+
onLoad
|
|
18
|
+
}) => {
|
|
19
|
+
return /* @__PURE__ */ jsx(
|
|
20
|
+
Spline,
|
|
21
|
+
{
|
|
22
|
+
scene,
|
|
23
|
+
className: cn("pointer-events-none", className),
|
|
24
|
+
style,
|
|
25
|
+
onLoad
|
|
26
|
+
}
|
|
27
|
+
);
|
|
28
|
+
}, "SplinePlayer");
|
|
29
|
+
var player_default = SplinePlayer;
|
|
30
|
+
|
|
31
|
+
export { player_default as default };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hanzo/ui",
|
|
3
|
-
"version": "5.3.
|
|
3
|
+
"version": "5.3.33",
|
|
4
4
|
"description": "Multi-framework UI library with React, Vue, Svelte, and React Native support. Based on shadcn/ui with comprehensive framework coverage.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/",
|
|
@@ -424,6 +424,36 @@
|
|
|
424
424
|
"import": "./dist/code/*.mjs",
|
|
425
425
|
"require": "./dist/code/*.js"
|
|
426
426
|
},
|
|
427
|
+
"./spline": {
|
|
428
|
+
"types": "./dist/spline/index.d.ts",
|
|
429
|
+
"import": "./dist/spline/index.mjs",
|
|
430
|
+
"require": "./dist/spline/index.js"
|
|
431
|
+
},
|
|
432
|
+
"./spline/*": {
|
|
433
|
+
"types": "./dist/spline/*.d.ts",
|
|
434
|
+
"import": "./dist/spline/*.mjs",
|
|
435
|
+
"require": "./dist/spline/*.js"
|
|
436
|
+
},
|
|
437
|
+
"./charts": {
|
|
438
|
+
"types": "./dist/charts/index.d.ts",
|
|
439
|
+
"import": "./dist/charts/index.mjs",
|
|
440
|
+
"require": "./dist/charts/index.js"
|
|
441
|
+
},
|
|
442
|
+
"./kanban": {
|
|
443
|
+
"types": "./dist/kanban/index.d.ts",
|
|
444
|
+
"import": "./dist/kanban/index.mjs",
|
|
445
|
+
"require": "./dist/kanban/index.js"
|
|
446
|
+
},
|
|
447
|
+
"./mermaid": {
|
|
448
|
+
"types": "./dist/mermaid/index.d.ts",
|
|
449
|
+
"import": "./dist/mermaid/index.mjs",
|
|
450
|
+
"require": "./dist/mermaid/index.js"
|
|
451
|
+
},
|
|
452
|
+
"./calendar-ext": {
|
|
453
|
+
"types": "./dist/calendar-ext/index.d.ts",
|
|
454
|
+
"import": "./dist/calendar-ext/index.mjs",
|
|
455
|
+
"require": "./dist/calendar-ext/index.js"
|
|
456
|
+
},
|
|
427
457
|
"./3d": {
|
|
428
458
|
"types": "./dist/3d/index.d.ts",
|
|
429
459
|
"import": "./dist/3d/index.mjs",
|
|
@@ -569,13 +599,7 @@
|
|
|
569
599
|
}
|
|
570
600
|
},
|
|
571
601
|
"dependencies": {
|
|
572
|
-
"@hanzo/docs-core": "^16.2.6",
|
|
573
|
-
"@dnd-kit/core": "^6.3.1",
|
|
574
|
-
"@dnd-kit/modifiers": "^9.0.0",
|
|
575
|
-
"@dnd-kit/sortable": "^10.0.0",
|
|
576
|
-
"@dnd-kit/utilities": "^3.2.2",
|
|
577
602
|
"@hanzo/react-drawer": "^0.1.8",
|
|
578
|
-
"@modelcontextprotocol/sdk": "^1.10.2",
|
|
579
603
|
"@next/third-parties": "^15.0.1",
|
|
580
604
|
"@radix-ui/react-accordion": "^1.2.12",
|
|
581
605
|
"@radix-ui/react-alert-dialog": "^1.1.15",
|
|
@@ -607,14 +631,11 @@
|
|
|
607
631
|
"@radix-ui/react-tooltip": "^1.2.8",
|
|
608
632
|
"@radix-ui/react-use-callback-ref": "^1.1.1",
|
|
609
633
|
"@tailwindcss/container-queries": "^0.1.1",
|
|
610
|
-
"@tanstack/react-table": "^8.21.3",
|
|
611
634
|
"buffer": "^6.0.3",
|
|
612
|
-
"chrono-node": "^2.7.0",
|
|
613
635
|
"class-variance-authority": "^0.7.1",
|
|
614
636
|
"clsx": "^2.1.1",
|
|
615
637
|
"cmdk": "^0.2.0",
|
|
616
638
|
"commander": "^12.1.0",
|
|
617
|
-
"date-fns": "^3.0.0",
|
|
618
639
|
"embla-carousel-react": "^8.0.0",
|
|
619
640
|
"input-otp": "^1.2.4",
|
|
620
641
|
"little-date": "^1.0.0",
|
|
@@ -622,11 +643,7 @@
|
|
|
622
643
|
"lodash.isplainobject": "^4.0.6",
|
|
623
644
|
"lodash.merge": "^4.6.2",
|
|
624
645
|
"postcss-selector-parser": "^6.0.16",
|
|
625
|
-
"react-day-picker": "^9.0.0",
|
|
626
|
-
"react-hook-form": "^7.49.0",
|
|
627
646
|
"react-intersection-observer": "^9.8.2",
|
|
628
|
-
"react-resizable-panels": "^1.0.5",
|
|
629
|
-
"recharts": "^2.10.0",
|
|
630
647
|
"sonner": "^1.3.1",
|
|
631
648
|
"svg-pan-zoom": "^3.6.2",
|
|
632
649
|
"tailwind-merge": "^2.6.0",
|
|
@@ -637,8 +654,21 @@
|
|
|
637
654
|
"zod-to-json-schema": "^3.23.2"
|
|
638
655
|
},
|
|
639
656
|
"peerDependencies": {
|
|
657
|
+
"@dnd-kit/core": "^6.0.0",
|
|
658
|
+
"@dnd-kit/modifiers": "^9.0.0",
|
|
659
|
+
"@dnd-kit/sortable": "^10.0.0",
|
|
660
|
+
"@dnd-kit/utilities": "^3.2.0",
|
|
661
|
+
"@hanzo/docs-core": "^16.0.0",
|
|
640
662
|
"@hookform/resolvers": "^3.3.2",
|
|
663
|
+
"@modelcontextprotocol/sdk": "^1.0.0",
|
|
641
664
|
"@tanstack/react-query": "^5.0.0",
|
|
665
|
+
"@tanstack/react-table": "^8.0.0",
|
|
666
|
+
"chrono-node": "^2.0.0",
|
|
667
|
+
"date-fns": "^3.0.0",
|
|
668
|
+
"react-day-picker": "^9.0.0",
|
|
669
|
+
"react-hook-form": "^7.0.0",
|
|
670
|
+
"react-resizable-panels": "^1.0.0",
|
|
671
|
+
"recharts": "^2.0.0",
|
|
642
672
|
"framer-motion": "^11.0.0",
|
|
643
673
|
"lucide-react": "0.456.0",
|
|
644
674
|
"mermaid": "^10.0.0",
|
|
@@ -652,9 +682,33 @@
|
|
|
652
682
|
"validator": "^13.11.0"
|
|
653
683
|
},
|
|
654
684
|
"peerDependenciesMeta": {
|
|
685
|
+
"@dnd-kit/core": {
|
|
686
|
+
"optional": true
|
|
687
|
+
},
|
|
688
|
+
"@dnd-kit/modifiers": {
|
|
689
|
+
"optional": true
|
|
690
|
+
},
|
|
691
|
+
"@dnd-kit/sortable": {
|
|
692
|
+
"optional": true
|
|
693
|
+
},
|
|
694
|
+
"@dnd-kit/utilities": {
|
|
695
|
+
"optional": true
|
|
696
|
+
},
|
|
697
|
+
"@hanzo/docs-core": {
|
|
698
|
+
"optional": true
|
|
699
|
+
},
|
|
700
|
+
"@modelcontextprotocol/sdk": {
|
|
701
|
+
"optional": true
|
|
702
|
+
},
|
|
655
703
|
"@tanstack/react-query": {
|
|
656
704
|
"optional": true
|
|
657
705
|
},
|
|
706
|
+
"@tanstack/react-table": {
|
|
707
|
+
"optional": true
|
|
708
|
+
},
|
|
709
|
+
"chrono-node": {
|
|
710
|
+
"optional": true
|
|
711
|
+
},
|
|
658
712
|
"cmdk": {
|
|
659
713
|
"optional": true
|
|
660
714
|
},
|
|
@@ -705,6 +759,7 @@
|
|
|
705
759
|
"@mdx-js/loader": "^3.0.0",
|
|
706
760
|
"@mdx-js/react": "^3.0.0",
|
|
707
761
|
"@radix-ui/react-primitive": "^2.1.3",
|
|
762
|
+
"@splinetool/react-spline": "^4.0.0",
|
|
708
763
|
"@testing-library/jest-dom": "^6.9.1",
|
|
709
764
|
"@testing-library/react": "^16.3.0",
|
|
710
765
|
"@types/facebook-pixel": "^0.0.30",
|