@hanzo/ui 5.3.28 → 5.3.30
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/3d/button.js +298 -0
- package/dist/3d/button.mjs +273 -0
- package/dist/3d/card.js +234 -0
- package/dist/3d/card.mjs +207 -0
- package/dist/3d/carousel.js +371 -0
- package/dist/3d/carousel.mjs +344 -0
- package/dist/3d/grid.js +362 -0
- package/dist/3d/grid.mjs +337 -0
- package/dist/3d/index.js +1518 -0
- package/dist/3d/index.mjs +1472 -0
- package/dist/3d/marquee.js +352 -0
- package/dist/3d/marquee.mjs +327 -0
- package/dist/3d/pin.js +46 -0
- package/dist/3d/pin.mjs +24 -0
- package/dist/accordion.js +80 -0
- package/dist/accordion.mjs +55 -0
- package/dist/alert-dialog.js +220 -0
- package/dist/alert-dialog.mjs +187 -0
- package/dist/alert.js +68 -0
- package/dist/alert.mjs +64 -0
- package/dist/animation/animated-background.js +424 -0
- package/dist/animation/animated-background.mjs +418 -0
- package/dist/animation/animated-beam.js +119 -0
- package/dist/animation/animated-beam.mjs +97 -0
- package/dist/animation/animated-cursor.js +275 -0
- package/dist/animation/animated-cursor.mjs +270 -0
- package/dist/animation/animated-icon.js +357 -0
- package/dist/animation/animated-icon.mjs +351 -0
- package/dist/animation/animated-list.js +339 -0
- package/dist/animation/animated-list.mjs +333 -0
- package/dist/animation/animated-number.js +283 -0
- package/dist/animation/animated-number.mjs +277 -0
- package/dist/animation/animated-testimonials.js +97 -0
- package/dist/animation/animated-testimonials.mjs +75 -0
- package/dist/animation/animated-tooltip.js +67 -0
- package/dist/animation/animated-tooltip.mjs +45 -0
- package/dist/animation/apple-cards-carousel.js +308 -0
- package/dist/animation/apple-cards-carousel.mjs +285 -0
- package/dist/animation/apple-hello-effect.js +60 -0
- package/dist/animation/apple-hello-effect.mjs +38 -0
- package/dist/animation/index.js +1952 -0
- package/dist/animation/index.mjs +1921 -0
- package/dist/avatar.js +71 -0
- package/dist/avatar.mjs +47 -0
- package/dist/badge.js +66 -0
- package/dist/badge.mjs +40 -0
- package/dist/blocks/index.js +1665 -0
- package/dist/blocks/index.mjs +1626 -0
- package/dist/breadcrumb.js +107 -0
- package/dist/breadcrumb.mjs +99 -0
- package/dist/calendar.js +189 -0
- package/dist/calendar.mjs +164 -0
- package/dist/carousel.js +278 -0
- package/dist/carousel.mjs +249 -0
- package/dist/checkbox.js +60 -0
- package/dist/checkbox.mjs +35 -0
- package/dist/code/block.js +226 -0
- package/dist/code/block.mjs +203 -0
- package/dist/code/compare.js +446 -0
- package/dist/code/compare.mjs +423 -0
- package/dist/code/diff.js +430 -0
- package/dist/code/diff.mjs +407 -0
- package/dist/code/editor.js +243 -0
- package/dist/code/editor.mjs +218 -0
- package/dist/code/explorer.js +291 -0
- package/dist/code/explorer.mjs +268 -0
- package/dist/code/index.js +2551 -0
- package/dist/code/index.mjs +2510 -0
- package/dist/code/preview.js +400 -0
- package/dist/code/preview.mjs +377 -0
- package/dist/code/snippet.js +274 -0
- package/dist/code/snippet.mjs +250 -0
- package/dist/code/tabs.js +75 -0
- package/dist/code/tabs.mjs +53 -0
- package/dist/code/terminal.js +437 -0
- package/dist/code/terminal.mjs +414 -0
- package/dist/collapsible.js +33 -0
- package/dist/collapsible.mjs +9 -0
- package/dist/command.js +262 -0
- package/dist/command.mjs +232 -0
- package/dist/context-menu.js +207 -0
- package/dist/context-menu.mjs +171 -0
- package/dist/device/index.js +3 -0
- package/dist/device/index.mjs +2 -0
- package/dist/dialog.js +151 -0
- package/dist/dialog.mjs +121 -0
- package/dist/dock/basic.js +174 -0
- package/dist/dock/basic.mjs +151 -0
- package/dist/dock/index.js +628 -0
- package/dist/dock/index.mjs +601 -0
- package/dist/dock/limelight-nav.js +295 -0
- package/dist/dock/limelight-nav.mjs +274 -0
- package/dist/dock/macos.js +141 -0
- package/dist/dock/macos.mjs +118 -0
- package/dist/dock/menu.js +70 -0
- package/dist/dock/menu.mjs +48 -0
- package/dist/dock/message.js +144 -0
- package/dist/dock/message.mjs +122 -0
- package/dist/drawer.js +115 -0
- package/dist/drawer.mjs +103 -0
- package/dist/dropdown-menu.js +202 -0
- package/dist/dropdown-menu.mjs +166 -0
- package/dist/finance/AdvancedChart.js +48 -0
- package/dist/finance/AdvancedChart.mjs +46 -0
- package/dist/finance/CompanyProfile.js +48 -0
- package/dist/finance/CompanyProfile.mjs +46 -0
- package/dist/finance/CryptoScreener.js +45 -0
- package/dist/finance/CryptoScreener.mjs +43 -0
- package/dist/finance/Financials.js +52 -0
- package/dist/finance/Financials.mjs +50 -0
- package/dist/finance/ForexScreener.js +46 -0
- package/dist/finance/ForexScreener.mjs +44 -0
- package/dist/finance/MarketOverview.js +104 -0
- package/dist/finance/MarketOverview.mjs +102 -0
- package/dist/finance/NewsTimeline.js +44 -0
- package/dist/finance/NewsTimeline.mjs +42 -0
- package/dist/finance/OrderEntry.js +131 -0
- package/dist/finance/OrderEntry.mjs +129 -0
- package/dist/finance/OrdersHistory.js +64 -0
- package/dist/finance/OrdersHistory.mjs +62 -0
- package/dist/finance/PositionsList.js +80 -0
- package/dist/finance/PositionsList.mjs +78 -0
- package/dist/finance/StockScreener.js +46 -0
- package/dist/finance/StockScreener.mjs +44 -0
- package/dist/finance/SymbolInfo.js +46 -0
- package/dist/finance/SymbolInfo.mjs +44 -0
- package/dist/finance/TechnicalAnalysis.js +54 -0
- package/dist/finance/TechnicalAnalysis.mjs +52 -0
- package/dist/finance/TickerTape.js +56 -0
- package/dist/finance/TickerTape.mjs +54 -0
- package/dist/finance/TradingPanel.js +191 -0
- package/dist/finance/TradingPanel.mjs +189 -0
- package/dist/finance/index.js +930 -0
- package/dist/finance/index.mjs +914 -0
- package/dist/form/index.js +155 -0
- package/dist/form/index.mjs +125 -0
- package/dist/form.js +172 -0
- package/dist/form.mjs +142 -0
- package/dist/hover-card.js +58 -0
- package/dist/hover-card.mjs +34 -0
- package/dist/index.js +8467 -0
- package/dist/index.mjs +8087 -0
- package/dist/input-otp.js +79 -0
- package/dist/input-otp.mjs +54 -0
- package/dist/lib/utils.js +28 -0
- package/dist/lib/utils.mjs +24 -0
- package/dist/navigation/index.js +98 -0
- package/dist/navigation/index.mjs +79 -0
- package/dist/navigation-menu.js +149 -0
- package/dist/navigation-menu.mjs +116 -0
- package/dist/pattern/grid-pattern.js +333 -0
- package/dist/pattern/grid-pattern.mjs +310 -0
- package/dist/pattern/index.js +333 -0
- package/dist/pattern/index.mjs +310 -0
- package/dist/popover.js +63 -0
- package/dist/popover.mjs +37 -0
- package/dist/primitives/index.js +8467 -0
- package/dist/primitives/index.mjs +8087 -0
- package/dist/primitives-export.js +8467 -0
- package/dist/primitives-export.mjs +8087 -0
- package/dist/progress.js +62 -0
- package/dist/progress.mjs +37 -0
- package/dist/project/gantt.js +65 -0
- package/dist/project/gantt.mjs +43 -0
- package/dist/project/index.js +636 -0
- package/dist/project/index.mjs +611 -0
- package/dist/project/kanban.js +597 -0
- package/dist/project/kanban.mjs +572 -0
- package/dist/project/list.js +35 -0
- package/dist/project/list.mjs +12 -0
- package/dist/radio-group.js +68 -0
- package/dist/radio-group.mjs +45 -0
- package/dist/resizable.js +72 -0
- package/dist/resizable.mjs +48 -0
- package/dist/scroll-area.js +89 -0
- package/dist/scroll-area.mjs +66 -0
- package/dist/select.js +140 -0
- package/dist/select.mjs +111 -0
- package/dist/separator.js +59 -0
- package/dist/separator.mjs +34 -0
- package/dist/sheet.js +148 -0
- package/dist/sheet.mjs +117 -0
- package/dist/skeleton.js +32 -0
- package/dist/skeleton.mjs +27 -0
- package/dist/slider.js +99 -0
- package/dist/slider.mjs +73 -0
- package/dist/sonner.js +34 -0
- package/dist/sonner.mjs +29 -0
- package/dist/switch.js +62 -0
- package/dist/switch.mjs +37 -0
- package/dist/table.js +110 -0
- package/dist/table.mjs +101 -0
- package/dist/tabs.js +82 -0
- package/dist/tabs.mjs +57 -0
- package/dist/tailwind/index.js +2023 -0
- package/dist/tailwind/index.mjs +2011 -0
- package/dist/textarea.js +78 -0
- package/dist/textarea.mjs +56 -0
- package/dist/toggle-group.js +118 -0
- package/dist/toggle-group.mjs +93 -0
- package/dist/toggle.js +71 -0
- package/dist/toggle.mjs +48 -0
- package/dist/tooltip.js +67 -0
- package/dist/tooltip.mjs +40 -0
- package/dist/types/index.js +57 -0
- package/dist/types/index.mjs +51 -0
- package/dist/ui/announcement.js +129 -0
- package/dist/ui/announcement.mjs +107 -0
- package/dist/ui/avatar-group.js +88 -0
- package/dist/ui/avatar-group.mjs +65 -0
- package/dist/ui/banner.js +85 -0
- package/dist/ui/banner.mjs +62 -0
- package/dist/ui/cursor.js +78 -0
- package/dist/ui/cursor.mjs +56 -0
- package/dist/ui/index.js +475 -0
- package/dist/ui/index.mjs +442 -0
- package/dist/ui/marquee.js +74 -0
- package/dist/ui/marquee.mjs +52 -0
- package/dist/ui/pill.js +85 -0
- package/dist/ui/pill.mjs +62 -0
- package/dist/ui/spinner.js +28 -0
- package/dist/ui/spinner.mjs +26 -0
- package/dist/ui/tags.js +101 -0
- package/dist/ui/tags.mjs +79 -0
- package/dist/ui/ticker.js +73 -0
- package/dist/ui/ticker.mjs +51 -0
- package/dist/util/index.js +463 -0
- package/dist/util/index.mjs +404 -0
- package/package.json +1 -1
|
@@ -0,0 +1,295 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
var React4 = require('react');
|
|
5
|
+
var lucideReact = require('lucide-react');
|
|
6
|
+
var clsx = require('clsx');
|
|
7
|
+
var tailwindMerge = require('tailwind-merge');
|
|
8
|
+
var reactSlot = require('@radix-ui/react-slot');
|
|
9
|
+
var classVarianceAuthority = require('class-variance-authority');
|
|
10
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
11
|
+
|
|
12
|
+
function _interopNamespace(e) {
|
|
13
|
+
if (e && e.__esModule) return e;
|
|
14
|
+
var n = Object.create(null);
|
|
15
|
+
if (e) {
|
|
16
|
+
Object.keys(e).forEach(function (k) {
|
|
17
|
+
if (k !== 'default') {
|
|
18
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
19
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
20
|
+
enumerable: true,
|
|
21
|
+
get: function () { return e[k]; }
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
n.default = e;
|
|
27
|
+
return Object.freeze(n);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
var React4__namespace = /*#__PURE__*/_interopNamespace(React4);
|
|
31
|
+
|
|
32
|
+
var __defProp = Object.defineProperty;
|
|
33
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
34
|
+
function cn(...inputs) {
|
|
35
|
+
return tailwindMerge.twMerge(clsx.clsx(inputs));
|
|
36
|
+
}
|
|
37
|
+
__name(cn, "cn");
|
|
38
|
+
var buttonVariants = classVarianceAuthority.cva(
|
|
39
|
+
"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
|
|
40
|
+
{
|
|
41
|
+
variants: {
|
|
42
|
+
variant: {
|
|
43
|
+
default: "bg-primary text-primary-foreground shadow hover:bg-primary/90",
|
|
44
|
+
destructive: "bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",
|
|
45
|
+
outline: "border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",
|
|
46
|
+
secondary: "bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",
|
|
47
|
+
ghost: "hover:bg-accent hover:text-accent-foreground",
|
|
48
|
+
link: "text-primary underline-offset-4 hover:underline",
|
|
49
|
+
// Keep the additional Hanzo variants for backward compatibility
|
|
50
|
+
primary: "bg-primary text-primary-foreground shadow hover:bg-primary/90",
|
|
51
|
+
linkFG: "text-primary underline-offset-4 hover:underline",
|
|
52
|
+
linkMuted: "text-muted-foreground underline-offset-4 hover:underline hover:text-foreground"
|
|
53
|
+
},
|
|
54
|
+
size: {
|
|
55
|
+
default: "h-9 px-4 py-2",
|
|
56
|
+
sm: "h-8 rounded-md px-3 text-xs",
|
|
57
|
+
lg: "h-10 rounded-md px-8",
|
|
58
|
+
icon: "h-9 w-9"
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
defaultVariants: {
|
|
62
|
+
variant: "default",
|
|
63
|
+
size: "default"
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
);
|
|
67
|
+
var Button = React4__namespace.forwardRef(
|
|
68
|
+
({ className, variant, size, asChild = false, isLoading = false, children, ...props }, ref) => {
|
|
69
|
+
const Comp = asChild ? reactSlot.Slot : "button";
|
|
70
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
71
|
+
Comp,
|
|
72
|
+
{
|
|
73
|
+
className: cn(buttonVariants({ variant, size, className })),
|
|
74
|
+
ref,
|
|
75
|
+
...props,
|
|
76
|
+
children: [
|
|
77
|
+
isLoading ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
78
|
+
lucideReact.Loader2,
|
|
79
|
+
{
|
|
80
|
+
className: cn("h-4 w-4 animate-spin", size !== "icon" && "mr-2")
|
|
81
|
+
}
|
|
82
|
+
) : null,
|
|
83
|
+
isLoading && size === "icon" ? null : children
|
|
84
|
+
]
|
|
85
|
+
}
|
|
86
|
+
);
|
|
87
|
+
}
|
|
88
|
+
);
|
|
89
|
+
Button.displayName = "Button";
|
|
90
|
+
var badgeVariants = classVarianceAuthority.cva(
|
|
91
|
+
"focus:ring-ring border-divider inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:ring-2 focus:ring-offset-2 focus:outline-hidden",
|
|
92
|
+
{
|
|
93
|
+
variants: {
|
|
94
|
+
variant: {
|
|
95
|
+
default: "bg-primary text-primary-foreground hover:bg-primary/80 border-transparent shadow",
|
|
96
|
+
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80 border-transparent",
|
|
97
|
+
destructive: "bg-destructive text-destructive-foreground hover:bg-destructive/80 border-transparent shadow",
|
|
98
|
+
outline: "hover:bg-bg-secondary text-text-secondary hover:text-text-default border border-gray-500 bg-transparent shadow-xs",
|
|
99
|
+
inputAdornment: "bg-gray-600 px-2 font-medium text-white",
|
|
100
|
+
tags: "text-text-secondary border-divider bg-bg-quaternary rounded-lg px-2 py-1 font-normal capitalize"
|
|
101
|
+
}
|
|
102
|
+
},
|
|
103
|
+
defaultVariants: {
|
|
104
|
+
variant: "default"
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
);
|
|
108
|
+
var Badge = React4__namespace.forwardRef(
|
|
109
|
+
({ className, variant, ...props }, ref) => {
|
|
110
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { ref, className: cn(badgeVariants({ variant }), className), ...props });
|
|
111
|
+
}
|
|
112
|
+
);
|
|
113
|
+
Badge.displayName = "Badge";
|
|
114
|
+
var Input = /* @__PURE__ */ __name(({
|
|
115
|
+
className,
|
|
116
|
+
type,
|
|
117
|
+
startAdornment,
|
|
118
|
+
endAdornment,
|
|
119
|
+
hidePasswordToggle,
|
|
120
|
+
ref,
|
|
121
|
+
...props
|
|
122
|
+
}) => {
|
|
123
|
+
const inputRef = React4.useRef(null);
|
|
124
|
+
const startAdornmentRef = React4.useRef(null);
|
|
125
|
+
const endAdornmentRef = React4.useRef(null);
|
|
126
|
+
const [showPassword, setShowPassword] = React4__namespace.useState(false);
|
|
127
|
+
const togglePasswordVisibility = /* @__PURE__ */ __name(() => {
|
|
128
|
+
setShowPassword(!showPassword);
|
|
129
|
+
}, "togglePasswordVisibility");
|
|
130
|
+
const style = {};
|
|
131
|
+
if (startAdornment) {
|
|
132
|
+
style.paddingLeft = `${(startAdornmentRef?.current?.offsetWidth ?? 0) + 20}px`;
|
|
133
|
+
}
|
|
134
|
+
if (endAdornment) {
|
|
135
|
+
style.paddingRight = `${(endAdornmentRef?.current?.offsetWidth ?? 0) + 20}px`;
|
|
136
|
+
}
|
|
137
|
+
React4.useImperativeHandle(ref, () => inputRef.current, []);
|
|
138
|
+
React4.useEffect(() => {
|
|
139
|
+
if (props.autoFocus) {
|
|
140
|
+
setTimeout(() => {
|
|
141
|
+
inputRef?.current?.focus();
|
|
142
|
+
}, 0);
|
|
143
|
+
}
|
|
144
|
+
}, [props.autoFocus]);
|
|
145
|
+
const inputType = type === "password" && showPassword ? "text" : type;
|
|
146
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
147
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
148
|
+
"input",
|
|
149
|
+
{
|
|
150
|
+
className: cn(
|
|
151
|
+
"h-input border-border-input bg-bg-secondary focus:border-border-input-focus disabled:bg-bg-input-disabled peer placeholder-shown:border-border-input text-text-default w-full rounded-lg border px-4 py-3 pt-8 text-sm font-medium placeholder-transparent outline outline-0 transition-all placeholder-shown:border focus:border focus:outline-0 disabled:border-0 disabled:text-gray-400",
|
|
152
|
+
startAdornment && "pl-[var(--custom-padding-left-input)]",
|
|
153
|
+
endAdornment && "pr-[var(--custom-padding-right-input)]",
|
|
154
|
+
type === "password" && "pr-[60px]",
|
|
155
|
+
className
|
|
156
|
+
),
|
|
157
|
+
placeholder: " ",
|
|
158
|
+
ref: inputRef,
|
|
159
|
+
spellCheck: false,
|
|
160
|
+
style,
|
|
161
|
+
type: inputType,
|
|
162
|
+
...props
|
|
163
|
+
}
|
|
164
|
+
),
|
|
165
|
+
startAdornment ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
166
|
+
Badge,
|
|
167
|
+
{
|
|
168
|
+
className: "peer/adornment adornment absolute top-[30px] left-4",
|
|
169
|
+
ref: startAdornmentRef,
|
|
170
|
+
variant: "inputAdornment",
|
|
171
|
+
children: startAdornment
|
|
172
|
+
}
|
|
173
|
+
) : null,
|
|
174
|
+
endAdornment && typeof endAdornment === "string" ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
175
|
+
Badge,
|
|
176
|
+
{
|
|
177
|
+
className: "peer/adornment adornment absolute top-[30px] right-4",
|
|
178
|
+
ref: endAdornmentRef,
|
|
179
|
+
variant: "inputAdornment",
|
|
180
|
+
children: endAdornment
|
|
181
|
+
}
|
|
182
|
+
) : null,
|
|
183
|
+
endAdornment && typeof endAdornment !== "string" && React4__namespace.isValidElement(endAdornment) ? React4__namespace.cloneElement(endAdornment, {
|
|
184
|
+
ref: endAdornmentRef
|
|
185
|
+
}) : null,
|
|
186
|
+
type === "password" && !hidePasswordToggle && /* @__PURE__ */ jsxRuntime.jsx(
|
|
187
|
+
Button,
|
|
188
|
+
{
|
|
189
|
+
"aria-label": showPassword ? "Hide password" : "Show password",
|
|
190
|
+
className: "absolute top-3 right-3",
|
|
191
|
+
onClick: togglePasswordVisibility,
|
|
192
|
+
size: "icon",
|
|
193
|
+
type: "button",
|
|
194
|
+
variant: "ghost",
|
|
195
|
+
children: showPassword ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.EyeOffIcon, { "aria-hidden": "true", className: "h-4 w-4" }) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.EyeIcon, { "aria-hidden": "true", className: "h-4 w-4" })
|
|
196
|
+
}
|
|
197
|
+
)
|
|
198
|
+
] });
|
|
199
|
+
}, "Input");
|
|
200
|
+
Input.displayName = "Input";
|
|
201
|
+
var LimelightNav = React4__namespace.forwardRef(
|
|
202
|
+
({ className, items = [], ...props }, ref) => {
|
|
203
|
+
const [isOpen, setIsOpen] = React4__namespace.useState(false);
|
|
204
|
+
const [search, setSearch] = React4__namespace.useState("");
|
|
205
|
+
React4__namespace.useEffect(() => {
|
|
206
|
+
const down = /* @__PURE__ */ __name((e) => {
|
|
207
|
+
if (e.key === "k" && (e.metaKey || e.ctrlKey)) {
|
|
208
|
+
e.preventDefault();
|
|
209
|
+
setIsOpen((open) => !open);
|
|
210
|
+
}
|
|
211
|
+
}, "down");
|
|
212
|
+
document.addEventListener("keydown", down);
|
|
213
|
+
return () => document.removeEventListener("keydown", down);
|
|
214
|
+
}, []);
|
|
215
|
+
const filteredItems = items.filter(
|
|
216
|
+
(item) => item.label.toLowerCase().includes(search.toLowerCase())
|
|
217
|
+
);
|
|
218
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
219
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
220
|
+
"nav",
|
|
221
|
+
{
|
|
222
|
+
ref,
|
|
223
|
+
className: cn("flex items-center gap-4", className),
|
|
224
|
+
...props,
|
|
225
|
+
children: [
|
|
226
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
227
|
+
Button,
|
|
228
|
+
{
|
|
229
|
+
variant: "outline",
|
|
230
|
+
onClick: () => setIsOpen(true),
|
|
231
|
+
className: "relative w-64 justify-start",
|
|
232
|
+
children: [
|
|
233
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Search, { className: "mr-2 h-4 w-4" }),
|
|
234
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground", children: "Search..." }),
|
|
235
|
+
/* @__PURE__ */ jsxRuntime.jsxs("kbd", { className: "pointer-events-none absolute right-2 hidden h-5 select-none items-center gap-1 rounded border bg-muted px-1.5 font-mono text-[10px] font-medium opacity-100 sm:flex", children: [
|
|
236
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Command, { className: "h-3 w-3" }),
|
|
237
|
+
"K"
|
|
238
|
+
] })
|
|
239
|
+
]
|
|
240
|
+
}
|
|
241
|
+
),
|
|
242
|
+
items.slice(0, 4).map((item) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
243
|
+
"a",
|
|
244
|
+
{
|
|
245
|
+
href: item.href,
|
|
246
|
+
className: "text-sm font-medium transition-colors hover:text-primary",
|
|
247
|
+
children: item.label
|
|
248
|
+
},
|
|
249
|
+
item.href
|
|
250
|
+
))
|
|
251
|
+
]
|
|
252
|
+
}
|
|
253
|
+
),
|
|
254
|
+
isOpen && /* @__PURE__ */ jsxRuntime.jsx(
|
|
255
|
+
"div",
|
|
256
|
+
{
|
|
257
|
+
className: "fixed inset-0 z-50 bg-background/80 backdrop-blur-sm",
|
|
258
|
+
onClick: () => setIsOpen(false),
|
|
259
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
260
|
+
"div",
|
|
261
|
+
{
|
|
262
|
+
className: "fixed left-1/2 top-1/2 z-50 w-full max-w-lg -translate-x-1/2 -translate-y-1/2 rounded-lg border bg-card p-6 shadow-lg",
|
|
263
|
+
onClick: (e) => e.stopPropagation(),
|
|
264
|
+
children: [
|
|
265
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
266
|
+
Input,
|
|
267
|
+
{
|
|
268
|
+
placeholder: "Search navigation...",
|
|
269
|
+
value: search,
|
|
270
|
+
onChange: (e) => setSearch(e.target.value),
|
|
271
|
+
autoFocus: true,
|
|
272
|
+
className: "mb-4"
|
|
273
|
+
}
|
|
274
|
+
),
|
|
275
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "max-h-96 space-y-1 overflow-auto", children: filteredItems.map((item) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
276
|
+
"a",
|
|
277
|
+
{
|
|
278
|
+
href: item.href,
|
|
279
|
+
className: "block rounded-md px-4 py-2 hover:bg-accent",
|
|
280
|
+
onClick: () => setIsOpen(false),
|
|
281
|
+
children: item.label
|
|
282
|
+
},
|
|
283
|
+
item.href
|
|
284
|
+
)) })
|
|
285
|
+
]
|
|
286
|
+
}
|
|
287
|
+
)
|
|
288
|
+
}
|
|
289
|
+
)
|
|
290
|
+
] });
|
|
291
|
+
}
|
|
292
|
+
);
|
|
293
|
+
LimelightNav.displayName = "LimelightNav";
|
|
294
|
+
|
|
295
|
+
exports.LimelightNav = LimelightNav;
|
|
@@ -0,0 +1,274 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import * as React4 from 'react';
|
|
3
|
+
import { useRef, useImperativeHandle, useEffect } from 'react';
|
|
4
|
+
import { Loader2, Search, Command, EyeOffIcon, EyeIcon } from 'lucide-react';
|
|
5
|
+
import { clsx } from 'clsx';
|
|
6
|
+
import { twMerge } from 'tailwind-merge';
|
|
7
|
+
import { Slot } from '@radix-ui/react-slot';
|
|
8
|
+
import { cva } from 'class-variance-authority';
|
|
9
|
+
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
10
|
+
|
|
11
|
+
var __defProp = Object.defineProperty;
|
|
12
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
13
|
+
function cn(...inputs) {
|
|
14
|
+
return twMerge(clsx(inputs));
|
|
15
|
+
}
|
|
16
|
+
__name(cn, "cn");
|
|
17
|
+
var buttonVariants = cva(
|
|
18
|
+
"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
|
|
19
|
+
{
|
|
20
|
+
variants: {
|
|
21
|
+
variant: {
|
|
22
|
+
default: "bg-primary text-primary-foreground shadow hover:bg-primary/90",
|
|
23
|
+
destructive: "bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",
|
|
24
|
+
outline: "border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",
|
|
25
|
+
secondary: "bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",
|
|
26
|
+
ghost: "hover:bg-accent hover:text-accent-foreground",
|
|
27
|
+
link: "text-primary underline-offset-4 hover:underline",
|
|
28
|
+
// Keep the additional Hanzo variants for backward compatibility
|
|
29
|
+
primary: "bg-primary text-primary-foreground shadow hover:bg-primary/90",
|
|
30
|
+
linkFG: "text-primary underline-offset-4 hover:underline",
|
|
31
|
+
linkMuted: "text-muted-foreground underline-offset-4 hover:underline hover:text-foreground"
|
|
32
|
+
},
|
|
33
|
+
size: {
|
|
34
|
+
default: "h-9 px-4 py-2",
|
|
35
|
+
sm: "h-8 rounded-md px-3 text-xs",
|
|
36
|
+
lg: "h-10 rounded-md px-8",
|
|
37
|
+
icon: "h-9 w-9"
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
defaultVariants: {
|
|
41
|
+
variant: "default",
|
|
42
|
+
size: "default"
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
);
|
|
46
|
+
var Button = React4.forwardRef(
|
|
47
|
+
({ className, variant, size, asChild = false, isLoading = false, children, ...props }, ref) => {
|
|
48
|
+
const Comp = asChild ? Slot : "button";
|
|
49
|
+
return /* @__PURE__ */ jsxs(
|
|
50
|
+
Comp,
|
|
51
|
+
{
|
|
52
|
+
className: cn(buttonVariants({ variant, size, className })),
|
|
53
|
+
ref,
|
|
54
|
+
...props,
|
|
55
|
+
children: [
|
|
56
|
+
isLoading ? /* @__PURE__ */ jsx(
|
|
57
|
+
Loader2,
|
|
58
|
+
{
|
|
59
|
+
className: cn("h-4 w-4 animate-spin", size !== "icon" && "mr-2")
|
|
60
|
+
}
|
|
61
|
+
) : null,
|
|
62
|
+
isLoading && size === "icon" ? null : children
|
|
63
|
+
]
|
|
64
|
+
}
|
|
65
|
+
);
|
|
66
|
+
}
|
|
67
|
+
);
|
|
68
|
+
Button.displayName = "Button";
|
|
69
|
+
var badgeVariants = cva(
|
|
70
|
+
"focus:ring-ring border-divider inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:ring-2 focus:ring-offset-2 focus:outline-hidden",
|
|
71
|
+
{
|
|
72
|
+
variants: {
|
|
73
|
+
variant: {
|
|
74
|
+
default: "bg-primary text-primary-foreground hover:bg-primary/80 border-transparent shadow",
|
|
75
|
+
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80 border-transparent",
|
|
76
|
+
destructive: "bg-destructive text-destructive-foreground hover:bg-destructive/80 border-transparent shadow",
|
|
77
|
+
outline: "hover:bg-bg-secondary text-text-secondary hover:text-text-default border border-gray-500 bg-transparent shadow-xs",
|
|
78
|
+
inputAdornment: "bg-gray-600 px-2 font-medium text-white",
|
|
79
|
+
tags: "text-text-secondary border-divider bg-bg-quaternary rounded-lg px-2 py-1 font-normal capitalize"
|
|
80
|
+
}
|
|
81
|
+
},
|
|
82
|
+
defaultVariants: {
|
|
83
|
+
variant: "default"
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
);
|
|
87
|
+
var Badge = React4.forwardRef(
|
|
88
|
+
({ className, variant, ...props }, ref) => {
|
|
89
|
+
return /* @__PURE__ */ jsx("div", { ref, className: cn(badgeVariants({ variant }), className), ...props });
|
|
90
|
+
}
|
|
91
|
+
);
|
|
92
|
+
Badge.displayName = "Badge";
|
|
93
|
+
var Input = /* @__PURE__ */ __name(({
|
|
94
|
+
className,
|
|
95
|
+
type,
|
|
96
|
+
startAdornment,
|
|
97
|
+
endAdornment,
|
|
98
|
+
hidePasswordToggle,
|
|
99
|
+
ref,
|
|
100
|
+
...props
|
|
101
|
+
}) => {
|
|
102
|
+
const inputRef = useRef(null);
|
|
103
|
+
const startAdornmentRef = useRef(null);
|
|
104
|
+
const endAdornmentRef = useRef(null);
|
|
105
|
+
const [showPassword, setShowPassword] = React4.useState(false);
|
|
106
|
+
const togglePasswordVisibility = /* @__PURE__ */ __name(() => {
|
|
107
|
+
setShowPassword(!showPassword);
|
|
108
|
+
}, "togglePasswordVisibility");
|
|
109
|
+
const style = {};
|
|
110
|
+
if (startAdornment) {
|
|
111
|
+
style.paddingLeft = `${(startAdornmentRef?.current?.offsetWidth ?? 0) + 20}px`;
|
|
112
|
+
}
|
|
113
|
+
if (endAdornment) {
|
|
114
|
+
style.paddingRight = `${(endAdornmentRef?.current?.offsetWidth ?? 0) + 20}px`;
|
|
115
|
+
}
|
|
116
|
+
useImperativeHandle(ref, () => inputRef.current, []);
|
|
117
|
+
useEffect(() => {
|
|
118
|
+
if (props.autoFocus) {
|
|
119
|
+
setTimeout(() => {
|
|
120
|
+
inputRef?.current?.focus();
|
|
121
|
+
}, 0);
|
|
122
|
+
}
|
|
123
|
+
}, [props.autoFocus]);
|
|
124
|
+
const inputType = type === "password" && showPassword ? "text" : type;
|
|
125
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
126
|
+
/* @__PURE__ */ jsx(
|
|
127
|
+
"input",
|
|
128
|
+
{
|
|
129
|
+
className: cn(
|
|
130
|
+
"h-input border-border-input bg-bg-secondary focus:border-border-input-focus disabled:bg-bg-input-disabled peer placeholder-shown:border-border-input text-text-default w-full rounded-lg border px-4 py-3 pt-8 text-sm font-medium placeholder-transparent outline outline-0 transition-all placeholder-shown:border focus:border focus:outline-0 disabled:border-0 disabled:text-gray-400",
|
|
131
|
+
startAdornment && "pl-[var(--custom-padding-left-input)]",
|
|
132
|
+
endAdornment && "pr-[var(--custom-padding-right-input)]",
|
|
133
|
+
type === "password" && "pr-[60px]",
|
|
134
|
+
className
|
|
135
|
+
),
|
|
136
|
+
placeholder: " ",
|
|
137
|
+
ref: inputRef,
|
|
138
|
+
spellCheck: false,
|
|
139
|
+
style,
|
|
140
|
+
type: inputType,
|
|
141
|
+
...props
|
|
142
|
+
}
|
|
143
|
+
),
|
|
144
|
+
startAdornment ? /* @__PURE__ */ jsx(
|
|
145
|
+
Badge,
|
|
146
|
+
{
|
|
147
|
+
className: "peer/adornment adornment absolute top-[30px] left-4",
|
|
148
|
+
ref: startAdornmentRef,
|
|
149
|
+
variant: "inputAdornment",
|
|
150
|
+
children: startAdornment
|
|
151
|
+
}
|
|
152
|
+
) : null,
|
|
153
|
+
endAdornment && typeof endAdornment === "string" ? /* @__PURE__ */ jsx(
|
|
154
|
+
Badge,
|
|
155
|
+
{
|
|
156
|
+
className: "peer/adornment adornment absolute top-[30px] right-4",
|
|
157
|
+
ref: endAdornmentRef,
|
|
158
|
+
variant: "inputAdornment",
|
|
159
|
+
children: endAdornment
|
|
160
|
+
}
|
|
161
|
+
) : null,
|
|
162
|
+
endAdornment && typeof endAdornment !== "string" && React4.isValidElement(endAdornment) ? React4.cloneElement(endAdornment, {
|
|
163
|
+
ref: endAdornmentRef
|
|
164
|
+
}) : null,
|
|
165
|
+
type === "password" && !hidePasswordToggle && /* @__PURE__ */ jsx(
|
|
166
|
+
Button,
|
|
167
|
+
{
|
|
168
|
+
"aria-label": showPassword ? "Hide password" : "Show password",
|
|
169
|
+
className: "absolute top-3 right-3",
|
|
170
|
+
onClick: togglePasswordVisibility,
|
|
171
|
+
size: "icon",
|
|
172
|
+
type: "button",
|
|
173
|
+
variant: "ghost",
|
|
174
|
+
children: showPassword ? /* @__PURE__ */ jsx(EyeOffIcon, { "aria-hidden": "true", className: "h-4 w-4" }) : /* @__PURE__ */ jsx(EyeIcon, { "aria-hidden": "true", className: "h-4 w-4" })
|
|
175
|
+
}
|
|
176
|
+
)
|
|
177
|
+
] });
|
|
178
|
+
}, "Input");
|
|
179
|
+
Input.displayName = "Input";
|
|
180
|
+
var LimelightNav = React4.forwardRef(
|
|
181
|
+
({ className, items = [], ...props }, ref) => {
|
|
182
|
+
const [isOpen, setIsOpen] = React4.useState(false);
|
|
183
|
+
const [search, setSearch] = React4.useState("");
|
|
184
|
+
React4.useEffect(() => {
|
|
185
|
+
const down = /* @__PURE__ */ __name((e) => {
|
|
186
|
+
if (e.key === "k" && (e.metaKey || e.ctrlKey)) {
|
|
187
|
+
e.preventDefault();
|
|
188
|
+
setIsOpen((open) => !open);
|
|
189
|
+
}
|
|
190
|
+
}, "down");
|
|
191
|
+
document.addEventListener("keydown", down);
|
|
192
|
+
return () => document.removeEventListener("keydown", down);
|
|
193
|
+
}, []);
|
|
194
|
+
const filteredItems = items.filter(
|
|
195
|
+
(item) => item.label.toLowerCase().includes(search.toLowerCase())
|
|
196
|
+
);
|
|
197
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
198
|
+
/* @__PURE__ */ jsxs(
|
|
199
|
+
"nav",
|
|
200
|
+
{
|
|
201
|
+
ref,
|
|
202
|
+
className: cn("flex items-center gap-4", className),
|
|
203
|
+
...props,
|
|
204
|
+
children: [
|
|
205
|
+
/* @__PURE__ */ jsxs(
|
|
206
|
+
Button,
|
|
207
|
+
{
|
|
208
|
+
variant: "outline",
|
|
209
|
+
onClick: () => setIsOpen(true),
|
|
210
|
+
className: "relative w-64 justify-start",
|
|
211
|
+
children: [
|
|
212
|
+
/* @__PURE__ */ jsx(Search, { className: "mr-2 h-4 w-4" }),
|
|
213
|
+
/* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: "Search..." }),
|
|
214
|
+
/* @__PURE__ */ jsxs("kbd", { className: "pointer-events-none absolute right-2 hidden h-5 select-none items-center gap-1 rounded border bg-muted px-1.5 font-mono text-[10px] font-medium opacity-100 sm:flex", children: [
|
|
215
|
+
/* @__PURE__ */ jsx(Command, { className: "h-3 w-3" }),
|
|
216
|
+
"K"
|
|
217
|
+
] })
|
|
218
|
+
]
|
|
219
|
+
}
|
|
220
|
+
),
|
|
221
|
+
items.slice(0, 4).map((item) => /* @__PURE__ */ jsx(
|
|
222
|
+
"a",
|
|
223
|
+
{
|
|
224
|
+
href: item.href,
|
|
225
|
+
className: "text-sm font-medium transition-colors hover:text-primary",
|
|
226
|
+
children: item.label
|
|
227
|
+
},
|
|
228
|
+
item.href
|
|
229
|
+
))
|
|
230
|
+
]
|
|
231
|
+
}
|
|
232
|
+
),
|
|
233
|
+
isOpen && /* @__PURE__ */ jsx(
|
|
234
|
+
"div",
|
|
235
|
+
{
|
|
236
|
+
className: "fixed inset-0 z-50 bg-background/80 backdrop-blur-sm",
|
|
237
|
+
onClick: () => setIsOpen(false),
|
|
238
|
+
children: /* @__PURE__ */ jsxs(
|
|
239
|
+
"div",
|
|
240
|
+
{
|
|
241
|
+
className: "fixed left-1/2 top-1/2 z-50 w-full max-w-lg -translate-x-1/2 -translate-y-1/2 rounded-lg border bg-card p-6 shadow-lg",
|
|
242
|
+
onClick: (e) => e.stopPropagation(),
|
|
243
|
+
children: [
|
|
244
|
+
/* @__PURE__ */ jsx(
|
|
245
|
+
Input,
|
|
246
|
+
{
|
|
247
|
+
placeholder: "Search navigation...",
|
|
248
|
+
value: search,
|
|
249
|
+
onChange: (e) => setSearch(e.target.value),
|
|
250
|
+
autoFocus: true,
|
|
251
|
+
className: "mb-4"
|
|
252
|
+
}
|
|
253
|
+
),
|
|
254
|
+
/* @__PURE__ */ jsx("div", { className: "max-h-96 space-y-1 overflow-auto", children: filteredItems.map((item) => /* @__PURE__ */ jsx(
|
|
255
|
+
"a",
|
|
256
|
+
{
|
|
257
|
+
href: item.href,
|
|
258
|
+
className: "block rounded-md px-4 py-2 hover:bg-accent",
|
|
259
|
+
onClick: () => setIsOpen(false),
|
|
260
|
+
children: item.label
|
|
261
|
+
},
|
|
262
|
+
item.href
|
|
263
|
+
)) })
|
|
264
|
+
]
|
|
265
|
+
}
|
|
266
|
+
)
|
|
267
|
+
}
|
|
268
|
+
)
|
|
269
|
+
] });
|
|
270
|
+
}
|
|
271
|
+
);
|
|
272
|
+
LimelightNav.displayName = "LimelightNav";
|
|
273
|
+
|
|
274
|
+
export { LimelightNav };
|