@hilum/ui 3.6.12 → 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 CHANGED
@@ -3653,6 +3653,11 @@ function CardHeading({ title, description, actions, children, className }) {
3653
3653
  }
3654
3654
  );
3655
3655
  }
3656
+ var cardMobileSurfaceClasses = {
3657
+ default: "",
3658
+ flat: "max-sm:rounded-none max-sm:border-x-0 max-sm:border-y max-sm:bg-transparent max-sm:shadow-none",
3659
+ flush: "max-sm:rounded-none max-sm:border-0 max-sm:bg-transparent max-sm:shadow-none"
3660
+ };
3656
3661
  var cardVariants = cva(["rounded-xl", motionClasses], {
3657
3662
  variants: {
3658
3663
  variant: {
@@ -3669,12 +3674,12 @@ var cardVariants = cva(["rounded-xl", motionClasses], {
3669
3674
  }
3670
3675
  });
3671
3676
  var Card = React17.forwardRef(
3672
- ({ className, variant, ...props }, ref) => /* @__PURE__ */ jsx(
3677
+ ({ className, variant, mobileSurface = "default", ...props }, ref) => /* @__PURE__ */ jsx(
3673
3678
  "div",
3674
3679
  {
3675
3680
  ref,
3676
3681
  "data-slot": "card",
3677
- className: cn(cardVariants({ variant }), className),
3682
+ className: cn(cardVariants({ variant }), cardMobileSurfaceClasses[mobileSurface], className),
3678
3683
  ...props
3679
3684
  }
3680
3685
  )
@@ -3984,7 +3989,8 @@ function ChartContainer({
3984
3989
  "data-slot": "chart",
3985
3990
  "data-chart": chartId,
3986
3991
  className: cn(
3987
- "flex aspect-video justify-center text-xs",
3992
+ "flex justify-center text-xs",
3993
+ height === void 0 ? "aspect-video" : "w-full",
3988
3994
  "[&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground",
3989
3995
  "[&_.recharts-cartesian-grid_line[stroke='#ccc']]:stroke-border/50",
3990
3996
  "[&_.recharts-curve.recharts-tooltip-cursor]:stroke-border",
@@ -7999,7 +8005,8 @@ function ColorInput2({
7999
8005
  onOpacityChange,
8000
8006
  className,
8001
8007
  disabled,
8002
- presets
8008
+ presets,
8009
+ mobileSurface = "default"
8003
8010
  }) {
8004
8011
  const shape3 = useShape();
8005
8012
  const [hex, setHex] = React17.useState(value);
@@ -8010,6 +8017,7 @@ function ColorInput2({
8010
8017
  if (/^#([0-9a-fA-F]{3}){1,2}$/.test(next)) onChange(next);
8011
8018
  else setHex(value);
8012
8019
  };
8020
+ const mobileSurfaceClass = mobileSurface === "flush" ? "max-sm:rounded-none max-sm:border-x-0 max-sm:border-t-0 max-sm:bg-transparent max-sm:px-0 max-sm:shadow-none max-sm:focus-within:ring-0" : "";
8013
8021
  return /* @__PURE__ */ jsxs(
8014
8022
  "div",
8015
8023
  {
@@ -8018,18 +8026,21 @@ function ColorInput2({
8018
8026
  shape3.input,
8019
8027
  "focus-within:border-brand-primary focus-within:ring-2 focus-within:ring-brand-primary/20",
8020
8028
  motionClasses,
8029
+ mobileSurfaceClass,
8021
8030
  disabled && "opacity-50 pointer-events-none",
8022
8031
  className
8023
8032
  ),
8024
8033
  children: [
8025
8034
  /* @__PURE__ */ jsx(
8026
- ColorPicker,
8035
+ ColorPickerPopover,
8027
8036
  {
8028
8037
  value,
8029
8038
  onChange,
8030
8039
  ...presets !== void 0 && { presets },
8031
8040
  ...disabled !== void 0 && { disabled },
8032
- className: "h-full w-8 border-0 rounded-none focus-visible:ring-0"
8041
+ triggerShowValue: false,
8042
+ hideEyedropper: true,
8043
+ triggerClassName: "h-full w-8 border-0 rounded-none bg-transparent px-1 hover:bg-hover focus-visible:ring-0"
8033
8044
  }
8034
8045
  ),
8035
8046
  /* @__PURE__ */ jsx(
@@ -8834,18 +8845,30 @@ function ContextMenuShortcut({ className, ...props }) {
8834
8845
  ContextMenuShortcut.displayName = "ContextMenuShortcut";
8835
8846
  var TableContext = createContext(null);
8836
8847
  var Table = forwardRef(
8837
- ({ children, className, containerClassName, ...props }, ref) => {
8848
+ ({
8849
+ children,
8850
+ className,
8851
+ containerClassName,
8852
+ density = "default",
8853
+ mobileDensity = "default",
8854
+ mobileSurface = "default",
8855
+ ...props
8856
+ }, ref) => {
8838
8857
  const containerRef = useRef(null);
8839
8858
  const { activeIndex, itemRects, sessionRef, handlers, registerItem, measureItems } = useProximityHover(containerRef);
8840
8859
  useEffect(() => {
8841
8860
  measureItems();
8842
8861
  }, [measureItems, children]);
8843
8862
  const activeRect = activeIndex !== null ? itemRects[activeIndex] : null;
8844
- return /* @__PURE__ */ jsx(TableContext.Provider, { value: { registerItem, activeIndex }, children: /* @__PURE__ */ jsxs(
8863
+ return /* @__PURE__ */ jsx(TableContext.Provider, { value: { registerItem, activeIndex, density, mobileDensity }, children: /* @__PURE__ */ jsxs(
8845
8864
  "div",
8846
8865
  {
8847
8866
  ref: containerRef,
8848
- className: cn("relative", containerClassName),
8867
+ className: cn(
8868
+ "relative",
8869
+ mobileSurface === "flat" && "max-sm:-mx-4 max-sm:overflow-x-auto max-sm:rounded-none max-sm:border-x-0",
8870
+ containerClassName
8871
+ ),
8849
8872
  onMouseEnter: handlers.onMouseEnter,
8850
8873
  onMouseMove: handlers.onMouseMove,
8851
8874
  onMouseLeave: handlers.onMouseLeave,
@@ -8880,7 +8903,7 @@ var Table = forwardRef(
8880
8903
  "table",
8881
8904
  {
8882
8905
  ref,
8883
- className: cn("w-full text-[13px] border-collapse", className),
8906
+ className: cn("w-full border-collapse text-[13px]", className),
8884
8907
  ...props,
8885
8908
  children
8886
8909
  }
@@ -8937,21 +8960,40 @@ var TableRow = forwardRef(
8937
8960
  );
8938
8961
  TableRow.displayName = "TableRow";
8939
8962
  var TableHead = forwardRef(
8940
- ({ className, ...props }, ref) => /* @__PURE__ */ jsx("th", { ref, className: cn("px-3 py-2 text-left text-foreground", className), ...props })
8963
+ ({ className, ...props }, ref) => {
8964
+ const ctx = useContext(TableContext);
8965
+ const densityClass = ctx?.density === "compact" ? "px-2 py-1.5" : "px-3 py-2";
8966
+ const mobileDensityClass = ctx?.mobileDensity === "compact" ? "max-sm:px-2 max-sm:py-1.5" : "";
8967
+ return /* @__PURE__ */ jsx(
8968
+ "th",
8969
+ {
8970
+ ref,
8971
+ className: cn(densityClass, mobileDensityClass, "text-left text-foreground", className),
8972
+ ...props
8973
+ }
8974
+ );
8975
+ }
8941
8976
  );
8942
8977
  TableHead.displayName = "TableHead";
8943
8978
  var TableCell = forwardRef(
8944
- ({ className, ...props }, ref) => /* @__PURE__ */ jsx(
8945
- "td",
8946
- {
8947
- ref,
8948
- className: cn(
8949
- "px-3 py-2 text-muted-foreground transition-colors duration-80 group-[.is-active]/row:text-foreground",
8950
- className
8951
- ),
8952
- ...props
8953
- }
8954
- )
8979
+ ({ className, ...props }, ref) => {
8980
+ const ctx = useContext(TableContext);
8981
+ const densityClass = ctx?.density === "compact" ? "px-2 py-1.5" : "px-3 py-2";
8982
+ const mobileDensityClass = ctx?.mobileDensity === "compact" ? "max-sm:px-2 max-sm:py-1.5" : "";
8983
+ return /* @__PURE__ */ jsx(
8984
+ "td",
8985
+ {
8986
+ ref,
8987
+ className: cn(
8988
+ densityClass,
8989
+ mobileDensityClass,
8990
+ "text-muted-foreground transition-colors duration-80 group-[.is-active]/row:text-foreground",
8991
+ className
8992
+ ),
8993
+ ...props
8994
+ }
8995
+ );
8996
+ }
8955
8997
  );
8956
8998
  TableCell.displayName = "TableCell";
8957
8999
  var TableFooter = forwardRef(
@@ -8969,7 +9011,26 @@ var TableCaption = forwardRef(
8969
9011
  )
8970
9012
  );
8971
9013
  TableCaption.displayName = "TableCaption";
8972
- function Input({ className, type, ...props }) {
9014
+ var inputDensityClasses = {
9015
+ default: "h-10 px-3 py-1",
9016
+ compact: "h-8 px-2.5 py-1"
9017
+ };
9018
+ var inputMobileDensityClasses = {
9019
+ default: "",
9020
+ compact: "max-sm:h-8 max-sm:px-2.5 max-sm:py-1"
9021
+ };
9022
+ var controlMobileSurfaceClasses = {
9023
+ default: "",
9024
+ flush: "max-sm:rounded-none max-sm:border-x-0 max-sm:border-t-0 max-sm:bg-transparent max-sm:px-0 max-sm:shadow-none max-sm:focus-visible:ring-0 max-sm:focus-visible:ring-offset-0"
9025
+ };
9026
+ function Input({
9027
+ className,
9028
+ type,
9029
+ density = "default",
9030
+ mobileDensity = "default",
9031
+ mobileSurface = "default",
9032
+ ...props
9033
+ }) {
8973
9034
  const shape3 = useShape();
8974
9035
  return /* @__PURE__ */ jsx(
8975
9036
  "input",
@@ -8977,12 +9038,15 @@ function Input({ className, type, ...props }) {
8977
9038
  type,
8978
9039
  "data-slot": "input",
8979
9040
  className: cn(
8980
- "flex h-10 w-full px-3 py-1",
9041
+ "flex w-full",
9042
+ inputDensityClasses[density],
9043
+ inputMobileDensityClasses[mobileDensity],
8981
9044
  shape3.input,
8982
9045
  "body text-foreground placeholder:text-muted-foreground",
8983
9046
  controlSurfaceClasses,
8984
9047
  motionClasses,
8985
9048
  focusRingClasses,
9049
+ controlMobileSurfaceClasses[mobileSurface],
8986
9050
  "focus-visible:border-brand-primary",
8987
9051
  "disabled:cursor-not-allowed disabled:opacity-50 disabled:bg-muted",
8988
9052
  "file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground",
@@ -9305,8 +9369,31 @@ var triggerVariants = cva(
9305
9369
  }
9306
9370
  }
9307
9371
  );
9372
+ var selectTriggerDensityClasses = {
9373
+ default: "h-9 px-3",
9374
+ compact: "h-8 px-2.5"
9375
+ };
9376
+ var selectTriggerMobileDensityClasses = {
9377
+ default: "",
9378
+ compact: "max-sm:h-8 max-sm:px-2.5"
9379
+ };
9380
+ var selectTriggerMobileSurfaceClasses = {
9381
+ default: "",
9382
+ flush: "max-sm:rounded-none max-sm:border-x-0 max-sm:border-t-0 max-sm:bg-transparent max-sm:px-0 max-sm:shadow-none max-sm:focus-visible:ring-0 max-sm:focus-visible:ring-offset-0"
9383
+ };
9308
9384
  var SelectTrigger = forwardRef(
9309
- ({ className, variant, icon: Icon, placeholder = "Select\u2026", error, children, ...props }, ref) => {
9385
+ ({
9386
+ className,
9387
+ variant,
9388
+ icon: Icon,
9389
+ placeholder = "Select\u2026",
9390
+ error,
9391
+ children,
9392
+ density = "default",
9393
+ mobileDensity = "default",
9394
+ mobileSurface = "default",
9395
+ ...props
9396
+ }, ref) => {
9310
9397
  const { value, open, setOpen, disabled, triggerRef, labelMap } = useSelectContext();
9311
9398
  const shape3 = useShape();
9312
9399
  const label = value ? labelMap.current.get(value) ?? value : void 0;
@@ -9334,6 +9421,9 @@ var SelectTrigger = forwardRef(
9334
9421
  "aria-invalid": !!error || void 0,
9335
9422
  className: cn(
9336
9423
  triggerVariants({ variant }),
9424
+ selectTriggerDensityClasses[density],
9425
+ selectTriggerMobileDensityClasses[mobileDensity],
9426
+ selectTriggerMobileSurfaceClasses[mobileSurface],
9337
9427
  shape3.input,
9338
9428
  error && "border-destructive/50 hover:border-destructive/50",
9339
9429
  className
@@ -13736,26 +13826,33 @@ function SearchableTable({
13736
13826
  ] }) }) });
13737
13827
  };
13738
13828
  return /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
13739
- /* @__PURE__ */ jsx("div", { className: "md:rounded-lg md:border md:border-border md:bg-muted/30 md:p-3", children: /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-2.5 md:flex-row md:flex-wrap md:items-center md:justify-start md:gap-3", children: [
13740
- /* @__PURE__ */ jsx(
13741
- InputGroup,
13742
- {
13743
- placeholder: searchPlaceholder,
13744
- value: searchTerm,
13745
- onChange: (event) => onSearchChange(event.target.value),
13746
- leadingIcon: /* @__PURE__ */ jsx(Search, { className: "size-4" }),
13747
- wrapperClassName: "w-full min-w-0 md:min-w-[280px] md:max-w-[520px] md:flex-1 md:basis-[340px]",
13748
- className: "h-9 bg-background"
13749
- }
13750
- ),
13751
- /* @__PURE__ */ jsx("div", { className: "flex w-full min-w-0 flex-col gap-2 sm:flex-row sm:flex-wrap md:w-auto md:justify-end", children: Object.entries(filters).map(([key, filter]) => /* @__PURE__ */ jsxs(Select, { value: filter.value, onValueChange: filter.onChange, children: [
13752
- /* @__PURE__ */ jsxs(SelectTrigger, { className: "h-9 w-full bg-background sm:w-[180px]", children: [
13753
- /* @__PURE__ */ jsx(Filter, { className: "mr-2 size-4" }),
13754
- /* @__PURE__ */ jsx(SelectValue, { placeholder: filter.placeholder })
13755
- ] }),
13756
- /* @__PURE__ */ jsx(SelectContent, { children: filter.options.map((option) => /* @__PURE__ */ jsx(SelectItem, { value: option.value, children: option.label }, option.value)) })
13757
- ] }, key)) })
13758
- ] }) }),
13829
+ /* @__PURE__ */ jsxs(
13830
+ "div",
13831
+ {
13832
+ "data-slot": "searchable-table-toolbar",
13833
+ className: "flex flex-col gap-2.5 md:flex-row md:flex-wrap md:items-center md:justify-start md:gap-3",
13834
+ children: [
13835
+ /* @__PURE__ */ jsx(
13836
+ InputGroup,
13837
+ {
13838
+ placeholder: searchPlaceholder,
13839
+ value: searchTerm,
13840
+ onChange: (event) => onSearchChange(event.target.value),
13841
+ leadingIcon: /* @__PURE__ */ jsx(Search, { className: "size-4" }),
13842
+ wrapperClassName: "w-full min-w-0 md:min-w-[280px] md:max-w-[520px] md:flex-1 md:basis-[340px]",
13843
+ className: "h-9 bg-background"
13844
+ }
13845
+ ),
13846
+ /* @__PURE__ */ jsx("div", { className: "flex w-full min-w-0 flex-col gap-2 sm:flex-row sm:flex-wrap md:w-auto md:justify-end", children: Object.entries(filters).map(([key, filter]) => /* @__PURE__ */ jsxs(Select, { value: filter.value, onValueChange: filter.onChange, children: [
13847
+ /* @__PURE__ */ jsxs(SelectTrigger, { className: "h-9 w-full bg-background sm:w-[180px]", children: [
13848
+ /* @__PURE__ */ jsx(Filter, { className: "mr-2 size-4" }),
13849
+ /* @__PURE__ */ jsx(SelectValue, { placeholder: filter.placeholder })
13850
+ ] }),
13851
+ /* @__PURE__ */ jsx(SelectContent, { children: filter.options.map((option) => /* @__PURE__ */ jsx(SelectItem, { value: option.value, children: option.label }, option.value)) })
13852
+ ] }, key)) })
13853
+ ]
13854
+ }
13855
+ ),
13759
13856
  /* @__PURE__ */ jsx(StackedList, { bordered: false, className: "rounded-none bg-transparent md:hidden", children: displayData.length === 0 ? renderEmptyState("px-0 py-9") : displayData.map((item) => {
13760
13857
  if (mobileCard) {
13761
13858
  return /* @__PURE__ */ jsx(StackedListItem, { className: "px-0 py-0", children: mobileCard(item) }, item.id);
@@ -14129,13 +14226,16 @@ function SidebarGroupLabel({
14129
14226
  ...props
14130
14227
  }) {
14131
14228
  const Comp = asChild ? Slot$1.Root : "div";
14229
+ const state = useOptionalSidebar()?.state ?? "expanded";
14132
14230
  return /* @__PURE__ */ jsx(
14133
14231
  Comp,
14134
14232
  {
14135
14233
  "data-sidebar": "group-label",
14234
+ "data-state": state,
14136
14235
  className: cn(
14137
14236
  "flex h-8 shrink-0 items-center rounded-md px-2 label text-muted-foreground",
14138
14237
  "outline-none ring-ring transition-[margin,opacity] duration-200 ease-linear",
14238
+ "data-[state=collapsed]:h-0 data-[state=collapsed]:m-0 data-[state=collapsed]:overflow-hidden data-[state=collapsed]:p-0 data-[state=collapsed]:opacity-0",
14139
14239
  "group-data-[state=collapsed]/sidebar-wrapper:opacity-0",
14140
14240
  "group-data-[state=collapsed]/sidebar-wrapper:h-0",
14141
14241
  "group-data-[state=collapsed]/sidebar-wrapper:m-0",
@@ -14193,10 +14293,12 @@ function SidebarMenuButton({
14193
14293
  ...props
14194
14294
  }) {
14195
14295
  const Comp = asChild ? Slot$1.Root : "button";
14296
+ const state = useOptionalSidebar()?.state ?? "expanded";
14196
14297
  const button = /* @__PURE__ */ jsx(
14197
14298
  Comp,
14198
14299
  {
14199
14300
  "data-sidebar": "menu-button",
14301
+ "data-state": state,
14200
14302
  "data-active": isActive,
14201
14303
  "data-size": size,
14202
14304
  className: cn(
@@ -14209,6 +14311,7 @@ function SidebarMenuButton({
14209
14311
  "active:bg-muted",
14210
14312
  "disabled:pointer-events-none disabled:opacity-50",
14211
14313
  "[&>svg]:size-4 [&>svg]:shrink-0",
14314
+ "[&>span]:min-w-0 [&>span]:truncate",
14212
14315
  // Size variants
14213
14316
  size === "sm" && "h-7 text-xs",
14214
14317
  size === "lg" && "h-10",
@@ -14218,9 +14321,12 @@ function SidebarMenuButton({
14218
14321
  "hover:bg-brand-primary/15 hover:text-brand-primary"
14219
14322
  ],
14220
14323
  // Collapsed state
14324
+ "data-[state=collapsed]:size-9 data-[state=collapsed]:justify-center data-[state=collapsed]:p-0",
14325
+ "data-[state=collapsed]:[&>span]:hidden",
14221
14326
  "group-data-[state=collapsed]/sidebar-wrapper:justify-center",
14222
14327
  "group-data-[state=collapsed]/sidebar-wrapper:size-9",
14223
14328
  "group-data-[state=collapsed]/sidebar-wrapper:p-0",
14329
+ "group-data-[state=collapsed]/sidebar-wrapper:[&>span]:hidden",
14224
14330
  className
14225
14331
  ),
14226
14332
  ...props,
@@ -14273,13 +14379,16 @@ function SidebarMenuAction({
14273
14379
  );
14274
14380
  }
14275
14381
  function SidebarMenuBadge({ className, ...props }) {
14382
+ const state = useOptionalSidebar()?.state ?? "expanded";
14276
14383
  return /* @__PURE__ */ jsx(
14277
14384
  "div",
14278
14385
  {
14279
14386
  "data-sidebar": "menu-badge",
14387
+ "data-state": state,
14280
14388
  className: cn(
14281
14389
  "absolute right-1 flex h-5 min-w-5 items-center justify-center rounded-full",
14282
14390
  "caption font-medium bg-muted text-muted-foreground px-1",
14391
+ "data-[state=collapsed]:hidden",
14283
14392
  "group-data-[state=collapsed]/sidebar-wrapper:hidden",
14284
14393
  className
14285
14394
  ),
@@ -14315,12 +14424,15 @@ function SidebarMenuSkeleton({
14315
14424
  );
14316
14425
  }
14317
14426
  function SidebarMenuSub({ className, ...props }) {
14427
+ const state = useOptionalSidebar()?.state ?? "expanded";
14318
14428
  return /* @__PURE__ */ jsx(
14319
14429
  "ul",
14320
14430
  {
14321
14431
  "data-sidebar": "menu-sub",
14432
+ "data-state": state,
14322
14433
  className: cn(
14323
14434
  "mx-3.5 flex min-w-0 flex-col gap-1 border-l border-border pl-3",
14435
+ "data-[state=collapsed]:hidden",
14324
14436
  "group-data-[state=collapsed]/sidebar-wrapper:hidden",
14325
14437
  className
14326
14438
  ),
@@ -15668,20 +15780,41 @@ var TabsSubtlePanel = forwardRef(
15668
15780
  }
15669
15781
  );
15670
15782
  TabsSubtlePanel.displayName = "TabsSubtlePanel";
15671
- function Textarea({ className, ...props }) {
15783
+ var textareaDensityClasses = {
15784
+ default: "min-h-[80px] px-3 py-2",
15785
+ compact: "min-h-16 px-2.5 py-1.5"
15786
+ };
15787
+ var textareaMobileDensityClasses = {
15788
+ default: "",
15789
+ compact: "max-sm:min-h-16 max-sm:px-2.5 max-sm:py-1.5"
15790
+ };
15791
+ var textareaMobileSurfaceClasses = {
15792
+ default: "",
15793
+ flush: "max-sm:rounded-none max-sm:border-x-0 max-sm:border-t-0 max-sm:bg-transparent max-sm:px-0 max-sm:shadow-none max-sm:focus-visible:ring-0 max-sm:focus-visible:ring-offset-0"
15794
+ };
15795
+ function Textarea({
15796
+ className,
15797
+ density = "default",
15798
+ mobileDensity = "default",
15799
+ mobileSurface = "default",
15800
+ ...props
15801
+ }) {
15672
15802
  const shape3 = useShape();
15673
15803
  return /* @__PURE__ */ jsx(
15674
15804
  "textarea",
15675
15805
  {
15676
15806
  "data-slot": "textarea",
15677
15807
  className: cn(
15678
- "flex min-h-[80px] w-full px-3 py-2",
15808
+ "flex w-full",
15809
+ textareaDensityClasses[density],
15810
+ textareaMobileDensityClasses[mobileDensity],
15679
15811
  shape3.input,
15680
15812
  "body text-foreground placeholder:text-muted-foreground",
15681
15813
  "resize-none",
15682
15814
  controlSurfaceClasses,
15683
15815
  motionClasses,
15684
15816
  focusRingClasses,
15817
+ textareaMobileSurfaceClasses[mobileSurface],
15685
15818
  "focus-visible:border-brand-primary",
15686
15819
  "disabled:cursor-not-allowed disabled:opacity-50 disabled:bg-muted",
15687
15820
  className
@@ -15994,23 +16127,22 @@ function TitledCard({
15994
16127
  actionButtons,
15995
16128
  icon: Icon,
15996
16129
  contentPadding = "default",
16130
+ mobileSurface = "flush",
15997
16131
  className,
15998
16132
  contentClassName,
15999
16133
  containerClassName,
16000
16134
  titleClassName
16001
16135
  }) {
16002
16136
  const hasHeader = Boolean(title || subtitle || actionButtons);
16137
+ const hasContent = Boolean(children);
16003
16138
  const canUseCardHeading = Boolean(title) && !actionButtons && !titleClassName;
16004
16139
  const contentPaddingClassName = contentPadding === "flush" ? "p-0" : contentPadding === "flush-mobile" ? "p-0 sm:p-5" : hasHeader ? "p-4 sm:p-5" : "p-0 sm:p-5";
16140
+ const isMobileFlat = mobileSurface === "flat" || mobileSurface === "flush";
16005
16141
  return /* @__PURE__ */ jsxs(
16006
16142
  Card,
16007
16143
  {
16008
- className: cn(
16009
- "min-w-0 overflow-hidden border border-border bg-card shadow-natural",
16010
- "max-sm:rounded-none max-sm:border-0 max-sm:bg-transparent max-sm:shadow-none",
16011
- containerClassName,
16012
- className
16013
- ),
16144
+ mobileSurface,
16145
+ className: cn("min-w-0 overflow-hidden", containerClassName, className),
16014
16146
  "data-slot": "titled-card",
16015
16147
  children: [
16016
16148
  canUseCardHeading ? /* @__PURE__ */ jsx(
@@ -16018,32 +16150,50 @@ function TitledCard({
16018
16150
  {
16019
16151
  title,
16020
16152
  ...subtitle ? { description: subtitle } : {},
16021
- className: "max-sm:border-b-0 max-sm:px-0 max-sm:pb-3",
16153
+ className: cn(
16154
+ !hasContent && "border-b-0",
16155
+ isMobileFlat && "max-sm:border-b-0 max-sm:px-0 max-sm:pb-3"
16156
+ ),
16022
16157
  children: Icon && /* @__PURE__ */ jsx(Icon, { className: "size-5 shrink-0 text-muted-foreground" })
16023
16158
  }
16024
- ) : hasHeader ? /* @__PURE__ */ jsxs(CardHeader, { className: "flex flex-col gap-3 border-b border-border p-4 max-sm:border-b-0 max-sm:px-0 max-sm:pb-3 sm:flex-row sm:items-start sm:justify-between sm:p-5", children: [
16025
- /* @__PURE__ */ jsxs("div", { className: "min-w-0 flex-1", children: [
16026
- title && /* @__PURE__ */ jsxs(
16027
- CardTitle,
16028
- {
16029
- className: cn(
16030
- "flex min-w-0 items-center gap-2 text-base leading-tight sm:text-lg",
16031
- titleClassName
16032
- ),
16033
- children: [
16034
- Icon && /* @__PURE__ */ jsx(Icon, { className: "size-5 shrink-0 text-muted-foreground" }),
16035
- /* @__PURE__ */ jsx("span", { className: "min-w-0 truncate", children: title })
16036
- ]
16037
- }
16159
+ ) : hasHeader ? /* @__PURE__ */ jsxs(
16160
+ CardHeader,
16161
+ {
16162
+ className: cn(
16163
+ "flex flex-col gap-3 border-b border-border p-4 sm:flex-row sm:items-start sm:justify-between sm:p-5",
16164
+ !hasContent && "border-b-0",
16165
+ isMobileFlat && "max-sm:border-b-0 max-sm:px-0 max-sm:pb-3"
16038
16166
  ),
16039
- subtitle && /* @__PURE__ */ jsx(CardDescription, { className: "mt-1 max-w-3xl text-sm leading-5", children: subtitle })
16040
- ] }),
16041
- actionButtons && /* @__PURE__ */ jsx("div", { className: "flex w-full min-w-0 flex-wrap items-center gap-2 sm:w-auto sm:justify-end", children: actionButtons })
16042
- ] }) : null,
16167
+ children: [
16168
+ /* @__PURE__ */ jsxs("div", { className: "min-w-0 flex-1", children: [
16169
+ title && /* @__PURE__ */ jsxs(
16170
+ CardTitle,
16171
+ {
16172
+ className: cn(
16173
+ "flex min-w-0 items-center gap-2 text-base leading-tight sm:text-lg",
16174
+ titleClassName
16175
+ ),
16176
+ children: [
16177
+ Icon && /* @__PURE__ */ jsx(Icon, { className: "size-5 shrink-0 text-muted-foreground" }),
16178
+ /* @__PURE__ */ jsx("span", { className: "min-w-0 truncate", children: title })
16179
+ ]
16180
+ }
16181
+ ),
16182
+ subtitle && /* @__PURE__ */ jsx(CardDescription, { className: "mt-1 max-w-3xl text-sm leading-5", children: subtitle })
16183
+ ] }),
16184
+ actionButtons && /* @__PURE__ */ jsx("div", { className: "flex w-full min-w-0 flex-wrap items-center gap-2 sm:w-auto sm:justify-end", children: actionButtons })
16185
+ ]
16186
+ }
16187
+ ) : null,
16043
16188
  children && /* @__PURE__ */ jsx(
16044
16189
  CardContent,
16045
16190
  {
16046
- className: cn(contentPaddingClassName, "min-w-0 max-sm:px-0", contentClassName),
16191
+ className: cn(
16192
+ contentPaddingClassName,
16193
+ "min-w-0",
16194
+ isMobileFlat && "max-sm:px-0",
16195
+ contentClassName
16196
+ ),
16047
16197
  children
16048
16198
  }
16049
16199
  )