@hanzo/ui 5.3.35 → 5.3.36
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/bin/create-registry.js +0 -0
- package/bin/npx-registry-mcp.js +0 -0
- package/bin/registry-mcp-wrapper.sh +0 -0
- package/bin/registry-mcp.js +0 -0
- package/bin/start-mcp-server.sh +0 -0
- package/bin/test-mcp.sh +0 -0
- package/dist/3d/button.js +1 -297
- package/dist/3d/button.mjs +1 -272
- package/dist/3d/card.js +1 -233
- package/dist/3d/card.mjs +1 -206
- package/dist/3d/carousel.js +1 -370
- package/dist/3d/carousel.mjs +1 -343
- package/dist/3d/grid.js +1 -361
- package/dist/3d/grid.mjs +1 -336
- package/dist/3d/index.js +1 -1517
- package/dist/3d/index.mjs +1 -1471
- package/dist/3d/marquee.js +1 -351
- package/dist/3d/marquee.mjs +1 -326
- package/dist/3d/pin.js +1 -45
- package/dist/3d/pin.mjs +1 -23
- package/dist/accordion.js +1 -79
- package/dist/accordion.mjs +1 -54
- package/dist/alert-dialog.js +1 -224
- package/dist/alert-dialog.mjs +1 -191
- package/dist/alert.js +1 -97
- package/dist/alert.mjs +1 -91
- package/dist/animation/animated-background.js +1 -423
- package/dist/animation/animated-background.mjs +1 -417
- package/dist/animation/animated-beam.js +1 -118
- package/dist/animation/animated-beam.mjs +1 -96
- package/dist/animation/animated-cursor.js +1 -274
- package/dist/animation/animated-cursor.mjs +1 -269
- package/dist/animation/animated-icon.js +2 -356
- package/dist/animation/animated-icon.mjs +2 -350
- package/dist/animation/animated-list.js +1 -338
- package/dist/animation/animated-list.mjs +1 -332
- package/dist/animation/animated-number.js +1 -282
- package/dist/animation/animated-number.mjs +1 -276
- package/dist/animation/animated-testimonials.js +1 -96
- package/dist/animation/animated-testimonials.mjs +1 -74
- package/dist/animation/animated-tooltip.js +1 -66
- package/dist/animation/animated-tooltip.mjs +1 -44
- package/dist/animation/apple-cards-carousel.js +1 -307
- package/dist/animation/apple-cards-carousel.mjs +1 -284
- package/dist/animation/apple-hello-effect.js +1 -59
- package/dist/animation/apple-hello-effect.mjs +1 -37
- package/dist/animation/index.js +2 -1951
- package/dist/animation/index.mjs +2 -1920
- package/dist/avatar.js +1 -70
- package/dist/avatar.mjs +1 -46
- package/dist/badge.js +1 -60
- package/dist/badge.mjs +1 -54
- package/dist/blocks/index.js +2 -1684
- package/dist/blocks/index.mjs +2 -1645
- package/dist/breadcrumb.js +1 -106
- package/dist/breadcrumb.mjs +1 -98
- package/dist/calendar-ext/index.js +1 -207
- package/dist/calendar-ext/index.mjs +1 -169
- package/dist/calendar.js +1 -193
- package/dist/calendar.mjs +1 -168
- package/dist/carousel.js +1 -282
- package/dist/carousel.mjs +1 -253
- package/dist/charts/index.js +6 -5840
- package/dist/charts/index.mjs +6 -5749
- package/dist/checkbox.js +1 -59
- package/dist/checkbox.mjs +1 -34
- package/dist/code/block.js +2 -225
- package/dist/code/block.mjs +2 -202
- package/dist/code/compare.js +5 -444
- package/dist/code/compare.mjs +5 -421
- package/dist/code/diff.js +12 -429
- package/dist/code/diff.mjs +11 -405
- package/dist/code/editor.js +1 -242
- package/dist/code/editor.mjs +1 -217
- package/dist/code/explorer.js +1 -290
- package/dist/code/explorer.mjs +1 -267
- package/dist/code/index.js +26 -2514
- package/dist/code/index.mjs +24 -2471
- package/dist/code/preview.js +6 -363
- package/dist/code/preview.mjs +6 -340
- package/dist/code/snippet.js +2 -273
- package/dist/code/snippet.mjs +2 -249
- package/dist/code/tabs.js +1 -74
- package/dist/code/tabs.mjs +1 -52
- package/dist/code/terminal.js +3 -436
- package/dist/code/terminal.mjs +3 -413
- package/dist/collapsible.js +1 -32
- package/dist/collapsible.mjs +1 -8
- package/dist/command.js +1 -282
- package/dist/command.mjs +1 -251
- package/dist/context-menu.js +1 -206
- package/dist/context-menu.mjs +1 -170
- package/dist/desktop/hooks.js +1 -223
- package/dist/desktop/hooks.mjs +1 -198
- package/dist/desktop/index.js +1 -685
- package/dist/desktop/index.mjs +1 -657
- package/dist/desktop/spotlight.js +1 -260
- package/dist/desktop/spotlight.mjs +1 -235
- package/dist/desktop/window.js +1 -273
- package/dist/desktop/window.mjs +1 -247
- package/dist/device/index.js +1 -2
- package/dist/device/index.mjs +0 -1
- package/dist/dialog.js +1 -245
- package/dist/dialog.mjs +1 -213
- package/dist/dock/basic.js +1 -173
- package/dist/dock/basic.mjs +1 -150
- package/dist/dock/index.js +1 -647
- package/dist/dock/index.mjs +1 -620
- package/dist/dock/limelight-nav.js +1 -314
- package/dist/dock/limelight-nav.mjs +1 -293
- package/dist/dock/macos.js +1 -140
- package/dist/dock/macos.mjs +1 -117
- package/dist/dock/menu.js +1 -69
- package/dist/dock/menu.mjs +1 -47
- package/dist/dock/message.js +1 -148
- package/dist/dock/message.mjs +1 -126
- package/dist/drawer.js +1 -114
- package/dist/drawer.mjs +1 -102
- package/dist/dropdown-menu.js +1 -201
- package/dist/dropdown-menu.mjs +1 -165
- package/dist/finance/AdvancedChart.js +2 -47
- package/dist/finance/AdvancedChart.mjs +2 -45
- package/dist/finance/CompanyProfile.js +2 -47
- package/dist/finance/CompanyProfile.mjs +2 -45
- package/dist/finance/CryptoScreener.js +2 -44
- package/dist/finance/CryptoScreener.mjs +2 -42
- package/dist/finance/Financials.js +2 -51
- package/dist/finance/Financials.mjs +2 -49
- package/dist/finance/ForexScreener.js +2 -45
- package/dist/finance/ForexScreener.mjs +2 -43
- package/dist/finance/MarketOverview.js +2 -103
- package/dist/finance/MarketOverview.mjs +2 -101
- package/dist/finance/NewsTimeline.js +2 -43
- package/dist/finance/NewsTimeline.mjs +2 -41
- package/dist/finance/OrderEntry.js +1 -130
- package/dist/finance/OrderEntry.mjs +1 -128
- package/dist/finance/OrdersHistory.js +1 -63
- package/dist/finance/OrdersHistory.mjs +1 -61
- package/dist/finance/PositionsList.js +1 -79
- package/dist/finance/PositionsList.mjs +1 -77
- package/dist/finance/StockScreener.js +2 -45
- package/dist/finance/StockScreener.mjs +2 -43
- package/dist/finance/SymbolInfo.js +2 -45
- package/dist/finance/SymbolInfo.mjs +2 -43
- package/dist/finance/TechnicalAnalysis.js +2 -53
- package/dist/finance/TechnicalAnalysis.mjs +2 -51
- package/dist/finance/TickerTape.js +2 -55
- package/dist/finance/TickerTape.mjs +2 -53
- package/dist/finance/TradingPanel.js +1 -190
- package/dist/finance/TradingPanel.mjs +1 -188
- package/dist/finance/index.js +2 -929
- package/dist/finance/index.mjs +2 -913
- package/dist/form/index.js +1 -153
- package/dist/form/index.mjs +1 -123
- package/dist/form.js +1 -171
- package/dist/form.mjs +1 -141
- package/dist/hover-card.js +1 -57
- package/dist/hover-card.mjs +1 -33
- package/dist/index.js +192 -9618
- package/dist/index.mjs +192 -9202
- package/dist/input-otp.js +1 -78
- package/dist/input-otp.mjs +1 -53
- package/dist/kanban/index.js +1 -593
- package/dist/kanban/index.mjs +1 -571
- package/dist/lib/utils.js +1 -28
- package/dist/lib/utils.mjs +1 -24
- package/dist/mermaid/index.js +1 -280
- package/dist/mermaid/index.mjs +1 -253
- package/dist/navigation/index.js +1 -97
- package/dist/navigation/index.mjs +1 -78
- package/dist/navigation-menu.js +1 -148
- package/dist/navigation-menu.mjs +1 -115
- package/dist/pattern/grid-pattern.js +3 -325
- package/dist/pattern/grid-pattern.mjs +3 -302
- package/dist/pattern/index.js +3 -325
- package/dist/pattern/index.mjs +3 -302
- package/dist/popover.js +1 -62
- package/dist/popover.mjs +1 -36
- package/dist/progress.js +1 -61
- package/dist/progress.mjs +1 -36
- package/dist/project/gantt.js +1 -64
- package/dist/project/gantt.mjs +1 -42
- package/dist/project/index.js +1 -635
- package/dist/project/index.mjs +1 -610
- package/dist/project/kanban.js +1 -596
- package/dist/project/kanban.mjs +1 -571
- package/dist/project/list.js +1 -34
- package/dist/project/list.mjs +1 -11
- package/dist/radio-group.js +1 -67
- package/dist/radio-group.mjs +1 -44
- package/dist/resizable.js +1 -71
- package/dist/resizable.mjs +1 -47
- package/dist/scroll-area.js +1 -88
- package/dist/scroll-area.mjs +1 -65
- package/dist/select.js +1 -139
- package/dist/select.mjs +1 -110
- package/dist/separator.js +1 -58
- package/dist/separator.mjs +1 -33
- package/dist/sheet.js +1 -147
- package/dist/sheet.mjs +1 -116
- package/dist/skeleton.js +1 -31
- package/dist/skeleton.mjs +1 -26
- package/dist/slider.js +1 -98
- package/dist/slider.mjs +1 -72
- package/dist/sonner.js +1 -33
- package/dist/sonner.mjs +1 -28
- package/dist/spline/index.js +1 -210
- package/dist/spline/index.mjs +1 -201
- package/dist/spline/media-stack.js +1 -192
- package/dist/spline/media-stack.mjs +1 -184
- package/dist/spline/player.js +1 -36
- package/dist/spline/player.mjs +1 -30
- package/dist/switch.js +1 -61
- package/dist/switch.mjs +1 -36
- package/dist/table.js +1 -109
- package/dist/table.mjs +1 -100
- package/dist/tabs.js +1 -127
- package/dist/tabs.mjs +1 -101
- package/dist/tailwind/index.mjs +1 -2011
- package/dist/textarea.js +1 -77
- package/dist/textarea.mjs +1 -55
- package/dist/toggle-group.js +1 -117
- package/dist/toggle-group.mjs +1 -92
- package/dist/toggle.js +1 -70
- package/dist/toggle.mjs +1 -47
- package/dist/tooltip.js +1 -66
- package/dist/tooltip.mjs +1 -39
- package/dist/types/index.mjs +1 -51
- package/dist/ui/announcement.js +1 -133
- package/dist/ui/announcement.mjs +1 -111
- package/dist/ui/avatar-group.js +1 -87
- package/dist/ui/avatar-group.mjs +1 -64
- package/dist/ui/banner.js +1 -84
- package/dist/ui/banner.mjs +1 -61
- package/dist/ui/cursor.js +1 -77
- package/dist/ui/cursor.mjs +1 -55
- package/dist/ui/index.js +1 -494
- package/dist/ui/index.mjs +1 -461
- package/dist/ui/marquee.js +1 -73
- package/dist/ui/marquee.mjs +1 -51
- package/dist/ui/pill.js +1 -84
- package/dist/ui/pill.mjs +1 -61
- package/dist/ui/spinner.js +1 -27
- package/dist/ui/spinner.mjs +1 -25
- package/dist/ui/tags.js +1 -116
- package/dist/ui/tags.mjs +1 -94
- package/dist/ui/ticker.js +1 -72
- package/dist/ui/ticker.mjs +1 -50
- package/dist/util/index.mjs +1 -404
- package/package.json +28 -27
- package/dist/primitives/index.js +0 -9619
- package/dist/primitives/index.mjs +0 -9203
- package/dist/primitives-export.js +0 -9619
- package/dist/primitives-export.mjs +0 -9203
|
@@ -1,315 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
'use strict';
|
|
3
|
-
|
|
4
|
-
var React3 = 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 React3__namespace = /*#__PURE__*/_interopNamespace(React3);
|
|
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-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*="size-"])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive',
|
|
40
|
-
{
|
|
41
|
-
variants: {
|
|
42
|
-
variant: {
|
|
43
|
-
default: "bg-primary text-primary-foreground hover:bg-primary/90",
|
|
44
|
-
destructive: "bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",
|
|
45
|
-
outline: "border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",
|
|
46
|
-
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
|
|
47
|
-
ghost: "hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",
|
|
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 has-[>svg]:px-3",
|
|
56
|
-
sm: "h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",
|
|
57
|
-
lg: "h-10 rounded-md px-6 has-[>svg]:px-4",
|
|
58
|
-
icon: "size-9",
|
|
59
|
-
"icon-sm": "size-8",
|
|
60
|
-
"icon-lg": "size-10"
|
|
61
|
-
}
|
|
62
|
-
},
|
|
63
|
-
defaultVariants: {
|
|
64
|
-
variant: "default",
|
|
65
|
-
size: "default"
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
);
|
|
69
|
-
var Button = React3__namespace.forwardRef(
|
|
70
|
-
({ className, variant = "default", size = "default", asChild = false, isLoading = false, children, ...props }, ref) => {
|
|
71
|
-
const Comp = asChild ? reactSlot.Slot : "button";
|
|
72
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
73
|
-
Comp,
|
|
74
|
-
{
|
|
75
|
-
"data-slot": "button",
|
|
76
|
-
"data-variant": variant,
|
|
77
|
-
"data-size": size,
|
|
78
|
-
className: cn(buttonVariants({ variant, size, className })),
|
|
79
|
-
ref,
|
|
80
|
-
...props,
|
|
81
|
-
children: [
|
|
82
|
-
isLoading ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
83
|
-
lucideReact.Loader2,
|
|
84
|
-
{
|
|
85
|
-
className: cn("h-4 w-4 animate-spin", size !== "icon" && size !== "icon-sm" && size !== "icon-lg" && "mr-2")
|
|
86
|
-
}
|
|
87
|
-
) : null,
|
|
88
|
-
isLoading && (size === "icon" || size === "icon-sm" || size === "icon-lg") ? null : children
|
|
89
|
-
]
|
|
90
|
-
}
|
|
91
|
-
);
|
|
92
|
-
}
|
|
93
|
-
);
|
|
94
|
-
Button.displayName = "Button";
|
|
95
|
-
var badgeVariants = classVarianceAuthority.cva(
|
|
96
|
-
"inline-flex items-center justify-center w-fit whitespace-nowrap shrink-0 rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] focus-visible:outline-none aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive [&>svg]:pointer-events-none overflow-hidden",
|
|
97
|
-
{
|
|
98
|
-
variants: {
|
|
99
|
-
variant: {
|
|
100
|
-
default: "bg-primary text-primary-foreground hover:bg-primary/90 border-transparent shadow-sm",
|
|
101
|
-
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80 border-transparent",
|
|
102
|
-
destructive: "bg-destructive text-white hover:bg-destructive/90 border-transparent shadow-sm focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",
|
|
103
|
-
outline: "text-foreground border-input bg-background shadow-xs hover:bg-accent hover:text-accent-foreground",
|
|
104
|
-
ghost: "hover:bg-accent hover:text-accent-foreground border-transparent",
|
|
105
|
-
link: "text-primary underline-offset-4 hover:underline border-transparent",
|
|
106
|
-
// Hanzo-specific variants for backward compatibility
|
|
107
|
-
inputAdornment: "bg-gray-600 px-2 font-medium text-white border-transparent",
|
|
108
|
-
tags: "text-muted-foreground border-border bg-muted rounded-lg px-2 py-1 font-normal capitalize"
|
|
109
|
-
}
|
|
110
|
-
},
|
|
111
|
-
defaultVariants: {
|
|
112
|
-
variant: "default"
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
);
|
|
116
|
-
function Badge({
|
|
117
|
-
className,
|
|
118
|
-
variant = "default",
|
|
119
|
-
asChild = false,
|
|
120
|
-
...props
|
|
121
|
-
}) {
|
|
122
|
-
const Comp = asChild ? reactSlot.Slot : "span";
|
|
123
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
124
|
-
Comp,
|
|
125
|
-
{
|
|
126
|
-
"data-slot": "badge",
|
|
127
|
-
"data-variant": variant,
|
|
128
|
-
className: cn(badgeVariants({ variant }), className),
|
|
129
|
-
...props
|
|
130
|
-
}
|
|
131
|
-
);
|
|
132
|
-
}
|
|
133
|
-
__name(Badge, "Badge");
|
|
134
|
-
var Input = /* @__PURE__ */ __name(({
|
|
135
|
-
className,
|
|
136
|
-
type,
|
|
137
|
-
startAdornment,
|
|
138
|
-
endAdornment,
|
|
139
|
-
hidePasswordToggle,
|
|
140
|
-
ref,
|
|
141
|
-
...props
|
|
142
|
-
}) => {
|
|
143
|
-
const inputRef = React3.useRef(null);
|
|
144
|
-
const startAdornmentRef = React3.useRef(null);
|
|
145
|
-
const endAdornmentRef = React3.useRef(null);
|
|
146
|
-
const [showPassword, setShowPassword] = React3__namespace.useState(false);
|
|
147
|
-
const togglePasswordVisibility = /* @__PURE__ */ __name(() => {
|
|
148
|
-
setShowPassword(!showPassword);
|
|
149
|
-
}, "togglePasswordVisibility");
|
|
150
|
-
const style = {};
|
|
151
|
-
if (startAdornment) {
|
|
152
|
-
style.paddingLeft = `${(startAdornmentRef?.current?.offsetWidth ?? 0) + 20}px`;
|
|
153
|
-
}
|
|
154
|
-
if (endAdornment) {
|
|
155
|
-
style.paddingRight = `${(endAdornmentRef?.current?.offsetWidth ?? 0) + 20}px`;
|
|
156
|
-
}
|
|
157
|
-
React3.useImperativeHandle(ref, () => inputRef.current, []);
|
|
158
|
-
React3.useEffect(() => {
|
|
159
|
-
if (props.autoFocus) {
|
|
160
|
-
setTimeout(() => {
|
|
161
|
-
inputRef?.current?.focus();
|
|
162
|
-
}, 0);
|
|
163
|
-
}
|
|
164
|
-
}, [props.autoFocus]);
|
|
165
|
-
const inputType = type === "password" && showPassword ? "text" : type;
|
|
166
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
167
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
168
|
-
"input",
|
|
169
|
-
{
|
|
170
|
-
className: cn(
|
|
171
|
-
"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",
|
|
172
|
-
startAdornment && "pl-[var(--custom-padding-left-input)]",
|
|
173
|
-
endAdornment && "pr-[var(--custom-padding-right-input)]",
|
|
174
|
-
type === "password" && "pr-[60px]",
|
|
175
|
-
className
|
|
176
|
-
),
|
|
177
|
-
placeholder: " ",
|
|
178
|
-
ref: inputRef,
|
|
179
|
-
spellCheck: false,
|
|
180
|
-
style,
|
|
181
|
-
type: inputType,
|
|
182
|
-
...props
|
|
183
|
-
}
|
|
184
|
-
),
|
|
185
|
-
startAdornment ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
186
|
-
Badge,
|
|
187
|
-
{
|
|
188
|
-
className: "peer/adornment adornment absolute top-[30px] left-4",
|
|
189
|
-
ref: startAdornmentRef,
|
|
190
|
-
variant: "inputAdornment",
|
|
191
|
-
children: startAdornment
|
|
192
|
-
}
|
|
193
|
-
) : null,
|
|
194
|
-
endAdornment && typeof endAdornment === "string" ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
195
|
-
Badge,
|
|
196
|
-
{
|
|
197
|
-
className: "peer/adornment adornment absolute top-[30px] right-4",
|
|
198
|
-
ref: endAdornmentRef,
|
|
199
|
-
variant: "inputAdornment",
|
|
200
|
-
children: endAdornment
|
|
201
|
-
}
|
|
202
|
-
) : null,
|
|
203
|
-
endAdornment && typeof endAdornment !== "string" && React3__namespace.isValidElement(endAdornment) ? React3__namespace.cloneElement(endAdornment, {
|
|
204
|
-
ref: endAdornmentRef
|
|
205
|
-
}) : null,
|
|
206
|
-
type === "password" && !hidePasswordToggle && /* @__PURE__ */ jsxRuntime.jsx(
|
|
207
|
-
Button,
|
|
208
|
-
{
|
|
209
|
-
"aria-label": showPassword ? "Hide password" : "Show password",
|
|
210
|
-
className: "absolute top-3 right-3",
|
|
211
|
-
onClick: togglePasswordVisibility,
|
|
212
|
-
size: "icon",
|
|
213
|
-
type: "button",
|
|
214
|
-
variant: "ghost",
|
|
215
|
-
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" })
|
|
216
|
-
}
|
|
217
|
-
)
|
|
218
|
-
] });
|
|
219
|
-
}, "Input");
|
|
220
|
-
Input.displayName = "Input";
|
|
221
|
-
var LimelightNav = React3__namespace.forwardRef(
|
|
222
|
-
({ className, items = [], ...props }, ref) => {
|
|
223
|
-
const [isOpen, setIsOpen] = React3__namespace.useState(false);
|
|
224
|
-
const [search, setSearch] = React3__namespace.useState("");
|
|
225
|
-
React3__namespace.useEffect(() => {
|
|
226
|
-
const down = /* @__PURE__ */ __name((e) => {
|
|
227
|
-
if (e.key === "k" && (e.metaKey || e.ctrlKey)) {
|
|
228
|
-
e.preventDefault();
|
|
229
|
-
setIsOpen((open) => !open);
|
|
230
|
-
}
|
|
231
|
-
}, "down");
|
|
232
|
-
document.addEventListener("keydown", down);
|
|
233
|
-
return () => document.removeEventListener("keydown", down);
|
|
234
|
-
}, []);
|
|
235
|
-
const filteredItems = items.filter(
|
|
236
|
-
(item) => item.label.toLowerCase().includes(search.toLowerCase())
|
|
237
|
-
);
|
|
238
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
239
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
240
|
-
"nav",
|
|
241
|
-
{
|
|
242
|
-
ref,
|
|
243
|
-
className: cn("flex items-center gap-4", className),
|
|
244
|
-
...props,
|
|
245
|
-
children: [
|
|
246
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
247
|
-
Button,
|
|
248
|
-
{
|
|
249
|
-
variant: "outline",
|
|
250
|
-
onClick: () => setIsOpen(true),
|
|
251
|
-
className: "relative w-64 justify-start",
|
|
252
|
-
children: [
|
|
253
|
-
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Search, { className: "mr-2 h-4 w-4" }),
|
|
254
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground", children: "Search..." }),
|
|
255
|
-
/* @__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: [
|
|
256
|
-
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Command, { className: "h-3 w-3" }),
|
|
257
|
-
"K"
|
|
258
|
-
] })
|
|
259
|
-
]
|
|
260
|
-
}
|
|
261
|
-
),
|
|
262
|
-
items.slice(0, 4).map((item) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
263
|
-
"a",
|
|
264
|
-
{
|
|
265
|
-
href: item.href,
|
|
266
|
-
className: "text-sm font-medium transition-colors hover:text-primary",
|
|
267
|
-
children: item.label
|
|
268
|
-
},
|
|
269
|
-
item.href
|
|
270
|
-
))
|
|
271
|
-
]
|
|
272
|
-
}
|
|
273
|
-
),
|
|
274
|
-
isOpen && /* @__PURE__ */ jsxRuntime.jsx(
|
|
275
|
-
"div",
|
|
276
|
-
{
|
|
277
|
-
className: "fixed inset-0 z-50 bg-background/80 backdrop-blur-sm",
|
|
278
|
-
onClick: () => setIsOpen(false),
|
|
279
|
-
children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
280
|
-
"div",
|
|
281
|
-
{
|
|
282
|
-
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",
|
|
283
|
-
onClick: (e) => e.stopPropagation(),
|
|
284
|
-
children: [
|
|
285
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
286
|
-
Input,
|
|
287
|
-
{
|
|
288
|
-
placeholder: "Search navigation...",
|
|
289
|
-
value: search,
|
|
290
|
-
onChange: (e) => setSearch(e.target.value),
|
|
291
|
-
autoFocus: true,
|
|
292
|
-
className: "mb-4"
|
|
293
|
-
}
|
|
294
|
-
),
|
|
295
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "max-h-96 space-y-1 overflow-auto", children: filteredItems.map((item) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
296
|
-
"a",
|
|
297
|
-
{
|
|
298
|
-
href: item.href,
|
|
299
|
-
className: "block rounded-md px-4 py-2 hover:bg-accent",
|
|
300
|
-
onClick: () => setIsOpen(false),
|
|
301
|
-
children: item.label
|
|
302
|
-
},
|
|
303
|
-
item.href
|
|
304
|
-
)) })
|
|
305
|
-
]
|
|
306
|
-
}
|
|
307
|
-
)
|
|
308
|
-
}
|
|
309
|
-
)
|
|
310
|
-
] });
|
|
311
|
-
}
|
|
312
|
-
);
|
|
313
|
-
LimelightNav.displayName = "LimelightNav";
|
|
314
|
-
|
|
315
|
-
exports.LimelightNav = LimelightNav;
|
|
2
|
+
'use strict';var f=require('react'),lucideReact=require('lucide-react'),clsx=require('clsx'),tailwindMerge=require('tailwind-merge'),reactSlot=require('@radix-ui/react-slot'),classVarianceAuthority=require('class-variance-authority'),jsxRuntime=require('react/jsx-runtime');function _interopNamespace(e){if(e&&e.__esModule)return e;var n=Object.create(null);if(e){Object.keys(e).forEach(function(k){if(k!=='default'){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:function(){return e[k]}});}})}n.default=e;return Object.freeze(n)}var f__namespace=/*#__PURE__*/_interopNamespace(f);var P=Object.defineProperty;var s=(a,r)=>P(a,"name",{value:r,configurable:true});function i(...a){return tailwindMerge.twMerge(clsx.clsx(a))}s(i,"cn");var H=classVarianceAuthority.cva('inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*="size-"])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive',{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline",primary:"bg-primary text-primary-foreground shadow hover:bg-primary/90",linkFG:"text-primary underline-offset-4 hover:underline",linkMuted:"text-muted-foreground underline-offset-4 hover:underline hover:text-foreground"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9","icon-sm":"size-8","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}}),v=f__namespace.forwardRef(({className:a,variant:r="default",size:t="default",asChild:o=false,isLoading:u=false,children:d,...l},p)=>jsxRuntime.jsxs(o?reactSlot.Slot:"button",{"data-slot":"button","data-variant":r,"data-size":t,className:i(H({variant:r,size:t,className:a})),ref:p,...l,children:[u?jsxRuntime.jsx(lucideReact.Loader2,{className:i("h-4 w-4 animate-spin",t!=="icon"&&t!=="icon-sm"&&t!=="icon-lg"&&"mr-2")}):null,u&&(t==="icon"||t==="icon-sm"||t==="icon-lg")?null:d]}));v.displayName="Button";var z=classVarianceAuthority.cva("inline-flex items-center justify-center w-fit whitespace-nowrap shrink-0 rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] focus-visible:outline-none aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive [&>svg]:pointer-events-none overflow-hidden",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90 border-transparent shadow-sm",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80 border-transparent",destructive:"bg-destructive text-white hover:bg-destructive/90 border-transparent shadow-sm focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"text-foreground border-input bg-background shadow-xs hover:bg-accent hover:text-accent-foreground",ghost:"hover:bg-accent hover:text-accent-foreground border-transparent",link:"text-primary underline-offset-4 hover:underline border-transparent",inputAdornment:"bg-gray-600 px-2 font-medium text-white border-transparent",tags:"text-muted-foreground border-border bg-muted rounded-lg px-2 py-1 font-normal capitalize"}},defaultVariants:{variant:"default"}});function w({className:a,variant:r="default",asChild:t=false,...o}){return jsxRuntime.jsx(t?reactSlot.Slot:"span",{"data-slot":"badge","data-variant":r,className:i(z({variant:r}),a),...o})}s(w,"Badge");var R=s(({className:a,type:r,startAdornment:t,endAdornment:o,hidePasswordToggle:u,ref:d,...l})=>{let p=f.useRef(null),b=f.useRef(null),e=f.useRef(null),[n,x]=f__namespace.useState(false),C=s(()=>{x(!n);},"togglePasswordVisibility"),y={};t&&(y.paddingLeft=`${(b?.current?.offsetWidth??0)+20}px`),o&&(y.paddingRight=`${(e?.current?.offsetWidth??0)+20}px`),f.useImperativeHandle(d,()=>p.current,[]),f.useEffect(()=>{l.autoFocus&&setTimeout(()=>{p?.current?.focus();},0);},[l.autoFocus]);let L=r==="password"&&n?"text":r;return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("input",{className:i("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",t&&"pl-[var(--custom-padding-left-input)]",o&&"pr-[var(--custom-padding-right-input)]",r==="password"&&"pr-[60px]",a),placeholder:" ",ref:p,spellCheck:false,style:y,type:L,...l}),t?jsxRuntime.jsx(w,{className:"peer/adornment adornment absolute top-[30px] left-4",ref:b,variant:"inputAdornment",children:t}):null,o&&typeof o=="string"?jsxRuntime.jsx(w,{className:"peer/adornment adornment absolute top-[30px] right-4",ref:e,variant:"inputAdornment",children:o}):null,o&&typeof o!="string"&&f__namespace.isValidElement(o)?f__namespace.cloneElement(o,{ref:e}):null,r==="password"&&!u&&jsxRuntime.jsx(v,{"aria-label":n?"Hide password":"Show password",className:"absolute top-3 right-3",onClick:C,size:"icon",type:"button",variant:"ghost",children:n?jsxRuntime.jsx(lucideReact.EyeOffIcon,{"aria-hidden":"true",className:"h-4 w-4"}):jsxRuntime.jsx(lucideReact.EyeIcon,{"aria-hidden":"true",className:"h-4 w-4"})})]})},"Input");R.displayName="Input";var j=f__namespace.forwardRef(({className:a,items:r=[],...t},o)=>{let[u,d]=f__namespace.useState(false),[l,p]=f__namespace.useState("");f__namespace.useEffect(()=>{let e=s(n=>{n.key==="k"&&(n.metaKey||n.ctrlKey)&&(n.preventDefault(),d(x=>!x));},"down");return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[]);let b=r.filter(e=>e.label.toLowerCase().includes(l.toLowerCase()));return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("nav",{ref:o,className:i("flex items-center gap-4",a),...t,children:[jsxRuntime.jsxs(v,{variant:"outline",onClick:()=>d(true),className:"relative w-64 justify-start",children:[jsxRuntime.jsx(lucideReact.Search,{className:"mr-2 h-4 w-4"}),jsxRuntime.jsx("span",{className:"text-muted-foreground",children:"Search..."}),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:[jsxRuntime.jsx(lucideReact.Command,{className:"h-3 w-3"}),"K"]})]}),r.slice(0,4).map(e=>jsxRuntime.jsx("a",{href:e.href,className:"text-sm font-medium transition-colors hover:text-primary",children:e.label},e.href))]}),u&&jsxRuntime.jsx("div",{className:"fixed inset-0 z-50 bg-background/80 backdrop-blur-sm",onClick:()=>d(false),children:jsxRuntime.jsxs("div",{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",onClick:e=>e.stopPropagation(),children:[jsxRuntime.jsx(R,{placeholder:"Search navigation...",value:l,onChange:e=>p(e.target.value),autoFocus:true,className:"mb-4"}),jsxRuntime.jsx("div",{className:"max-h-96 space-y-1 overflow-auto",children:b.map(e=>jsxRuntime.jsx("a",{href:e.href,className:"block rounded-md px-4 py-2 hover:bg-accent",onClick:()=>d(false),children:e.label},e.href))})]})})]})});j.displayName="LimelightNav";exports.LimelightNav=j;
|
|
@@ -1,294 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import
|
|
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-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*="size-"])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive',
|
|
19
|
-
{
|
|
20
|
-
variants: {
|
|
21
|
-
variant: {
|
|
22
|
-
default: "bg-primary text-primary-foreground hover:bg-primary/90",
|
|
23
|
-
destructive: "bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",
|
|
24
|
-
outline: "border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",
|
|
25
|
-
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
|
|
26
|
-
ghost: "hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",
|
|
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 has-[>svg]:px-3",
|
|
35
|
-
sm: "h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",
|
|
36
|
-
lg: "h-10 rounded-md px-6 has-[>svg]:px-4",
|
|
37
|
-
icon: "size-9",
|
|
38
|
-
"icon-sm": "size-8",
|
|
39
|
-
"icon-lg": "size-10"
|
|
40
|
-
}
|
|
41
|
-
},
|
|
42
|
-
defaultVariants: {
|
|
43
|
-
variant: "default",
|
|
44
|
-
size: "default"
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
);
|
|
48
|
-
var Button = React3.forwardRef(
|
|
49
|
-
({ className, variant = "default", size = "default", asChild = false, isLoading = false, children, ...props }, ref) => {
|
|
50
|
-
const Comp = asChild ? Slot : "button";
|
|
51
|
-
return /* @__PURE__ */ jsxs(
|
|
52
|
-
Comp,
|
|
53
|
-
{
|
|
54
|
-
"data-slot": "button",
|
|
55
|
-
"data-variant": variant,
|
|
56
|
-
"data-size": size,
|
|
57
|
-
className: cn(buttonVariants({ variant, size, className })),
|
|
58
|
-
ref,
|
|
59
|
-
...props,
|
|
60
|
-
children: [
|
|
61
|
-
isLoading ? /* @__PURE__ */ jsx(
|
|
62
|
-
Loader2,
|
|
63
|
-
{
|
|
64
|
-
className: cn("h-4 w-4 animate-spin", size !== "icon" && size !== "icon-sm" && size !== "icon-lg" && "mr-2")
|
|
65
|
-
}
|
|
66
|
-
) : null,
|
|
67
|
-
isLoading && (size === "icon" || size === "icon-sm" || size === "icon-lg") ? null : children
|
|
68
|
-
]
|
|
69
|
-
}
|
|
70
|
-
);
|
|
71
|
-
}
|
|
72
|
-
);
|
|
73
|
-
Button.displayName = "Button";
|
|
74
|
-
var badgeVariants = cva(
|
|
75
|
-
"inline-flex items-center justify-center w-fit whitespace-nowrap shrink-0 rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] focus-visible:outline-none aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive [&>svg]:pointer-events-none overflow-hidden",
|
|
76
|
-
{
|
|
77
|
-
variants: {
|
|
78
|
-
variant: {
|
|
79
|
-
default: "bg-primary text-primary-foreground hover:bg-primary/90 border-transparent shadow-sm",
|
|
80
|
-
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80 border-transparent",
|
|
81
|
-
destructive: "bg-destructive text-white hover:bg-destructive/90 border-transparent shadow-sm focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",
|
|
82
|
-
outline: "text-foreground border-input bg-background shadow-xs hover:bg-accent hover:text-accent-foreground",
|
|
83
|
-
ghost: "hover:bg-accent hover:text-accent-foreground border-transparent",
|
|
84
|
-
link: "text-primary underline-offset-4 hover:underline border-transparent",
|
|
85
|
-
// Hanzo-specific variants for backward compatibility
|
|
86
|
-
inputAdornment: "bg-gray-600 px-2 font-medium text-white border-transparent",
|
|
87
|
-
tags: "text-muted-foreground border-border bg-muted rounded-lg px-2 py-1 font-normal capitalize"
|
|
88
|
-
}
|
|
89
|
-
},
|
|
90
|
-
defaultVariants: {
|
|
91
|
-
variant: "default"
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
);
|
|
95
|
-
function Badge({
|
|
96
|
-
className,
|
|
97
|
-
variant = "default",
|
|
98
|
-
asChild = false,
|
|
99
|
-
...props
|
|
100
|
-
}) {
|
|
101
|
-
const Comp = asChild ? Slot : "span";
|
|
102
|
-
return /* @__PURE__ */ jsx(
|
|
103
|
-
Comp,
|
|
104
|
-
{
|
|
105
|
-
"data-slot": "badge",
|
|
106
|
-
"data-variant": variant,
|
|
107
|
-
className: cn(badgeVariants({ variant }), className),
|
|
108
|
-
...props
|
|
109
|
-
}
|
|
110
|
-
);
|
|
111
|
-
}
|
|
112
|
-
__name(Badge, "Badge");
|
|
113
|
-
var Input = /* @__PURE__ */ __name(({
|
|
114
|
-
className,
|
|
115
|
-
type,
|
|
116
|
-
startAdornment,
|
|
117
|
-
endAdornment,
|
|
118
|
-
hidePasswordToggle,
|
|
119
|
-
ref,
|
|
120
|
-
...props
|
|
121
|
-
}) => {
|
|
122
|
-
const inputRef = useRef(null);
|
|
123
|
-
const startAdornmentRef = useRef(null);
|
|
124
|
-
const endAdornmentRef = useRef(null);
|
|
125
|
-
const [showPassword, setShowPassword] = React3.useState(false);
|
|
126
|
-
const togglePasswordVisibility = /* @__PURE__ */ __name(() => {
|
|
127
|
-
setShowPassword(!showPassword);
|
|
128
|
-
}, "togglePasswordVisibility");
|
|
129
|
-
const style = {};
|
|
130
|
-
if (startAdornment) {
|
|
131
|
-
style.paddingLeft = `${(startAdornmentRef?.current?.offsetWidth ?? 0) + 20}px`;
|
|
132
|
-
}
|
|
133
|
-
if (endAdornment) {
|
|
134
|
-
style.paddingRight = `${(endAdornmentRef?.current?.offsetWidth ?? 0) + 20}px`;
|
|
135
|
-
}
|
|
136
|
-
useImperativeHandle(ref, () => inputRef.current, []);
|
|
137
|
-
useEffect(() => {
|
|
138
|
-
if (props.autoFocus) {
|
|
139
|
-
setTimeout(() => {
|
|
140
|
-
inputRef?.current?.focus();
|
|
141
|
-
}, 0);
|
|
142
|
-
}
|
|
143
|
-
}, [props.autoFocus]);
|
|
144
|
-
const inputType = type === "password" && showPassword ? "text" : type;
|
|
145
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
146
|
-
/* @__PURE__ */ jsx(
|
|
147
|
-
"input",
|
|
148
|
-
{
|
|
149
|
-
className: cn(
|
|
150
|
-
"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",
|
|
151
|
-
startAdornment && "pl-[var(--custom-padding-left-input)]",
|
|
152
|
-
endAdornment && "pr-[var(--custom-padding-right-input)]",
|
|
153
|
-
type === "password" && "pr-[60px]",
|
|
154
|
-
className
|
|
155
|
-
),
|
|
156
|
-
placeholder: " ",
|
|
157
|
-
ref: inputRef,
|
|
158
|
-
spellCheck: false,
|
|
159
|
-
style,
|
|
160
|
-
type: inputType,
|
|
161
|
-
...props
|
|
162
|
-
}
|
|
163
|
-
),
|
|
164
|
-
startAdornment ? /* @__PURE__ */ jsx(
|
|
165
|
-
Badge,
|
|
166
|
-
{
|
|
167
|
-
className: "peer/adornment adornment absolute top-[30px] left-4",
|
|
168
|
-
ref: startAdornmentRef,
|
|
169
|
-
variant: "inputAdornment",
|
|
170
|
-
children: startAdornment
|
|
171
|
-
}
|
|
172
|
-
) : null,
|
|
173
|
-
endAdornment && typeof endAdornment === "string" ? /* @__PURE__ */ jsx(
|
|
174
|
-
Badge,
|
|
175
|
-
{
|
|
176
|
-
className: "peer/adornment adornment absolute top-[30px] right-4",
|
|
177
|
-
ref: endAdornmentRef,
|
|
178
|
-
variant: "inputAdornment",
|
|
179
|
-
children: endAdornment
|
|
180
|
-
}
|
|
181
|
-
) : null,
|
|
182
|
-
endAdornment && typeof endAdornment !== "string" && React3.isValidElement(endAdornment) ? React3.cloneElement(endAdornment, {
|
|
183
|
-
ref: endAdornmentRef
|
|
184
|
-
}) : null,
|
|
185
|
-
type === "password" && !hidePasswordToggle && /* @__PURE__ */ jsx(
|
|
186
|
-
Button,
|
|
187
|
-
{
|
|
188
|
-
"aria-label": showPassword ? "Hide password" : "Show password",
|
|
189
|
-
className: "absolute top-3 right-3",
|
|
190
|
-
onClick: togglePasswordVisibility,
|
|
191
|
-
size: "icon",
|
|
192
|
-
type: "button",
|
|
193
|
-
variant: "ghost",
|
|
194
|
-
children: showPassword ? /* @__PURE__ */ jsx(EyeOffIcon, { "aria-hidden": "true", className: "h-4 w-4" }) : /* @__PURE__ */ jsx(EyeIcon, { "aria-hidden": "true", className: "h-4 w-4" })
|
|
195
|
-
}
|
|
196
|
-
)
|
|
197
|
-
] });
|
|
198
|
-
}, "Input");
|
|
199
|
-
Input.displayName = "Input";
|
|
200
|
-
var LimelightNav = React3.forwardRef(
|
|
201
|
-
({ className, items = [], ...props }, ref) => {
|
|
202
|
-
const [isOpen, setIsOpen] = React3.useState(false);
|
|
203
|
-
const [search, setSearch] = React3.useState("");
|
|
204
|
-
React3.useEffect(() => {
|
|
205
|
-
const down = /* @__PURE__ */ __name((e) => {
|
|
206
|
-
if (e.key === "k" && (e.metaKey || e.ctrlKey)) {
|
|
207
|
-
e.preventDefault();
|
|
208
|
-
setIsOpen((open) => !open);
|
|
209
|
-
}
|
|
210
|
-
}, "down");
|
|
211
|
-
document.addEventListener("keydown", down);
|
|
212
|
-
return () => document.removeEventListener("keydown", down);
|
|
213
|
-
}, []);
|
|
214
|
-
const filteredItems = items.filter(
|
|
215
|
-
(item) => item.label.toLowerCase().includes(search.toLowerCase())
|
|
216
|
-
);
|
|
217
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
218
|
-
/* @__PURE__ */ jsxs(
|
|
219
|
-
"nav",
|
|
220
|
-
{
|
|
221
|
-
ref,
|
|
222
|
-
className: cn("flex items-center gap-4", className),
|
|
223
|
-
...props,
|
|
224
|
-
children: [
|
|
225
|
-
/* @__PURE__ */ jsxs(
|
|
226
|
-
Button,
|
|
227
|
-
{
|
|
228
|
-
variant: "outline",
|
|
229
|
-
onClick: () => setIsOpen(true),
|
|
230
|
-
className: "relative w-64 justify-start",
|
|
231
|
-
children: [
|
|
232
|
-
/* @__PURE__ */ jsx(Search, { className: "mr-2 h-4 w-4" }),
|
|
233
|
-
/* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: "Search..." }),
|
|
234
|
-
/* @__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: [
|
|
235
|
-
/* @__PURE__ */ jsx(Command, { className: "h-3 w-3" }),
|
|
236
|
-
"K"
|
|
237
|
-
] })
|
|
238
|
-
]
|
|
239
|
-
}
|
|
240
|
-
),
|
|
241
|
-
items.slice(0, 4).map((item) => /* @__PURE__ */ jsx(
|
|
242
|
-
"a",
|
|
243
|
-
{
|
|
244
|
-
href: item.href,
|
|
245
|
-
className: "text-sm font-medium transition-colors hover:text-primary",
|
|
246
|
-
children: item.label
|
|
247
|
-
},
|
|
248
|
-
item.href
|
|
249
|
-
))
|
|
250
|
-
]
|
|
251
|
-
}
|
|
252
|
-
),
|
|
253
|
-
isOpen && /* @__PURE__ */ jsx(
|
|
254
|
-
"div",
|
|
255
|
-
{
|
|
256
|
-
className: "fixed inset-0 z-50 bg-background/80 backdrop-blur-sm",
|
|
257
|
-
onClick: () => setIsOpen(false),
|
|
258
|
-
children: /* @__PURE__ */ jsxs(
|
|
259
|
-
"div",
|
|
260
|
-
{
|
|
261
|
-
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",
|
|
262
|
-
onClick: (e) => e.stopPropagation(),
|
|
263
|
-
children: [
|
|
264
|
-
/* @__PURE__ */ jsx(
|
|
265
|
-
Input,
|
|
266
|
-
{
|
|
267
|
-
placeholder: "Search navigation...",
|
|
268
|
-
value: search,
|
|
269
|
-
onChange: (e) => setSearch(e.target.value),
|
|
270
|
-
autoFocus: true,
|
|
271
|
-
className: "mb-4"
|
|
272
|
-
}
|
|
273
|
-
),
|
|
274
|
-
/* @__PURE__ */ jsx("div", { className: "max-h-96 space-y-1 overflow-auto", children: filteredItems.map((item) => /* @__PURE__ */ jsx(
|
|
275
|
-
"a",
|
|
276
|
-
{
|
|
277
|
-
href: item.href,
|
|
278
|
-
className: "block rounded-md px-4 py-2 hover:bg-accent",
|
|
279
|
-
onClick: () => setIsOpen(false),
|
|
280
|
-
children: item.label
|
|
281
|
-
},
|
|
282
|
-
item.href
|
|
283
|
-
)) })
|
|
284
|
-
]
|
|
285
|
-
}
|
|
286
|
-
)
|
|
287
|
-
}
|
|
288
|
-
)
|
|
289
|
-
] });
|
|
290
|
-
}
|
|
291
|
-
);
|
|
292
|
-
LimelightNav.displayName = "LimelightNav";
|
|
293
|
-
|
|
294
|
-
export { LimelightNav };
|
|
2
|
+
import*as f from'react';import {useRef,useImperativeHandle,useEffect}from'react';import {Loader2,Search,Command,EyeOffIcon,EyeIcon}from'lucide-react';import {clsx}from'clsx';import {twMerge}from'tailwind-merge';import {Slot}from'@radix-ui/react-slot';import {cva}from'class-variance-authority';import {jsxs,jsx,Fragment}from'react/jsx-runtime';var P=Object.defineProperty;var s=(a,r)=>P(a,"name",{value:r,configurable:true});function i(...a){return twMerge(clsx(a))}s(i,"cn");var H=cva('inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*="size-"])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive',{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline",primary:"bg-primary text-primary-foreground shadow hover:bg-primary/90",linkFG:"text-primary underline-offset-4 hover:underline",linkMuted:"text-muted-foreground underline-offset-4 hover:underline hover:text-foreground"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9","icon-sm":"size-8","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}}),v=f.forwardRef(({className:a,variant:r="default",size:t="default",asChild:o=false,isLoading:u=false,children:d,...l},p)=>jsxs(o?Slot:"button",{"data-slot":"button","data-variant":r,"data-size":t,className:i(H({variant:r,size:t,className:a})),ref:p,...l,children:[u?jsx(Loader2,{className:i("h-4 w-4 animate-spin",t!=="icon"&&t!=="icon-sm"&&t!=="icon-lg"&&"mr-2")}):null,u&&(t==="icon"||t==="icon-sm"||t==="icon-lg")?null:d]}));v.displayName="Button";var z=cva("inline-flex items-center justify-center w-fit whitespace-nowrap shrink-0 rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] focus-visible:outline-none aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive [&>svg]:pointer-events-none overflow-hidden",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90 border-transparent shadow-sm",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80 border-transparent",destructive:"bg-destructive text-white hover:bg-destructive/90 border-transparent shadow-sm focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"text-foreground border-input bg-background shadow-xs hover:bg-accent hover:text-accent-foreground",ghost:"hover:bg-accent hover:text-accent-foreground border-transparent",link:"text-primary underline-offset-4 hover:underline border-transparent",inputAdornment:"bg-gray-600 px-2 font-medium text-white border-transparent",tags:"text-muted-foreground border-border bg-muted rounded-lg px-2 py-1 font-normal capitalize"}},defaultVariants:{variant:"default"}});function w({className:a,variant:r="default",asChild:t=false,...o}){return jsx(t?Slot:"span",{"data-slot":"badge","data-variant":r,className:i(z({variant:r}),a),...o})}s(w,"Badge");var R=s(({className:a,type:r,startAdornment:t,endAdornment:o,hidePasswordToggle:u,ref:d,...l})=>{let p=useRef(null),b=useRef(null),e=useRef(null),[n,x]=f.useState(false),C=s(()=>{x(!n);},"togglePasswordVisibility"),y={};t&&(y.paddingLeft=`${(b?.current?.offsetWidth??0)+20}px`),o&&(y.paddingRight=`${(e?.current?.offsetWidth??0)+20}px`),useImperativeHandle(d,()=>p.current,[]),useEffect(()=>{l.autoFocus&&setTimeout(()=>{p?.current?.focus();},0);},[l.autoFocus]);let L=r==="password"&&n?"text":r;return jsxs(Fragment,{children:[jsx("input",{className:i("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",t&&"pl-[var(--custom-padding-left-input)]",o&&"pr-[var(--custom-padding-right-input)]",r==="password"&&"pr-[60px]",a),placeholder:" ",ref:p,spellCheck:false,style:y,type:L,...l}),t?jsx(w,{className:"peer/adornment adornment absolute top-[30px] left-4",ref:b,variant:"inputAdornment",children:t}):null,o&&typeof o=="string"?jsx(w,{className:"peer/adornment adornment absolute top-[30px] right-4",ref:e,variant:"inputAdornment",children:o}):null,o&&typeof o!="string"&&f.isValidElement(o)?f.cloneElement(o,{ref:e}):null,r==="password"&&!u&&jsx(v,{"aria-label":n?"Hide password":"Show password",className:"absolute top-3 right-3",onClick:C,size:"icon",type:"button",variant:"ghost",children:n?jsx(EyeOffIcon,{"aria-hidden":"true",className:"h-4 w-4"}):jsx(EyeIcon,{"aria-hidden":"true",className:"h-4 w-4"})})]})},"Input");R.displayName="Input";var j=f.forwardRef(({className:a,items:r=[],...t},o)=>{let[u,d]=f.useState(false),[l,p]=f.useState("");f.useEffect(()=>{let e=s(n=>{n.key==="k"&&(n.metaKey||n.ctrlKey)&&(n.preventDefault(),d(x=>!x));},"down");return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[]);let b=r.filter(e=>e.label.toLowerCase().includes(l.toLowerCase()));return jsxs(Fragment,{children:[jsxs("nav",{ref:o,className:i("flex items-center gap-4",a),...t,children:[jsxs(v,{variant:"outline",onClick:()=>d(true),className:"relative w-64 justify-start",children:[jsx(Search,{className:"mr-2 h-4 w-4"}),jsx("span",{className:"text-muted-foreground",children:"Search..."}),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:[jsx(Command,{className:"h-3 w-3"}),"K"]})]}),r.slice(0,4).map(e=>jsx("a",{href:e.href,className:"text-sm font-medium transition-colors hover:text-primary",children:e.label},e.href))]}),u&&jsx("div",{className:"fixed inset-0 z-50 bg-background/80 backdrop-blur-sm",onClick:()=>d(false),children:jsxs("div",{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",onClick:e=>e.stopPropagation(),children:[jsx(R,{placeholder:"Search navigation...",value:l,onChange:e=>p(e.target.value),autoFocus:true,className:"mb-4"}),jsx("div",{className:"max-h-96 space-y-1 overflow-auto",children:b.map(e=>jsx("a",{href:e.href,className:"block rounded-md px-4 py-2 hover:bg-accent",onClick:()=>d(false),children:e.label},e.href))})]})})]})});j.displayName="LimelightNav";export{j as LimelightNav};
|