@nubase/frontend 0.1.19 → 0.1.20
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.d.mts +130 -1
- package/dist/index.d.ts +130 -1
- package/dist/index.js +712 -78
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +703 -82
- package/dist/index.mjs.map +1 -1
- package/dist/styles.css +49 -0
- package/package.json +3 -2
package/dist/index.mjs
CHANGED
|
@@ -18128,16 +18128,624 @@ var NubaseApp = ({ config }) => {
|
|
|
18128
18128
|
] }) });
|
|
18129
18129
|
};
|
|
18130
18130
|
|
|
18131
|
+
// src/components/search-controls/SearchFilterBar.tsx
|
|
18132
|
+
import { cva as cva15 } from "class-variance-authority";
|
|
18133
|
+
import { debounce as debounce2 } from "lodash-es";
|
|
18134
|
+
import { Search as Search2, XIcon } from "lucide-react";
|
|
18135
|
+
import * as React8 from "react";
|
|
18136
|
+
import { jsx as jsx122, jsxs as jsxs62 } from "react/jsx-runtime";
|
|
18137
|
+
var searchFilterBarVariants = cva15(["flex items-center gap-2", "flex-wrap"]);
|
|
18138
|
+
var searchFilterBarInputVariants = cva15([
|
|
18139
|
+
// Layout & Sizing
|
|
18140
|
+
"flex h-9 min-w-0",
|
|
18141
|
+
// Spacing & Borders (pl-10 for search icon)
|
|
18142
|
+
"pl-10 pr-3 py-1 rounded-md border border-input",
|
|
18143
|
+
// Background & Text
|
|
18144
|
+
"bg-transparent text-base",
|
|
18145
|
+
"dark:bg-input/30",
|
|
18146
|
+
// Visual Effects
|
|
18147
|
+
"shadow-xs outline-none",
|
|
18148
|
+
"transition-[color,box-shadow]",
|
|
18149
|
+
// Placeholder & Selection
|
|
18150
|
+
"placeholder:text-muted-foreground",
|
|
18151
|
+
"selection:bg-primary selection:text-primary-foreground",
|
|
18152
|
+
// Focus State
|
|
18153
|
+
"focus-visible:border-ring",
|
|
18154
|
+
"focus-visible:ring-ring/50 focus-visible:ring-[3px]",
|
|
18155
|
+
// Disabled State
|
|
18156
|
+
"disabled:pointer-events-none",
|
|
18157
|
+
"disabled:cursor-not-allowed",
|
|
18158
|
+
"disabled:opacity-50"
|
|
18159
|
+
]);
|
|
18160
|
+
var searchFilterBarClearButtonVariants = cva15([
|
|
18161
|
+
"inline-flex items-center gap-1 h-9 px-3",
|
|
18162
|
+
"text-sm font-medium text-muted-foreground",
|
|
18163
|
+
"hover:text-foreground",
|
|
18164
|
+
"transition-colors",
|
|
18165
|
+
"cursor-pointer",
|
|
18166
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50 rounded-md",
|
|
18167
|
+
"disabled:pointer-events-none disabled:opacity-50"
|
|
18168
|
+
]);
|
|
18169
|
+
var SearchFilterBar = React8.forwardRef(
|
|
18170
|
+
({
|
|
18171
|
+
searchValue,
|
|
18172
|
+
onSearchChange,
|
|
18173
|
+
searchPlaceholder = "Search...",
|
|
18174
|
+
searchWidth = 200,
|
|
18175
|
+
searchDebounceMs = 300,
|
|
18176
|
+
children,
|
|
18177
|
+
onClearFilters,
|
|
18178
|
+
showClearFilters = true,
|
|
18179
|
+
clearFiltersLabel = "Clear filters",
|
|
18180
|
+
disabled = false,
|
|
18181
|
+
className
|
|
18182
|
+
}, ref) => {
|
|
18183
|
+
const inputRef = React8.useRef(null);
|
|
18184
|
+
const [internalValue, setInternalValue] = React8.useState(searchValue);
|
|
18185
|
+
React8.useEffect(() => {
|
|
18186
|
+
setInternalValue(searchValue);
|
|
18187
|
+
}, [searchValue]);
|
|
18188
|
+
const debouncedOnChange = React8.useMemo(
|
|
18189
|
+
() => searchDebounceMs > 0 ? debounce2((value) => onSearchChange(value), searchDebounceMs) : null,
|
|
18190
|
+
[onSearchChange, searchDebounceMs]
|
|
18191
|
+
);
|
|
18192
|
+
React8.useEffect(() => {
|
|
18193
|
+
return () => {
|
|
18194
|
+
debouncedOnChange?.cancel();
|
|
18195
|
+
};
|
|
18196
|
+
}, [debouncedOnChange]);
|
|
18197
|
+
const handleSearchChange = (e) => {
|
|
18198
|
+
const newValue = e.target.value;
|
|
18199
|
+
setInternalValue(newValue);
|
|
18200
|
+
if (debouncedOnChange) {
|
|
18201
|
+
debouncedOnChange(newValue);
|
|
18202
|
+
} else {
|
|
18203
|
+
onSearchChange(newValue);
|
|
18204
|
+
}
|
|
18205
|
+
};
|
|
18206
|
+
const handleClearFilters = () => {
|
|
18207
|
+
debouncedOnChange?.cancel();
|
|
18208
|
+
onClearFilters?.();
|
|
18209
|
+
};
|
|
18210
|
+
const searchWidthStyle = typeof searchWidth === "number" ? `${searchWidth}px` : searchWidth;
|
|
18211
|
+
return /* @__PURE__ */ jsxs62(
|
|
18212
|
+
"div",
|
|
18213
|
+
{
|
|
18214
|
+
ref,
|
|
18215
|
+
className: cn(searchFilterBarVariants(), className),
|
|
18216
|
+
"data-slot": "search-filter-bar",
|
|
18217
|
+
children: [
|
|
18218
|
+
/* @__PURE__ */ jsxs62("div", { className: "relative", children: [
|
|
18219
|
+
/* @__PURE__ */ jsx122(
|
|
18220
|
+
"input",
|
|
18221
|
+
{
|
|
18222
|
+
ref: inputRef,
|
|
18223
|
+
type: "search",
|
|
18224
|
+
value: internalValue,
|
|
18225
|
+
onChange: handleSearchChange,
|
|
18226
|
+
placeholder: searchPlaceholder,
|
|
18227
|
+
disabled,
|
|
18228
|
+
className: cn(searchFilterBarInputVariants()),
|
|
18229
|
+
style: { width: searchWidthStyle },
|
|
18230
|
+
"data-slot": "search-filter-bar-input"
|
|
18231
|
+
}
|
|
18232
|
+
),
|
|
18233
|
+
/* @__PURE__ */ jsx122("div", { className: "absolute top-1/2 left-3 transform -translate-y-1/2 text-muted-foreground pointer-events-none", children: /* @__PURE__ */ jsx122(Search2, { className: "h-4 w-4" }) })
|
|
18234
|
+
] }),
|
|
18235
|
+
children,
|
|
18236
|
+
showClearFilters && /* @__PURE__ */ jsxs62(
|
|
18237
|
+
"button",
|
|
18238
|
+
{
|
|
18239
|
+
type: "button",
|
|
18240
|
+
onClick: handleClearFilters,
|
|
18241
|
+
disabled,
|
|
18242
|
+
className: cn(searchFilterBarClearButtonVariants()),
|
|
18243
|
+
"data-slot": "search-filter-bar-clear",
|
|
18244
|
+
children: [
|
|
18245
|
+
/* @__PURE__ */ jsx122(XIcon, { className: "h-4 w-4" }),
|
|
18246
|
+
clearFiltersLabel
|
|
18247
|
+
]
|
|
18248
|
+
}
|
|
18249
|
+
)
|
|
18250
|
+
]
|
|
18251
|
+
}
|
|
18252
|
+
);
|
|
18253
|
+
}
|
|
18254
|
+
);
|
|
18255
|
+
SearchFilterBar.displayName = "SearchFilterBar";
|
|
18256
|
+
|
|
18257
|
+
// src/components/search-controls/SearchFilterDropdown.tsx
|
|
18258
|
+
import * as PopoverPrimitive from "@radix-ui/react-popover";
|
|
18259
|
+
import { cva as cva16 } from "class-variance-authority";
|
|
18260
|
+
import { ChevronDownIcon, TypeIcon } from "lucide-react";
|
|
18261
|
+
import * as React9 from "react";
|
|
18262
|
+
import { jsx as jsx123, jsxs as jsxs63 } from "react/jsx-runtime";
|
|
18263
|
+
var searchFilterTriggerVariants = cva16(
|
|
18264
|
+
[
|
|
18265
|
+
// Base - matching TextInput height/roundness
|
|
18266
|
+
"inline-flex items-center gap-1.5 h-9 px-3 rounded-md",
|
|
18267
|
+
"text-sm font-medium",
|
|
18268
|
+
"border transition-all",
|
|
18269
|
+
"cursor-pointer",
|
|
18270
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",
|
|
18271
|
+
"disabled:pointer-events-none disabled:opacity-50"
|
|
18272
|
+
],
|
|
18273
|
+
{
|
|
18274
|
+
variants: {
|
|
18275
|
+
isActive: {
|
|
18276
|
+
true: "bg-primary/10 text-primary border-primary/30 hover:bg-primary/15",
|
|
18277
|
+
false: "bg-transparent text-foreground border-input hover:bg-muted dark:bg-input/30"
|
|
18278
|
+
}
|
|
18279
|
+
},
|
|
18280
|
+
defaultVariants: {
|
|
18281
|
+
isActive: false
|
|
18282
|
+
}
|
|
18283
|
+
}
|
|
18284
|
+
);
|
|
18285
|
+
var searchFilterContentVariants = cva16([
|
|
18286
|
+
// Background & Border
|
|
18287
|
+
"bg-popover text-popover-foreground",
|
|
18288
|
+
"border rounded-md shadow-md",
|
|
18289
|
+
// Positioning
|
|
18290
|
+
"z-50",
|
|
18291
|
+
// Animations
|
|
18292
|
+
"data-[state=open]:animate-in data-[state=closed]:animate-out",
|
|
18293
|
+
"data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
|
|
18294
|
+
"data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95",
|
|
18295
|
+
"data-[side=bottom]:slide-in-from-top-2",
|
|
18296
|
+
"data-[side=left]:slide-in-from-right-2",
|
|
18297
|
+
"data-[side=right]:slide-in-from-left-2",
|
|
18298
|
+
"data-[side=top]:slide-in-from-bottom-2"
|
|
18299
|
+
]);
|
|
18300
|
+
var SearchFilterBadge = ({ count }) => /* @__PURE__ */ jsx123("span", { className: "ml-0.5 px-1.5 py-0.5 text-xs font-medium bg-primary text-primary-foreground rounded-full min-w-5 h-5 inline-flex items-center justify-center", children: count });
|
|
18301
|
+
var SearchFilterCheckIndicator = () => /* @__PURE__ */ jsx123(
|
|
18302
|
+
"span",
|
|
18303
|
+
{
|
|
18304
|
+
className: "ml-0.5 px-1.5 py-0.5 text-xs font-medium bg-primary text-primary-foreground rounded-full min-w-5 h-5 inline-flex items-center justify-center",
|
|
18305
|
+
"aria-hidden": "true",
|
|
18306
|
+
children: /* @__PURE__ */ jsx123(TypeIcon, { className: "h-3 w-3" })
|
|
18307
|
+
}
|
|
18308
|
+
);
|
|
18309
|
+
var SearchFilterChevron = ({ isOpen }) => /* @__PURE__ */ jsx123(
|
|
18310
|
+
ChevronDownIcon,
|
|
18311
|
+
{
|
|
18312
|
+
className: cn(
|
|
18313
|
+
"h-4 w-4 shrink-0 transition-transform duration-200",
|
|
18314
|
+
isOpen && "rotate-180"
|
|
18315
|
+
),
|
|
18316
|
+
"aria-hidden": "true"
|
|
18317
|
+
}
|
|
18318
|
+
);
|
|
18319
|
+
var SearchFilterDropdown = React9.forwardRef(
|
|
18320
|
+
({
|
|
18321
|
+
label,
|
|
18322
|
+
isActive = false,
|
|
18323
|
+
activeCount,
|
|
18324
|
+
showDotIndicator = false,
|
|
18325
|
+
children,
|
|
18326
|
+
dropdownWidth = "auto",
|
|
18327
|
+
onOpenChange,
|
|
18328
|
+
open,
|
|
18329
|
+
disabled = false,
|
|
18330
|
+
className
|
|
18331
|
+
}, ref) => {
|
|
18332
|
+
const [internalOpen, setInternalOpen] = React9.useState(false);
|
|
18333
|
+
const triggerRef = React9.useRef(null);
|
|
18334
|
+
React9.useImperativeHandle(
|
|
18335
|
+
ref,
|
|
18336
|
+
() => triggerRef.current
|
|
18337
|
+
);
|
|
18338
|
+
const isControlled = open !== void 0;
|
|
18339
|
+
const isOpen = isControlled ? open : internalOpen;
|
|
18340
|
+
const handleOpenChange = (newOpen) => {
|
|
18341
|
+
if (!isControlled) {
|
|
18342
|
+
setInternalOpen(newOpen);
|
|
18343
|
+
}
|
|
18344
|
+
onOpenChange?.(newOpen);
|
|
18345
|
+
};
|
|
18346
|
+
const getContentStyle = () => {
|
|
18347
|
+
if (dropdownWidth === "auto") {
|
|
18348
|
+
return { minWidth: "200px" };
|
|
18349
|
+
}
|
|
18350
|
+
if (dropdownWidth === "trigger") {
|
|
18351
|
+
return { width: triggerRef.current?.offsetWidth ?? "auto" };
|
|
18352
|
+
}
|
|
18353
|
+
return { width: `${dropdownWidth}px` };
|
|
18354
|
+
};
|
|
18355
|
+
return /* @__PURE__ */ jsxs63(PopoverPrimitive.Root, { open: isOpen, onOpenChange: handleOpenChange, children: [
|
|
18356
|
+
/* @__PURE__ */ jsx123(PopoverPrimitive.Trigger, { asChild: true, children: /* @__PURE__ */ jsxs63(
|
|
18357
|
+
"button",
|
|
18358
|
+
{
|
|
18359
|
+
ref: triggerRef,
|
|
18360
|
+
type: "button",
|
|
18361
|
+
disabled,
|
|
18362
|
+
className: cn(searchFilterTriggerVariants({ isActive }), className),
|
|
18363
|
+
"data-slot": "search-filter-trigger",
|
|
18364
|
+
children: [
|
|
18365
|
+
/* @__PURE__ */ jsx123("span", { className: "truncate", children: label }),
|
|
18366
|
+
isActive && showDotIndicator && /* @__PURE__ */ jsx123(SearchFilterCheckIndicator, {}),
|
|
18367
|
+
isActive && !showDotIndicator && activeCount !== void 0 && activeCount > 0 && /* @__PURE__ */ jsx123(SearchFilterBadge, { count: activeCount }),
|
|
18368
|
+
/* @__PURE__ */ jsx123(SearchFilterChevron, { isOpen })
|
|
18369
|
+
]
|
|
18370
|
+
}
|
|
18371
|
+
) }),
|
|
18372
|
+
/* @__PURE__ */ jsx123(PopoverPrimitive.Portal, { children: /* @__PURE__ */ jsx123(
|
|
18373
|
+
PopoverPrimitive.Content,
|
|
18374
|
+
{
|
|
18375
|
+
sideOffset: 4,
|
|
18376
|
+
align: "start",
|
|
18377
|
+
className: cn(searchFilterContentVariants()),
|
|
18378
|
+
style: getContentStyle(),
|
|
18379
|
+
"data-slot": "search-filter-content",
|
|
18380
|
+
children
|
|
18381
|
+
}
|
|
18382
|
+
) })
|
|
18383
|
+
] });
|
|
18384
|
+
}
|
|
18385
|
+
);
|
|
18386
|
+
SearchFilterDropdown.displayName = "SearchFilterDropdown";
|
|
18387
|
+
|
|
18388
|
+
// src/components/search-controls/SelectFilter.tsx
|
|
18389
|
+
import { cva as cva17 } from "class-variance-authority";
|
|
18390
|
+
import * as React10 from "react";
|
|
18391
|
+
import { jsx as jsx124, jsxs as jsxs64 } from "react/jsx-runtime";
|
|
18392
|
+
var optionVariants3 = cva17(
|
|
18393
|
+
[
|
|
18394
|
+
// Layout
|
|
18395
|
+
"flex items-center gap-2 px-3 py-2",
|
|
18396
|
+
// Interaction
|
|
18397
|
+
"cursor-pointer select-none",
|
|
18398
|
+
// Visual Effects
|
|
18399
|
+
"transition-colors"
|
|
18400
|
+
],
|
|
18401
|
+
{
|
|
18402
|
+
variants: {
|
|
18403
|
+
isHighlighted: {
|
|
18404
|
+
true: "bg-muted",
|
|
18405
|
+
false: "hover:bg-muted/50"
|
|
18406
|
+
}
|
|
18407
|
+
},
|
|
18408
|
+
defaultVariants: {
|
|
18409
|
+
isHighlighted: false
|
|
18410
|
+
}
|
|
18411
|
+
}
|
|
18412
|
+
);
|
|
18413
|
+
function SelectFilterInner({
|
|
18414
|
+
label,
|
|
18415
|
+
options,
|
|
18416
|
+
value,
|
|
18417
|
+
onChange,
|
|
18418
|
+
searchable = false,
|
|
18419
|
+
searchPlaceholder = "Search...",
|
|
18420
|
+
filterOptions,
|
|
18421
|
+
emptyMessage = "No options found",
|
|
18422
|
+
showSelectAllClear = false,
|
|
18423
|
+
maxHeight = 300,
|
|
18424
|
+
dropdownWidth = 280,
|
|
18425
|
+
disabled = false,
|
|
18426
|
+
className
|
|
18427
|
+
}, ref) {
|
|
18428
|
+
const [searchQuery, setSearchQuery] = React10.useState("");
|
|
18429
|
+
const [isOpen, setIsOpen] = React10.useState(false);
|
|
18430
|
+
const [highlightedIndex, setHighlightedIndex] = React10.useState(-1);
|
|
18431
|
+
const searchInputRef = React10.useRef(null);
|
|
18432
|
+
const optionsContainerRef = React10.useRef(null);
|
|
18433
|
+
const defaultFilterOptions = (opts, query) => {
|
|
18434
|
+
if (!query.trim()) return opts;
|
|
18435
|
+
const lowerQuery = query.toLowerCase();
|
|
18436
|
+
return opts.filter(
|
|
18437
|
+
(opt) => opt.label.toLowerCase().includes(lowerQuery) || opt.description?.toLowerCase().includes(lowerQuery)
|
|
18438
|
+
);
|
|
18439
|
+
};
|
|
18440
|
+
const actualFilterOptions = filterOptions || defaultFilterOptions;
|
|
18441
|
+
const filteredOptions = actualFilterOptions(options, searchQuery);
|
|
18442
|
+
React10.useEffect(() => {
|
|
18443
|
+
if (isOpen && searchable) {
|
|
18444
|
+
const timer = setTimeout(() => {
|
|
18445
|
+
searchInputRef.current?.focus();
|
|
18446
|
+
}, 0);
|
|
18447
|
+
return () => clearTimeout(timer);
|
|
18448
|
+
}
|
|
18449
|
+
}, [isOpen, searchable]);
|
|
18450
|
+
React10.useEffect(() => {
|
|
18451
|
+
if (!isOpen) {
|
|
18452
|
+
setSearchQuery("");
|
|
18453
|
+
setHighlightedIndex(-1);
|
|
18454
|
+
}
|
|
18455
|
+
}, [isOpen]);
|
|
18456
|
+
const isValueSelected = (optionValue) => {
|
|
18457
|
+
return value.some((v) => v === optionValue);
|
|
18458
|
+
};
|
|
18459
|
+
const toggleOption = (optionValue) => {
|
|
18460
|
+
if (isValueSelected(optionValue)) {
|
|
18461
|
+
onChange(value.filter((v) => v !== optionValue));
|
|
18462
|
+
} else {
|
|
18463
|
+
onChange([...value, optionValue]);
|
|
18464
|
+
}
|
|
18465
|
+
};
|
|
18466
|
+
const selectAll = () => {
|
|
18467
|
+
const allValues = filteredOptions.filter((opt) => !opt.disabled).map((opt) => opt.value);
|
|
18468
|
+
const newValue = [.../* @__PURE__ */ new Set([...value, ...allValues])];
|
|
18469
|
+
onChange(newValue);
|
|
18470
|
+
};
|
|
18471
|
+
const clearAll = () => {
|
|
18472
|
+
const filteredValues = new Set(filteredOptions.map((opt) => opt.value));
|
|
18473
|
+
const newValue = value.filter((v) => !filteredValues.has(v));
|
|
18474
|
+
onChange(newValue);
|
|
18475
|
+
};
|
|
18476
|
+
const handleKeyDown = (e) => {
|
|
18477
|
+
const enabledOptions = filteredOptions.filter((opt) => !opt.disabled);
|
|
18478
|
+
switch (e.key) {
|
|
18479
|
+
case "ArrowDown":
|
|
18480
|
+
e.preventDefault();
|
|
18481
|
+
setHighlightedIndex(
|
|
18482
|
+
(prev) => prev < enabledOptions.length - 1 ? prev + 1 : 0
|
|
18483
|
+
);
|
|
18484
|
+
break;
|
|
18485
|
+
case "ArrowUp":
|
|
18486
|
+
e.preventDefault();
|
|
18487
|
+
setHighlightedIndex(
|
|
18488
|
+
(prev) => prev > 0 ? prev - 1 : enabledOptions.length - 1
|
|
18489
|
+
);
|
|
18490
|
+
break;
|
|
18491
|
+
case "Enter":
|
|
18492
|
+
case " ": {
|
|
18493
|
+
const highlightedOption = enabledOptions[highlightedIndex];
|
|
18494
|
+
if (highlightedIndex >= 0 && highlightedOption) {
|
|
18495
|
+
e.preventDefault();
|
|
18496
|
+
toggleOption(highlightedOption.value);
|
|
18497
|
+
}
|
|
18498
|
+
break;
|
|
18499
|
+
}
|
|
18500
|
+
case "Escape":
|
|
18501
|
+
setIsOpen(false);
|
|
18502
|
+
break;
|
|
18503
|
+
}
|
|
18504
|
+
};
|
|
18505
|
+
React10.useEffect(() => {
|
|
18506
|
+
if (highlightedIndex >= 0 && optionsContainerRef.current) {
|
|
18507
|
+
const container = optionsContainerRef.current;
|
|
18508
|
+
const highlightedElement = container.children[highlightedIndex];
|
|
18509
|
+
if (highlightedElement) {
|
|
18510
|
+
highlightedElement.scrollIntoView({ block: "nearest" });
|
|
18511
|
+
}
|
|
18512
|
+
}
|
|
18513
|
+
}, [highlightedIndex]);
|
|
18514
|
+
const isActive = value.length > 0;
|
|
18515
|
+
const activeCount = value.length;
|
|
18516
|
+
return /* @__PURE__ */ jsx124(
|
|
18517
|
+
SearchFilterDropdown,
|
|
18518
|
+
{
|
|
18519
|
+
ref,
|
|
18520
|
+
label,
|
|
18521
|
+
isActive,
|
|
18522
|
+
activeCount,
|
|
18523
|
+
dropdownWidth,
|
|
18524
|
+
open: isOpen,
|
|
18525
|
+
onOpenChange: setIsOpen,
|
|
18526
|
+
disabled,
|
|
18527
|
+
className,
|
|
18528
|
+
children: /* @__PURE__ */ jsxs64("div", { role: "listbox", "aria-multiselectable": "true", onKeyDown: handleKeyDown, children: [
|
|
18529
|
+
searchable && /* @__PURE__ */ jsx124("div", { className: "p-2 border-b border-border", children: /* @__PURE__ */ jsx124(
|
|
18530
|
+
SearchTextInput,
|
|
18531
|
+
{
|
|
18532
|
+
ref: searchInputRef,
|
|
18533
|
+
value: searchQuery,
|
|
18534
|
+
onChange: (e) => {
|
|
18535
|
+
setSearchQuery(e.target.value);
|
|
18536
|
+
setHighlightedIndex(-1);
|
|
18537
|
+
},
|
|
18538
|
+
placeholder: searchPlaceholder,
|
|
18539
|
+
className: "w-full"
|
|
18540
|
+
}
|
|
18541
|
+
) }),
|
|
18542
|
+
showSelectAllClear && /* @__PURE__ */ jsxs64("div", { className: "flex items-center justify-between px-3 py-2 border-b border-border text-sm", children: [
|
|
18543
|
+
/* @__PURE__ */ jsx124(
|
|
18544
|
+
"button",
|
|
18545
|
+
{
|
|
18546
|
+
type: "button",
|
|
18547
|
+
onClick: selectAll,
|
|
18548
|
+
className: "text-primary hover:underline focus:outline-none",
|
|
18549
|
+
children: "Select All"
|
|
18550
|
+
}
|
|
18551
|
+
),
|
|
18552
|
+
/* @__PURE__ */ jsx124(
|
|
18553
|
+
"button",
|
|
18554
|
+
{
|
|
18555
|
+
type: "button",
|
|
18556
|
+
onClick: clearAll,
|
|
18557
|
+
className: "text-muted-foreground hover:text-foreground focus:outline-none",
|
|
18558
|
+
children: "Clear All"
|
|
18559
|
+
}
|
|
18560
|
+
)
|
|
18561
|
+
] }),
|
|
18562
|
+
/* @__PURE__ */ jsx124(
|
|
18563
|
+
"div",
|
|
18564
|
+
{
|
|
18565
|
+
ref: optionsContainerRef,
|
|
18566
|
+
className: "overflow-y-auto",
|
|
18567
|
+
style: { maxHeight: `${maxHeight}px` },
|
|
18568
|
+
children: filteredOptions.length === 0 ? /* @__PURE__ */ jsx124("div", { className: "px-3 py-4 text-sm text-muted-foreground text-center", children: emptyMessage }) : filteredOptions.map((option, index) => {
|
|
18569
|
+
const isSelected = isValueSelected(option.value);
|
|
18570
|
+
const isHighlighted = highlightedIndex === index;
|
|
18571
|
+
return /* @__PURE__ */ jsxs64(
|
|
18572
|
+
"div",
|
|
18573
|
+
{
|
|
18574
|
+
role: "option",
|
|
18575
|
+
"aria-selected": isSelected,
|
|
18576
|
+
"aria-disabled": option.disabled,
|
|
18577
|
+
tabIndex: 0,
|
|
18578
|
+
className: cn(
|
|
18579
|
+
optionVariants3({ isHighlighted }),
|
|
18580
|
+
option.disabled && "opacity-50 cursor-not-allowed"
|
|
18581
|
+
),
|
|
18582
|
+
onClick: () => {
|
|
18583
|
+
if (!option.disabled) {
|
|
18584
|
+
toggleOption(option.value);
|
|
18585
|
+
}
|
|
18586
|
+
},
|
|
18587
|
+
onKeyDown: (e) => {
|
|
18588
|
+
if ((e.key === "Enter" || e.key === " ") && !option.disabled) {
|
|
18589
|
+
e.preventDefault();
|
|
18590
|
+
toggleOption(option.value);
|
|
18591
|
+
}
|
|
18592
|
+
},
|
|
18593
|
+
onMouseEnter: () => {
|
|
18594
|
+
if (!option.disabled) {
|
|
18595
|
+
setHighlightedIndex(index);
|
|
18596
|
+
}
|
|
18597
|
+
},
|
|
18598
|
+
children: [
|
|
18599
|
+
/* @__PURE__ */ jsx124(
|
|
18600
|
+
Checkbox,
|
|
18601
|
+
{
|
|
18602
|
+
checked: isSelected,
|
|
18603
|
+
disabled: option.disabled,
|
|
18604
|
+
onCheckedChange: () => {
|
|
18605
|
+
if (!option.disabled) {
|
|
18606
|
+
toggleOption(option.value);
|
|
18607
|
+
}
|
|
18608
|
+
},
|
|
18609
|
+
onClick: (e) => e.stopPropagation()
|
|
18610
|
+
}
|
|
18611
|
+
),
|
|
18612
|
+
/* @__PURE__ */ jsxs64("div", { className: "flex-1 min-w-0", children: [
|
|
18613
|
+
/* @__PURE__ */ jsx124("div", { className: "text-sm truncate", children: option.label }),
|
|
18614
|
+
option.description && /* @__PURE__ */ jsx124("div", { className: "text-xs text-muted-foreground truncate", children: option.description })
|
|
18615
|
+
] })
|
|
18616
|
+
]
|
|
18617
|
+
},
|
|
18618
|
+
String(option.value)
|
|
18619
|
+
);
|
|
18620
|
+
})
|
|
18621
|
+
}
|
|
18622
|
+
)
|
|
18623
|
+
] })
|
|
18624
|
+
}
|
|
18625
|
+
);
|
|
18626
|
+
}
|
|
18627
|
+
var SelectFilter = React10.forwardRef(SelectFilterInner);
|
|
18628
|
+
SelectFilter.displayName = "SelectFilter";
|
|
18629
|
+
|
|
18630
|
+
// src/components/search-controls/TextFilter.tsx
|
|
18631
|
+
import { TypeIcon as TypeIcon2, XIcon as XIcon2 } from "lucide-react";
|
|
18632
|
+
import * as React11 from "react";
|
|
18633
|
+
import { jsx as jsx125, jsxs as jsxs65 } from "react/jsx-runtime";
|
|
18634
|
+
var TextFilter = React11.forwardRef(
|
|
18635
|
+
({
|
|
18636
|
+
label,
|
|
18637
|
+
value,
|
|
18638
|
+
onChange,
|
|
18639
|
+
placeholder = "Filter...",
|
|
18640
|
+
debounceMs = 300,
|
|
18641
|
+
dropdownWidth = 280,
|
|
18642
|
+
disabled = false,
|
|
18643
|
+
className
|
|
18644
|
+
}, ref) => {
|
|
18645
|
+
const [internalValue, setInternalValue] = React11.useState(value);
|
|
18646
|
+
const [isOpen, setIsOpen] = React11.useState(false);
|
|
18647
|
+
const inputRef = React11.useRef(null);
|
|
18648
|
+
const debounceTimerRef = React11.useRef(
|
|
18649
|
+
null
|
|
18650
|
+
);
|
|
18651
|
+
React11.useEffect(() => {
|
|
18652
|
+
setInternalValue(value);
|
|
18653
|
+
}, [value]);
|
|
18654
|
+
React11.useEffect(() => {
|
|
18655
|
+
if (isOpen) {
|
|
18656
|
+
const timer = setTimeout(() => {
|
|
18657
|
+
inputRef.current?.focus();
|
|
18658
|
+
}, 0);
|
|
18659
|
+
return () => clearTimeout(timer);
|
|
18660
|
+
}
|
|
18661
|
+
}, [isOpen]);
|
|
18662
|
+
React11.useEffect(() => {
|
|
18663
|
+
return () => {
|
|
18664
|
+
if (debounceTimerRef.current) {
|
|
18665
|
+
clearTimeout(debounceTimerRef.current);
|
|
18666
|
+
}
|
|
18667
|
+
};
|
|
18668
|
+
}, []);
|
|
18669
|
+
const handleInputChange = (e) => {
|
|
18670
|
+
const newValue = e.target.value;
|
|
18671
|
+
setInternalValue(newValue);
|
|
18672
|
+
if (debounceTimerRef.current) {
|
|
18673
|
+
clearTimeout(debounceTimerRef.current);
|
|
18674
|
+
}
|
|
18675
|
+
debounceTimerRef.current = setTimeout(() => {
|
|
18676
|
+
onChange(newValue);
|
|
18677
|
+
}, debounceMs);
|
|
18678
|
+
};
|
|
18679
|
+
const handleKeyDown = (e) => {
|
|
18680
|
+
if (e.key === "Enter") {
|
|
18681
|
+
if (debounceTimerRef.current) {
|
|
18682
|
+
clearTimeout(debounceTimerRef.current);
|
|
18683
|
+
}
|
|
18684
|
+
onChange(internalValue);
|
|
18685
|
+
setIsOpen(false);
|
|
18686
|
+
}
|
|
18687
|
+
};
|
|
18688
|
+
const handleClear = () => {
|
|
18689
|
+
setInternalValue("");
|
|
18690
|
+
if (debounceTimerRef.current) {
|
|
18691
|
+
clearTimeout(debounceTimerRef.current);
|
|
18692
|
+
}
|
|
18693
|
+
onChange("");
|
|
18694
|
+
inputRef.current?.focus();
|
|
18695
|
+
};
|
|
18696
|
+
const isActive = value.trim().length > 0;
|
|
18697
|
+
return /* @__PURE__ */ jsx125(
|
|
18698
|
+
SearchFilterDropdown,
|
|
18699
|
+
{
|
|
18700
|
+
ref,
|
|
18701
|
+
label,
|
|
18702
|
+
isActive,
|
|
18703
|
+
showDotIndicator: true,
|
|
18704
|
+
dropdownWidth,
|
|
18705
|
+
open: isOpen,
|
|
18706
|
+
onOpenChange: setIsOpen,
|
|
18707
|
+
disabled,
|
|
18708
|
+
className,
|
|
18709
|
+
children: /* @__PURE__ */ jsx125("div", { className: "p-2", children: /* @__PURE__ */ jsxs65("div", { className: "relative", children: [
|
|
18710
|
+
/* @__PURE__ */ jsx125(
|
|
18711
|
+
TextInput,
|
|
18712
|
+
{
|
|
18713
|
+
ref: inputRef,
|
|
18714
|
+
value: internalValue,
|
|
18715
|
+
onChange: handleInputChange,
|
|
18716
|
+
onKeyDown: handleKeyDown,
|
|
18717
|
+
placeholder,
|
|
18718
|
+
className: cn("w-full pl-9", internalValue && "pr-9")
|
|
18719
|
+
}
|
|
18720
|
+
),
|
|
18721
|
+
/* @__PURE__ */ jsx125("div", { className: "absolute top-1/2 left-3 -translate-y-1/2 text-muted-foreground pointer-events-none", children: /* @__PURE__ */ jsx125(TypeIcon2, { className: "h-4 w-4" }) }),
|
|
18722
|
+
internalValue && /* @__PURE__ */ jsx125(
|
|
18723
|
+
"button",
|
|
18724
|
+
{
|
|
18725
|
+
type: "button",
|
|
18726
|
+
onClick: handleClear,
|
|
18727
|
+
className: "absolute top-1/2 right-2 -translate-y-1/2 text-muted-foreground hover:text-foreground transition-colors rounded-sm cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",
|
|
18728
|
+
"aria-label": "Clear filter",
|
|
18729
|
+
children: /* @__PURE__ */ jsx125(XIcon2, { className: "h-4 w-4" })
|
|
18730
|
+
}
|
|
18731
|
+
)
|
|
18732
|
+
] }) })
|
|
18733
|
+
}
|
|
18734
|
+
);
|
|
18735
|
+
}
|
|
18736
|
+
);
|
|
18737
|
+
TextFilter.displayName = "TextFilter";
|
|
18738
|
+
|
|
18131
18739
|
// src/components/table/Pagination.tsx
|
|
18132
18740
|
import {
|
|
18133
18741
|
ChevronLeftIcon,
|
|
18134
18742
|
ChevronRightIcon as ChevronRightIcon3,
|
|
18135
18743
|
MoreHorizontalIcon as MoreHorizontalIcon3
|
|
18136
18744
|
} from "lucide-react";
|
|
18137
|
-
import * as
|
|
18138
|
-
import { jsx as
|
|
18745
|
+
import * as React12 from "react";
|
|
18746
|
+
import { jsx as jsx126, jsxs as jsxs66 } from "react/jsx-runtime";
|
|
18139
18747
|
function Pagination({ className, ...props }) {
|
|
18140
|
-
return /* @__PURE__ */
|
|
18748
|
+
return /* @__PURE__ */ jsx126(
|
|
18141
18749
|
"nav",
|
|
18142
18750
|
{
|
|
18143
18751
|
"aria-label": "pagination",
|
|
@@ -18151,7 +18759,7 @@ function PaginationContent({
|
|
|
18151
18759
|
className,
|
|
18152
18760
|
...props
|
|
18153
18761
|
}) {
|
|
18154
|
-
return /* @__PURE__ */
|
|
18762
|
+
return /* @__PURE__ */ jsx126(
|
|
18155
18763
|
"ul",
|
|
18156
18764
|
{
|
|
18157
18765
|
"data-slot": "pagination-content",
|
|
@@ -18161,7 +18769,7 @@ function PaginationContent({
|
|
|
18161
18769
|
);
|
|
18162
18770
|
}
|
|
18163
18771
|
function PaginationItem({ ...props }) {
|
|
18164
|
-
return /* @__PURE__ */
|
|
18772
|
+
return /* @__PURE__ */ jsx126("li", { "data-slot": "pagination-item", ...props });
|
|
18165
18773
|
}
|
|
18166
18774
|
function PaginationLink({
|
|
18167
18775
|
className,
|
|
@@ -18169,7 +18777,7 @@ function PaginationLink({
|
|
|
18169
18777
|
variant = "secondary",
|
|
18170
18778
|
...props
|
|
18171
18779
|
}) {
|
|
18172
|
-
return /* @__PURE__ */
|
|
18780
|
+
return /* @__PURE__ */ jsx126(
|
|
18173
18781
|
"a",
|
|
18174
18782
|
{
|
|
18175
18783
|
"aria-current": isActive ? "page" : void 0,
|
|
@@ -18190,15 +18798,15 @@ function PaginationPrevious({
|
|
|
18190
18798
|
className,
|
|
18191
18799
|
...props
|
|
18192
18800
|
}) {
|
|
18193
|
-
return /* @__PURE__ */
|
|
18801
|
+
return /* @__PURE__ */ jsxs66(
|
|
18194
18802
|
PaginationLink,
|
|
18195
18803
|
{
|
|
18196
18804
|
"aria-label": "Go to previous page",
|
|
18197
18805
|
className: cn("gap-1 px-2.5 sm:pl-2.5 w-auto", className),
|
|
18198
18806
|
...props,
|
|
18199
18807
|
children: [
|
|
18200
|
-
/* @__PURE__ */
|
|
18201
|
-
/* @__PURE__ */
|
|
18808
|
+
/* @__PURE__ */ jsx126(ChevronLeftIcon, { className: "h-4 w-4" }),
|
|
18809
|
+
/* @__PURE__ */ jsx126("span", { className: "hidden sm:block", children: "Previous" })
|
|
18202
18810
|
]
|
|
18203
18811
|
}
|
|
18204
18812
|
);
|
|
@@ -18207,15 +18815,15 @@ function PaginationNext({
|
|
|
18207
18815
|
className,
|
|
18208
18816
|
...props
|
|
18209
18817
|
}) {
|
|
18210
|
-
return /* @__PURE__ */
|
|
18818
|
+
return /* @__PURE__ */ jsxs66(
|
|
18211
18819
|
PaginationLink,
|
|
18212
18820
|
{
|
|
18213
18821
|
"aria-label": "Go to next page",
|
|
18214
18822
|
className: cn("gap-1 px-2.5 sm:pr-2.5 w-auto", className),
|
|
18215
18823
|
...props,
|
|
18216
18824
|
children: [
|
|
18217
|
-
/* @__PURE__ */
|
|
18218
|
-
/* @__PURE__ */
|
|
18825
|
+
/* @__PURE__ */ jsx126("span", { className: "hidden sm:block", children: "Next" }),
|
|
18826
|
+
/* @__PURE__ */ jsx126(ChevronRightIcon3, { className: "h-4 w-4" })
|
|
18219
18827
|
]
|
|
18220
18828
|
}
|
|
18221
18829
|
);
|
|
@@ -18224,7 +18832,7 @@ function PaginationEllipsis({
|
|
|
18224
18832
|
className,
|
|
18225
18833
|
...props
|
|
18226
18834
|
}) {
|
|
18227
|
-
return /* @__PURE__ */
|
|
18835
|
+
return /* @__PURE__ */ jsxs66(
|
|
18228
18836
|
"span",
|
|
18229
18837
|
{
|
|
18230
18838
|
"aria-hidden": true,
|
|
@@ -18232,13 +18840,13 @@ function PaginationEllipsis({
|
|
|
18232
18840
|
className: cn("flex size-9 items-center justify-center", className),
|
|
18233
18841
|
...props,
|
|
18234
18842
|
children: [
|
|
18235
|
-
/* @__PURE__ */
|
|
18236
|
-
/* @__PURE__ */
|
|
18843
|
+
/* @__PURE__ */ jsx126(MoreHorizontalIcon3, { className: "size-4" }),
|
|
18844
|
+
/* @__PURE__ */ jsx126("span", { className: "sr-only", children: "More pages" })
|
|
18237
18845
|
]
|
|
18238
18846
|
}
|
|
18239
18847
|
);
|
|
18240
18848
|
}
|
|
18241
|
-
var EnhancedPagination =
|
|
18849
|
+
var EnhancedPagination = React12.forwardRef(
|
|
18242
18850
|
({
|
|
18243
18851
|
className,
|
|
18244
18852
|
currentPage,
|
|
@@ -18277,14 +18885,14 @@ var EnhancedPagination = React8.forwardRef(
|
|
|
18277
18885
|
if (totalPages <= 1 && !showInfo && !showPageSizeSelector) {
|
|
18278
18886
|
return null;
|
|
18279
18887
|
}
|
|
18280
|
-
return /* @__PURE__ */
|
|
18888
|
+
return /* @__PURE__ */ jsxs66(
|
|
18281
18889
|
"div",
|
|
18282
18890
|
{
|
|
18283
18891
|
className: cn("flex items-center justify-between gap-4 p-4", className),
|
|
18284
18892
|
...props,
|
|
18285
18893
|
children: [
|
|
18286
|
-
/* @__PURE__ */
|
|
18287
|
-
showInfo && /* @__PURE__ */
|
|
18894
|
+
/* @__PURE__ */ jsxs66("div", { className: "flex items-center gap-4", children: [
|
|
18895
|
+
showInfo && /* @__PURE__ */ jsxs66("span", { className: "text-muted-foreground text-sm", children: [
|
|
18288
18896
|
"Showing ",
|
|
18289
18897
|
startItem,
|
|
18290
18898
|
"-",
|
|
@@ -18293,21 +18901,21 @@ var EnhancedPagination = React8.forwardRef(
|
|
|
18293
18901
|
totalItems,
|
|
18294
18902
|
" items"
|
|
18295
18903
|
] }),
|
|
18296
|
-
showPageSizeSelector && onPageSizeChange && /* @__PURE__ */
|
|
18297
|
-
/* @__PURE__ */
|
|
18298
|
-
/* @__PURE__ */
|
|
18904
|
+
showPageSizeSelector && onPageSizeChange && /* @__PURE__ */ jsxs66("div", { className: "flex items-center gap-2", children: [
|
|
18905
|
+
/* @__PURE__ */ jsx126("span", { className: "text-muted-foreground text-sm", children: "Items per page:" }),
|
|
18906
|
+
/* @__PURE__ */ jsx126(
|
|
18299
18907
|
"select",
|
|
18300
18908
|
{
|
|
18301
18909
|
value: pageSize,
|
|
18302
18910
|
onChange: (e) => onPageSizeChange(Number(e.target.value)),
|
|
18303
18911
|
className: "bg-background border border-border rounded px-2 py-1 text-foreground text-sm focus:border-primary focus:ring-2 focus:ring-primary/10 outline-none h-9",
|
|
18304
|
-
children: pageSizeOptions.map((option) => /* @__PURE__ */
|
|
18912
|
+
children: pageSizeOptions.map((option) => /* @__PURE__ */ jsx126("option", { value: option, children: option }, option))
|
|
18305
18913
|
}
|
|
18306
18914
|
)
|
|
18307
18915
|
] })
|
|
18308
18916
|
] }),
|
|
18309
|
-
totalPages > 1 && /* @__PURE__ */
|
|
18310
|
-
/* @__PURE__ */
|
|
18917
|
+
totalPages > 1 && /* @__PURE__ */ jsx126(Pagination, { ref, children: /* @__PURE__ */ jsxs66(PaginationContent, { children: [
|
|
18918
|
+
/* @__PURE__ */ jsx126(PaginationItem, { children: /* @__PURE__ */ jsx126(
|
|
18311
18919
|
PaginationPrevious,
|
|
18312
18920
|
{
|
|
18313
18921
|
href: "#",
|
|
@@ -18318,7 +18926,7 @@ var EnhancedPagination = React8.forwardRef(
|
|
|
18318
18926
|
className: currentPage === 1 ? "pointer-events-none opacity-50" : ""
|
|
18319
18927
|
}
|
|
18320
18928
|
) }),
|
|
18321
|
-
getVisiblePages().map((page, index) => /* @__PURE__ */
|
|
18929
|
+
getVisiblePages().map((page, index) => /* @__PURE__ */ jsx126(PaginationItem, { children: page === "..." ? /* @__PURE__ */ jsx126(PaginationEllipsis, {}) : /* @__PURE__ */ jsx126(
|
|
18322
18930
|
PaginationLink,
|
|
18323
18931
|
{
|
|
18324
18932
|
href: "#",
|
|
@@ -18332,7 +18940,7 @@ var EnhancedPagination = React8.forwardRef(
|
|
|
18332
18940
|
children: page
|
|
18333
18941
|
}
|
|
18334
18942
|
) }, index)),
|
|
18335
|
-
/* @__PURE__ */
|
|
18943
|
+
/* @__PURE__ */ jsx126(PaginationItem, { children: /* @__PURE__ */ jsx126(
|
|
18336
18944
|
PaginationNext,
|
|
18337
18945
|
{
|
|
18338
18946
|
href: "#",
|
|
@@ -18352,14 +18960,14 @@ var EnhancedPagination = React8.forwardRef(
|
|
|
18352
18960
|
EnhancedPagination.displayName = "EnhancedPagination";
|
|
18353
18961
|
|
|
18354
18962
|
// src/components/table/Table.tsx
|
|
18355
|
-
import { jsx as
|
|
18963
|
+
import { jsx as jsx127 } from "react/jsx-runtime";
|
|
18356
18964
|
function Table({ className, ...props }) {
|
|
18357
|
-
return /* @__PURE__ */
|
|
18965
|
+
return /* @__PURE__ */ jsx127(
|
|
18358
18966
|
"div",
|
|
18359
18967
|
{
|
|
18360
18968
|
"data-slot": "table-container",
|
|
18361
18969
|
className: "relative w-full overflow-hidden rounded-md border",
|
|
18362
|
-
children: /* @__PURE__ */
|
|
18970
|
+
children: /* @__PURE__ */ jsx127(
|
|
18363
18971
|
"table",
|
|
18364
18972
|
{
|
|
18365
18973
|
"data-slot": "table",
|
|
@@ -18371,7 +18979,7 @@ function Table({ className, ...props }) {
|
|
|
18371
18979
|
);
|
|
18372
18980
|
}
|
|
18373
18981
|
function TableHeader({ className, ...props }) {
|
|
18374
|
-
return /* @__PURE__ */
|
|
18982
|
+
return /* @__PURE__ */ jsx127(
|
|
18375
18983
|
"thead",
|
|
18376
18984
|
{
|
|
18377
18985
|
"data-slot": "table-header",
|
|
@@ -18381,7 +18989,7 @@ function TableHeader({ className, ...props }) {
|
|
|
18381
18989
|
);
|
|
18382
18990
|
}
|
|
18383
18991
|
function TableBody({ className, ...props }) {
|
|
18384
|
-
return /* @__PURE__ */
|
|
18992
|
+
return /* @__PURE__ */ jsx127(
|
|
18385
18993
|
"tbody",
|
|
18386
18994
|
{
|
|
18387
18995
|
"data-slot": "table-body",
|
|
@@ -18391,7 +18999,7 @@ function TableBody({ className, ...props }) {
|
|
|
18391
18999
|
);
|
|
18392
19000
|
}
|
|
18393
19001
|
function TableFooter({ className, ...props }) {
|
|
18394
|
-
return /* @__PURE__ */
|
|
19002
|
+
return /* @__PURE__ */ jsx127(
|
|
18395
19003
|
"tfoot",
|
|
18396
19004
|
{
|
|
18397
19005
|
"data-slot": "table-footer",
|
|
@@ -18404,7 +19012,7 @@ function TableFooter({ className, ...props }) {
|
|
|
18404
19012
|
);
|
|
18405
19013
|
}
|
|
18406
19014
|
function TableRow({ className, ...props }) {
|
|
18407
|
-
return /* @__PURE__ */
|
|
19015
|
+
return /* @__PURE__ */ jsx127(
|
|
18408
19016
|
"tr",
|
|
18409
19017
|
{
|
|
18410
19018
|
"data-slot": "table-row",
|
|
@@ -18417,7 +19025,7 @@ function TableRow({ className, ...props }) {
|
|
|
18417
19025
|
);
|
|
18418
19026
|
}
|
|
18419
19027
|
function TableHead({ className, ...props }) {
|
|
18420
|
-
return /* @__PURE__ */
|
|
19028
|
+
return /* @__PURE__ */ jsx127(
|
|
18421
19029
|
"th",
|
|
18422
19030
|
{
|
|
18423
19031
|
"data-slot": "table-head",
|
|
@@ -18430,7 +19038,7 @@ function TableHead({ className, ...props }) {
|
|
|
18430
19038
|
);
|
|
18431
19039
|
}
|
|
18432
19040
|
function TableCell({ className, ...props }) {
|
|
18433
|
-
return /* @__PURE__ */
|
|
19041
|
+
return /* @__PURE__ */ jsx127(
|
|
18434
19042
|
"td",
|
|
18435
19043
|
{
|
|
18436
19044
|
"data-slot": "table-cell",
|
|
@@ -18446,7 +19054,7 @@ function TableCaption({
|
|
|
18446
19054
|
className,
|
|
18447
19055
|
...props
|
|
18448
19056
|
}) {
|
|
18449
|
-
return /* @__PURE__ */
|
|
19057
|
+
return /* @__PURE__ */ jsx127(
|
|
18450
19058
|
"caption",
|
|
18451
19059
|
{
|
|
18452
19060
|
"data-slot": "table-caption",
|
|
@@ -18458,9 +19066,9 @@ function TableCaption({
|
|
|
18458
19066
|
|
|
18459
19067
|
// src/components/tabs/Tabs.tsx
|
|
18460
19068
|
import * as TabsPrimitive from "@radix-ui/react-tabs";
|
|
18461
|
-
import { jsx as
|
|
19069
|
+
import { jsx as jsx128 } from "react/jsx-runtime";
|
|
18462
19070
|
function Tabs({ className, ...props }) {
|
|
18463
|
-
return /* @__PURE__ */
|
|
19071
|
+
return /* @__PURE__ */ jsx128(
|
|
18464
19072
|
TabsPrimitive.Root,
|
|
18465
19073
|
{
|
|
18466
19074
|
"data-slot": "tabs",
|
|
@@ -18470,7 +19078,7 @@ function Tabs({ className, ...props }) {
|
|
|
18470
19078
|
);
|
|
18471
19079
|
}
|
|
18472
19080
|
function TabsList({ className, ...props }) {
|
|
18473
|
-
return /* @__PURE__ */
|
|
19081
|
+
return /* @__PURE__ */ jsx128(
|
|
18474
19082
|
TabsPrimitive.List,
|
|
18475
19083
|
{
|
|
18476
19084
|
"data-slot": "tabs-list",
|
|
@@ -18483,7 +19091,7 @@ function TabsList({ className, ...props }) {
|
|
|
18483
19091
|
);
|
|
18484
19092
|
}
|
|
18485
19093
|
function TabsTrigger({ className, ...props }) {
|
|
18486
|
-
return /* @__PURE__ */
|
|
19094
|
+
return /* @__PURE__ */ jsx128(
|
|
18487
19095
|
TabsPrimitive.Trigger,
|
|
18488
19096
|
{
|
|
18489
19097
|
"data-slot": "tabs-trigger",
|
|
@@ -18496,7 +19104,7 @@ function TabsTrigger({ className, ...props }) {
|
|
|
18496
19104
|
);
|
|
18497
19105
|
}
|
|
18498
19106
|
function TabsContent({ className, ...props }) {
|
|
18499
|
-
return /* @__PURE__ */
|
|
19107
|
+
return /* @__PURE__ */ jsx128(
|
|
18500
19108
|
TabsPrimitive.Content,
|
|
18501
19109
|
{
|
|
18502
19110
|
"data-slot": "tabs-content",
|
|
@@ -18507,15 +19115,15 @@ function TabsContent({ className, ...props }) {
|
|
|
18507
19115
|
}
|
|
18508
19116
|
|
|
18509
19117
|
// src/components/top-bar/SearchBar.tsx
|
|
18510
|
-
import { Search as
|
|
18511
|
-
import { forwardRef as
|
|
18512
|
-
import { jsx as
|
|
18513
|
-
var SearchBar =
|
|
19118
|
+
import { Search as Search3 } from "lucide-react";
|
|
19119
|
+
import { forwardRef as forwardRef26 } from "react";
|
|
19120
|
+
import { jsx as jsx129, jsxs as jsxs67 } from "react/jsx-runtime";
|
|
19121
|
+
var SearchBar = forwardRef26(
|
|
18514
19122
|
({ className, context, placeholder = "Search commands...", ...props }, ref) => {
|
|
18515
19123
|
const handleClick = () => {
|
|
18516
19124
|
context.commands.execute("workbench.runCommand");
|
|
18517
19125
|
};
|
|
18518
|
-
return /* @__PURE__ */
|
|
19126
|
+
return /* @__PURE__ */ jsxs67(
|
|
18519
19127
|
"button",
|
|
18520
19128
|
{
|
|
18521
19129
|
ref,
|
|
@@ -18532,9 +19140,9 @@ var SearchBar = forwardRef22(
|
|
|
18532
19140
|
"aria-label": "Open command palette",
|
|
18533
19141
|
...props,
|
|
18534
19142
|
children: [
|
|
18535
|
-
/* @__PURE__ */
|
|
18536
|
-
/* @__PURE__ */
|
|
18537
|
-
/* @__PURE__ */
|
|
19143
|
+
/* @__PURE__ */ jsx129(Search3, { className: "h-4 w-4 text-muted-foreground shrink-0" }),
|
|
19144
|
+
/* @__PURE__ */ jsx129("span", { className: "text-sm text-muted-foreground truncate", children: placeholder }),
|
|
19145
|
+
/* @__PURE__ */ jsx129("div", { className: "ml-auto text-xs text-muted-foreground font-mono", children: "\u2318K" })
|
|
18538
19146
|
]
|
|
18539
19147
|
}
|
|
18540
19148
|
);
|
|
@@ -18543,10 +19151,10 @@ var SearchBar = forwardRef22(
|
|
|
18543
19151
|
SearchBar.displayName = "SearchBar";
|
|
18544
19152
|
|
|
18545
19153
|
// src/components/top-bar/TopBar.tsx
|
|
18546
|
-
import { forwardRef as
|
|
19154
|
+
import { forwardRef as forwardRef27 } from "react";
|
|
18547
19155
|
|
|
18548
19156
|
// src/components/user-avatar/UserAvatar.tsx
|
|
18549
|
-
import { jsx as
|
|
19157
|
+
import { jsx as jsx130 } from "react/jsx-runtime";
|
|
18550
19158
|
function getInitials(name) {
|
|
18551
19159
|
const trimmed = name.trim();
|
|
18552
19160
|
if (!trimmed) {
|
|
@@ -18562,7 +19170,7 @@ function getInitials(name) {
|
|
|
18562
19170
|
}
|
|
18563
19171
|
function UserAvatar({ name, className }) {
|
|
18564
19172
|
const initials = getInitials(name);
|
|
18565
|
-
return /* @__PURE__ */
|
|
19173
|
+
return /* @__PURE__ */ jsx130(
|
|
18566
19174
|
"div",
|
|
18567
19175
|
{
|
|
18568
19176
|
className: cn(
|
|
@@ -18578,11 +19186,11 @@ function UserAvatar({ name, className }) {
|
|
|
18578
19186
|
|
|
18579
19187
|
// src/components/user-avatar/UserMenu.tsx
|
|
18580
19188
|
import { LogOut } from "lucide-react";
|
|
18581
|
-
import { jsx as
|
|
19189
|
+
import { jsx as jsx131, jsxs as jsxs68 } from "react/jsx-runtime";
|
|
18582
19190
|
function UserMenu({ name, email, onSignOut, className }) {
|
|
18583
19191
|
const initials = getInitials(name);
|
|
18584
|
-
return /* @__PURE__ */
|
|
18585
|
-
/* @__PURE__ */
|
|
19192
|
+
return /* @__PURE__ */ jsxs68(DropdownMenu, { children: [
|
|
19193
|
+
/* @__PURE__ */ jsx131(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsx131(
|
|
18586
19194
|
"button",
|
|
18587
19195
|
{
|
|
18588
19196
|
type: "button",
|
|
@@ -18598,21 +19206,21 @@ function UserMenu({ name, email, onSignOut, className }) {
|
|
|
18598
19206
|
children: initials
|
|
18599
19207
|
}
|
|
18600
19208
|
) }),
|
|
18601
|
-
/* @__PURE__ */
|
|
18602
|
-
/* @__PURE__ */
|
|
18603
|
-
/* @__PURE__ */
|
|
18604
|
-
email && /* @__PURE__ */
|
|
19209
|
+
/* @__PURE__ */ jsxs68(DropdownMenuContent, { align: "end", className: "w-56", children: [
|
|
19210
|
+
/* @__PURE__ */ jsx131(DropdownMenuLabel, { className: "font-normal", children: /* @__PURE__ */ jsxs68("div", { className: "flex flex-col space-y-1", children: [
|
|
19211
|
+
/* @__PURE__ */ jsx131("p", { className: "text-sm font-medium leading-none", children: name }),
|
|
19212
|
+
email && /* @__PURE__ */ jsx131("p", { className: "text-xs leading-none text-muted-foreground", children: email })
|
|
18605
19213
|
] }) }),
|
|
18606
|
-
/* @__PURE__ */
|
|
18607
|
-
/* @__PURE__ */
|
|
19214
|
+
/* @__PURE__ */ jsx131(DropdownMenuSeparator, {}),
|
|
19215
|
+
/* @__PURE__ */ jsxs68(
|
|
18608
19216
|
DropdownMenuItem,
|
|
18609
19217
|
{
|
|
18610
19218
|
onClick: onSignOut,
|
|
18611
19219
|
className: "cursor-pointer",
|
|
18612
19220
|
"data-testid": "sign-out-button",
|
|
18613
19221
|
children: [
|
|
18614
|
-
/* @__PURE__ */
|
|
18615
|
-
/* @__PURE__ */
|
|
19222
|
+
/* @__PURE__ */ jsx131(LogOut, { className: "mr-2 h-4 w-4" }),
|
|
19223
|
+
/* @__PURE__ */ jsx131("span", { children: "Sign out" })
|
|
18616
19224
|
]
|
|
18617
19225
|
}
|
|
18618
19226
|
)
|
|
@@ -18621,8 +19229,8 @@ function UserMenu({ name, email, onSignOut, className }) {
|
|
|
18621
19229
|
}
|
|
18622
19230
|
|
|
18623
19231
|
// src/components/top-bar/TopBar.tsx
|
|
18624
|
-
import { jsx as
|
|
18625
|
-
var TopBar =
|
|
19232
|
+
import { jsx as jsx132, jsxs as jsxs69 } from "react/jsx-runtime";
|
|
19233
|
+
var TopBar = forwardRef27(
|
|
18626
19234
|
({ className, context, ...props }, ref) => {
|
|
18627
19235
|
const globalActions = context.config.globalActions || [];
|
|
18628
19236
|
const hasGlobalActions = globalActions.length > 0;
|
|
@@ -18632,7 +19240,7 @@ var TopBar = forwardRef23(
|
|
|
18632
19240
|
const handleSignOut = async () => {
|
|
18633
19241
|
await authentication?.logout();
|
|
18634
19242
|
};
|
|
18635
|
-
return /* @__PURE__ */
|
|
19243
|
+
return /* @__PURE__ */ jsxs69(
|
|
18636
19244
|
"div",
|
|
18637
19245
|
{
|
|
18638
19246
|
ref,
|
|
@@ -18642,7 +19250,7 @@ var TopBar = forwardRef23(
|
|
|
18642
19250
|
),
|
|
18643
19251
|
...props,
|
|
18644
19252
|
children: [
|
|
18645
|
-
/* @__PURE__ */
|
|
19253
|
+
/* @__PURE__ */ jsx132("div", { className: "flex items-center", children: /* @__PURE__ */ jsx132(
|
|
18646
19254
|
"button",
|
|
18647
19255
|
{
|
|
18648
19256
|
type: "button",
|
|
@@ -18656,10 +19264,10 @@ var TopBar = forwardRef23(
|
|
|
18656
19264
|
children: context.config.appName
|
|
18657
19265
|
}
|
|
18658
19266
|
) }),
|
|
18659
|
-
/* @__PURE__ */
|
|
18660
|
-
hasGlobalActions && /* @__PURE__ */
|
|
18661
|
-
/* @__PURE__ */
|
|
18662
|
-
user && /* @__PURE__ */
|
|
19267
|
+
/* @__PURE__ */ jsx132(SearchBar, { context }),
|
|
19268
|
+
hasGlobalActions && /* @__PURE__ */ jsx132("div", { className: "flex items-center", children: /* @__PURE__ */ jsx132(ActionBar, { actions: globalActions }) }),
|
|
19269
|
+
/* @__PURE__ */ jsx132("div", { className: "flex-1" }),
|
|
19270
|
+
user && /* @__PURE__ */ jsx132(
|
|
18663
19271
|
UserMenu,
|
|
18664
19272
|
{
|
|
18665
19273
|
name: user.displayName,
|
|
@@ -18675,20 +19283,20 @@ var TopBar = forwardRef23(
|
|
|
18675
19283
|
TopBar.displayName = "TopBar";
|
|
18676
19284
|
|
|
18677
19285
|
// src/components/widget/Widget.tsx
|
|
18678
|
-
import * as
|
|
18679
|
-
import { jsx as
|
|
18680
|
-
var Widget =
|
|
19286
|
+
import * as React13 from "react";
|
|
19287
|
+
import { jsx as jsx133, jsxs as jsxs70 } from "react/jsx-runtime";
|
|
19288
|
+
var Widget = React13.forwardRef(
|
|
18681
19289
|
({ title, icon: Icon, action, footer, children, className, ...props }, ref) => {
|
|
18682
|
-
return /* @__PURE__ */
|
|
18683
|
-
/* @__PURE__ */
|
|
18684
|
-
/* @__PURE__ */
|
|
18685
|
-
Icon && /* @__PURE__ */
|
|
19290
|
+
return /* @__PURE__ */ jsxs70(Card, { ref, className: cn("pt-0", className), ...props, children: [
|
|
19291
|
+
/* @__PURE__ */ jsxs70("div", { className: "flex items-center gap-2 border-b px-3 py-2.5", children: [
|
|
19292
|
+
/* @__PURE__ */ jsxs70("div", { className: "flex items-center gap-1.5 text-[13px] text-muted-foreground", children: [
|
|
19293
|
+
Icon && /* @__PURE__ */ jsx133(Icon, { className: "h-[0.9rem] w-[0.9rem]" }),
|
|
18686
19294
|
title
|
|
18687
19295
|
] }),
|
|
18688
|
-
action && /* @__PURE__ */
|
|
19296
|
+
action && /* @__PURE__ */ jsx133("div", { className: "ml-auto flex items-center gap-2", children: action })
|
|
18689
19297
|
] }),
|
|
18690
|
-
/* @__PURE__ */
|
|
18691
|
-
footer && /* @__PURE__ */
|
|
19298
|
+
/* @__PURE__ */ jsx133(CardContent, { className: "px-2 pt-4 sm:px-6 sm:pt-6", children }),
|
|
19299
|
+
footer && /* @__PURE__ */ jsx133(CardFooter, { children: footer })
|
|
18692
19300
|
] });
|
|
18693
19301
|
}
|
|
18694
19302
|
);
|
|
@@ -19107,11 +19715,17 @@ export {
|
|
|
19107
19715
|
SchemaFormButtonBar,
|
|
19108
19716
|
SchemaFormValidationErrors,
|
|
19109
19717
|
SearchBar,
|
|
19718
|
+
SearchFilterBadge,
|
|
19719
|
+
SearchFilterBar,
|
|
19720
|
+
SearchFilterCheckIndicator,
|
|
19721
|
+
SearchFilterChevron,
|
|
19722
|
+
SearchFilterDropdown,
|
|
19110
19723
|
SearchTextInput,
|
|
19111
19724
|
SearchableTreeNavigator,
|
|
19112
19725
|
Select,
|
|
19113
19726
|
SelectCellFormatter,
|
|
19114
19727
|
SelectColumn,
|
|
19728
|
+
SelectFilter,
|
|
19115
19729
|
ServerNetworkError,
|
|
19116
19730
|
Table,
|
|
19117
19731
|
TableBody,
|
|
@@ -19125,6 +19739,7 @@ export {
|
|
|
19125
19739
|
TabsContent,
|
|
19126
19740
|
TabsList,
|
|
19127
19741
|
TabsTrigger,
|
|
19742
|
+
TextFilter,
|
|
19128
19743
|
TextInput,
|
|
19129
19744
|
ThemeToggle,
|
|
19130
19745
|
Toast,
|
|
@@ -19182,6 +19797,7 @@ export {
|
|
|
19182
19797
|
lookupSelectVariants,
|
|
19183
19798
|
matchesKeySequence,
|
|
19184
19799
|
normalizeEventKey,
|
|
19800
|
+
optionVariants3 as optionVariants,
|
|
19185
19801
|
orderedListCommand,
|
|
19186
19802
|
parseKeySequence,
|
|
19187
19803
|
parseKeybinding,
|
|
@@ -19197,6 +19813,11 @@ export {
|
|
|
19197
19813
|
resolveMenuItems,
|
|
19198
19814
|
resolveResourceLink,
|
|
19199
19815
|
resourceLink,
|
|
19816
|
+
searchFilterBarClearButtonVariants,
|
|
19817
|
+
searchFilterBarInputVariants,
|
|
19818
|
+
searchFilterBarVariants,
|
|
19819
|
+
searchFilterContentVariants,
|
|
19820
|
+
searchFilterTriggerVariants,
|
|
19200
19821
|
showPromiseToast,
|
|
19201
19822
|
showToast,
|
|
19202
19823
|
strikethroughCommand,
|