@hilum/ui 3.7.0 → 3.7.1
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.js +34 -26
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/searchable-table.tsx +28 -27
- package/src/components/titled-card.tsx +7 -6
package/package.json
CHANGED
|
@@ -246,33 +246,34 @@ function SearchableTable<T extends { id: string | number }>({
|
|
|
246
246
|
|
|
247
247
|
return (
|
|
248
248
|
<div className="space-y-4">
|
|
249
|
-
<div
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
<
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
249
|
+
<div
|
|
250
|
+
data-slot="searchable-table-toolbar"
|
|
251
|
+
className="flex flex-col gap-2.5 md:flex-row md:flex-wrap md:items-center md:justify-start md:gap-3"
|
|
252
|
+
>
|
|
253
|
+
<InputGroup
|
|
254
|
+
placeholder={searchPlaceholder}
|
|
255
|
+
value={searchTerm}
|
|
256
|
+
onChange={(event) => onSearchChange(event.target.value)}
|
|
257
|
+
leadingIcon={<Search className="size-4" />}
|
|
258
|
+
wrapperClassName="w-full min-w-0 md:min-w-[280px] md:max-w-[520px] md:flex-1 md:basis-[340px]"
|
|
259
|
+
className="h-9 bg-background"
|
|
260
|
+
/>
|
|
261
|
+
<div className="flex w-full min-w-0 flex-col gap-2 sm:flex-row sm:flex-wrap md:w-auto md:justify-end">
|
|
262
|
+
{Object.entries(filters).map(([key, filter]) => (
|
|
263
|
+
<Select key={key} value={filter.value} onValueChange={filter.onChange}>
|
|
264
|
+
<SelectTrigger className="h-9 w-full bg-background sm:w-[180px]">
|
|
265
|
+
<Filter className="mr-2 size-4" />
|
|
266
|
+
<SelectValue placeholder={filter.placeholder} />
|
|
267
|
+
</SelectTrigger>
|
|
268
|
+
<SelectContent>
|
|
269
|
+
{filter.options.map((option) => (
|
|
270
|
+
<SelectItem key={option.value} value={option.value}>
|
|
271
|
+
{option.label}
|
|
272
|
+
</SelectItem>
|
|
273
|
+
))}
|
|
274
|
+
</SelectContent>
|
|
275
|
+
</Select>
|
|
276
|
+
))}
|
|
276
277
|
</div>
|
|
277
278
|
</div>
|
|
278
279
|
|
|
@@ -40,6 +40,7 @@ function TitledCard({
|
|
|
40
40
|
titleClassName,
|
|
41
41
|
}: TitledCardProps) {
|
|
42
42
|
const hasHeader = Boolean(title || subtitle || actionButtons);
|
|
43
|
+
const hasContent = Boolean(children);
|
|
43
44
|
const canUseCardHeading = Boolean(title) && !actionButtons && !titleClassName;
|
|
44
45
|
const contentPaddingClassName =
|
|
45
46
|
contentPadding === "flush"
|
|
@@ -54,18 +55,17 @@ function TitledCard({
|
|
|
54
55
|
return (
|
|
55
56
|
<Card
|
|
56
57
|
mobileSurface={mobileSurface}
|
|
57
|
-
className={cn(
|
|
58
|
-
"min-w-0 overflow-hidden border border-border bg-card shadow-natural",
|
|
59
|
-
containerClassName,
|
|
60
|
-
className,
|
|
61
|
-
)}
|
|
58
|
+
className={cn("min-w-0 overflow-hidden", containerClassName, className)}
|
|
62
59
|
data-slot="titled-card"
|
|
63
60
|
>
|
|
64
61
|
{canUseCardHeading ? (
|
|
65
62
|
<CardHeading
|
|
66
63
|
title={title!}
|
|
67
64
|
{...(subtitle ? { description: subtitle } : {})}
|
|
68
|
-
className={cn(
|
|
65
|
+
className={cn(
|
|
66
|
+
!hasContent && "border-b-0",
|
|
67
|
+
isMobileFlat && "max-sm:border-b-0 max-sm:px-0 max-sm:pb-3",
|
|
68
|
+
)}
|
|
69
69
|
>
|
|
70
70
|
{Icon && <Icon className="size-5 shrink-0 text-muted-foreground" />}
|
|
71
71
|
</CardHeading>
|
|
@@ -73,6 +73,7 @@ function TitledCard({
|
|
|
73
73
|
<CardHeader
|
|
74
74
|
className={cn(
|
|
75
75
|
"flex flex-col gap-3 border-b border-border p-4 sm:flex-row sm:items-start sm:justify-between sm:p-5",
|
|
76
|
+
!hasContent && "border-b-0",
|
|
76
77
|
isMobileFlat && "max-sm:border-b-0 max-sm:px-0 max-sm:pb-3",
|
|
77
78
|
)}
|
|
78
79
|
>
|