@moontra/moonui-pro 2.5.7 → 2.5.8
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/index.mjs
CHANGED
|
@@ -56430,6 +56430,10 @@ function Sidebar({
|
|
|
56430
56430
|
}
|
|
56431
56431
|
}
|
|
56432
56432
|
}, [onNavigate, isMobile]);
|
|
56433
|
+
const handleSearchChange = useCallback((value) => {
|
|
56434
|
+
setSearchQuery(value);
|
|
56435
|
+
onSearchChange?.(value);
|
|
56436
|
+
}, [onSearchChange]);
|
|
56433
56437
|
const filterItems = useCallback((items, query) => {
|
|
56434
56438
|
if (!query)
|
|
56435
56439
|
return items;
|
|
@@ -56561,21 +56565,18 @@ function Sidebar({
|
|
|
56561
56565
|
showSearch && (!collapsed || isMobile) && /* @__PURE__ */ jsx("div", { className: "p-4 border-b", children: /* @__PURE__ */ jsxs("div", { className: "relative", children: [
|
|
56562
56566
|
/* @__PURE__ */ jsx(Search, { className: "absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground" }),
|
|
56563
56567
|
/* @__PURE__ */ jsx(
|
|
56564
|
-
|
|
56568
|
+
"input",
|
|
56565
56569
|
{
|
|
56566
56570
|
ref: searchInputRef,
|
|
56567
56571
|
type: "search",
|
|
56568
56572
|
placeholder: searchPlaceholder,
|
|
56569
56573
|
value: searchQuery,
|
|
56570
|
-
onChange: (e) =>
|
|
56571
|
-
setSearchQuery(e.target.value);
|
|
56572
|
-
onSearchChange?.(e.target.value);
|
|
56573
|
-
},
|
|
56574
|
+
onChange: (e) => handleSearchChange(e.target.value),
|
|
56574
56575
|
autoComplete: "off",
|
|
56575
56576
|
autoCorrect: "off",
|
|
56576
56577
|
autoCapitalize: "off",
|
|
56577
56578
|
spellCheck: "false",
|
|
56578
|
-
className: "pl-9 pr-9"
|
|
56579
|
+
className: "w-full h-10 pl-9 pr-9 text-sm bg-background border border-input rounded-md focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50"
|
|
56579
56580
|
},
|
|
56580
56581
|
"sidebar-search-input"
|
|
56581
56582
|
),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@moontra/moonui-pro",
|
|
3
|
-
"version": "2.5.
|
|
3
|
+
"version": "2.5.8",
|
|
4
4
|
"description": "Premium React components for MoonUI - Advanced UI library with 50+ pro components including performance, interactive, and gesture components",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.mjs",
|
|
@@ -28,7 +28,6 @@ import {
|
|
|
28
28
|
Sparkles,
|
|
29
29
|
Command
|
|
30
30
|
} from 'lucide-react'
|
|
31
|
-
import { Input } from '../ui/input'
|
|
32
31
|
import {
|
|
33
32
|
DropdownMenu,
|
|
34
33
|
DropdownMenuContent,
|
|
@@ -258,6 +257,11 @@ export function Sidebar({
|
|
|
258
257
|
}
|
|
259
258
|
}, [onNavigate, isMobile])
|
|
260
259
|
|
|
260
|
+
const handleSearchChange = useCallback((value: string) => {
|
|
261
|
+
setSearchQuery(value)
|
|
262
|
+
onSearchChange?.(value)
|
|
263
|
+
}, [onSearchChange])
|
|
264
|
+
|
|
261
265
|
const filterItems = useCallback((items: SidebarItem[], query: string): SidebarItem[] => {
|
|
262
266
|
if (!query) return items
|
|
263
267
|
|
|
@@ -435,21 +439,18 @@ export function Sidebar({
|
|
|
435
439
|
<div className="p-4 border-b">
|
|
436
440
|
<div className="relative">
|
|
437
441
|
<Search className="absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground" />
|
|
438
|
-
<
|
|
442
|
+
<input
|
|
439
443
|
key="sidebar-search-input"
|
|
440
444
|
ref={searchInputRef}
|
|
441
445
|
type="search"
|
|
442
446
|
placeholder={searchPlaceholder}
|
|
443
447
|
value={searchQuery}
|
|
444
|
-
onChange={(e) =>
|
|
445
|
-
setSearchQuery(e.target.value)
|
|
446
|
-
onSearchChange?.(e.target.value)
|
|
447
|
-
}}
|
|
448
|
+
onChange={(e) => handleSearchChange(e.target.value)}
|
|
448
449
|
autoComplete="off"
|
|
449
450
|
autoCorrect="off"
|
|
450
451
|
autoCapitalize="off"
|
|
451
452
|
spellCheck="false"
|
|
452
|
-
className="pl-9 pr-9"
|
|
453
|
+
className="w-full h-10 pl-9 pr-9 text-sm bg-background border border-input rounded-md focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50"
|
|
453
454
|
/>
|
|
454
455
|
{keyboardShortcuts && (
|
|
455
456
|
<kbd className="absolute right-2 top-1/2 -translate-y-1/2 pointer-events-none h-5 select-none items-center gap-1 rounded border bg-muted px-1.5 font-mono text-[10px] font-medium opacity-100 hidden sm:flex">
|