@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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hilum/ui",
3
- "version": "3.7.0",
3
+ "version": "3.7.1",
4
4
  "private": false,
5
5
  "description": "Hilum UI — design system primitives (Button, Input, Dialog, Combobox, …) + tokens + fonts + icons",
6
6
  "license": "MIT",
@@ -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 className="md:rounded-lg md:border md:border-border md:bg-muted/30 md:p-3">
250
- <div className="flex flex-col gap-2.5 md:flex-row md:flex-wrap md:items-center md:justify-start md:gap-3">
251
- <InputGroup
252
- placeholder={searchPlaceholder}
253
- value={searchTerm}
254
- onChange={(event) => onSearchChange(event.target.value)}
255
- leadingIcon={<Search className="size-4" />}
256
- wrapperClassName="w-full min-w-0 md:min-w-[280px] md:max-w-[520px] md:flex-1 md:basis-[340px]"
257
- className="h-9 bg-background"
258
- />
259
- <div className="flex w-full min-w-0 flex-col gap-2 sm:flex-row sm:flex-wrap md:w-auto md:justify-end">
260
- {Object.entries(filters).map(([key, filter]) => (
261
- <Select key={key} value={filter.value} onValueChange={filter.onChange}>
262
- <SelectTrigger className="h-9 w-full bg-background sm:w-[180px]">
263
- <Filter className="mr-2 size-4" />
264
- <SelectValue placeholder={filter.placeholder} />
265
- </SelectTrigger>
266
- <SelectContent>
267
- {filter.options.map((option) => (
268
- <SelectItem key={option.value} value={option.value}>
269
- {option.label}
270
- </SelectItem>
271
- ))}
272
- </SelectContent>
273
- </Select>
274
- ))}
275
- </div>
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(isMobileFlat && "max-sm:border-b-0 max-sm:px-0 max-sm:pb-3")}
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
  >