@mesob/ui 0.5.6 → 0.5.7

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.
@@ -3040,17 +3040,15 @@ function Card({
3040
3040
  xl: "rounded-[var(--radius-xl)]",
3041
3041
  full: "rounded-full"
3042
3042
  };
3043
- const hasBelowHeader = footer != null || children != null;
3044
- const hasBodyAboveFooter = children != null;
3045
- const sectioned = header != null || footer != null || title != null || actions != null;
3043
+ const hasStructure = header != null || footer != null || title != null || actions != null;
3046
3044
  return /* @__PURE__ */ jsxs15(
3047
3045
  "div",
3048
3046
  {
3049
3047
  "data-slot": "card",
3050
- "data-sectioned": sectioned ? "" : void 0,
3048
+ "data-sectioned": hasStructure ? "" : void 0,
3051
3049
  "data-size": size,
3052
3050
  className: cn(
3053
- "cn-card group/card flex flex-col",
3051
+ "cn-card group/card",
3054
3052
  variant === "outline" && "cn-card-variant-outline",
3055
3053
  variant === "filled" && "cn-card-variant-filled",
3056
3054
  withBorder && "cn-card-with-border",
@@ -3060,15 +3058,9 @@ function Card({
3060
3058
  ),
3061
3059
  ...props,
3062
3060
  children: [
3063
- cardHeaderFromProps(hasBelowHeader, header, title, actions),
3064
- bodySlot(children, sectioned, padding !== void 0),
3065
- footer != null ? /* @__PURE__ */ jsx22(
3066
- CardFooter,
3067
- {
3068
- className: cn(hasBodyAboveFooter && "border-border/60 border-t"),
3069
- children: footer
3070
- }
3071
- ) : null
3061
+ cardHeaderFromProps(header, title, actions),
3062
+ bodySlot(children, hasStructure),
3063
+ footer != null ? /* @__PURE__ */ jsx22(CardFooter, { children: footer }) : null
3072
3064
  ]
3073
3065
  }
3074
3066
  );
@@ -3080,26 +3072,18 @@ function isSingleCardContent(children) {
3080
3072
  const only = Children.only(children);
3081
3073
  return isValidElement2(only) && only.props["data-slot"] === "card-content";
3082
3074
  }
3083
- function bodySlot(children, sectioned, hasRootPadding) {
3084
- if (children == null) {
3085
- return children;
3086
- }
3087
- if (isSingleCardContent(children)) {
3088
- return children;
3089
- }
3090
- const wrapBody = sectioned || !hasRootPadding;
3091
- if (!wrapBody) {
3075
+ function bodySlot(children, hasStructure) {
3076
+ if (children == null || !hasStructure || isSingleCardContent(children)) {
3092
3077
  return children;
3093
3078
  }
3094
3079
  return /* @__PURE__ */ jsx22(CardContent, { children });
3095
3080
  }
3096
- function cardHeaderFromProps(hasBelowHeader, header, title, actions) {
3097
- const divider = hasBelowHeader && "border-border/60 border-b";
3081
+ function cardHeaderFromProps(header, title, actions) {
3098
3082
  if (header != null) {
3099
- return /* @__PURE__ */ jsx22(CardHeader, { className: cn(divider), children: header });
3083
+ return /* @__PURE__ */ jsx22(CardHeader, { children: header });
3100
3084
  }
3101
3085
  if (title != null || actions != null) {
3102
- return /* @__PURE__ */ jsxs15(CardHeader, { className: cn(divider, "items-center"), children: [
3086
+ return /* @__PURE__ */ jsxs15(CardHeader, { className: "items-center", children: [
3103
3087
  title != null ? /* @__PURE__ */ jsx22(CardTitle, { children: title }) : null,
3104
3088
  actions != null ? /* @__PURE__ */ jsx22(CardAction, { children: actions }) : null
3105
3089
  ] });
@@ -3112,7 +3096,7 @@ function CardHeader({ className, ...props }) {
3112
3096
  {
3113
3097
  "data-slot": "card-header",
3114
3098
  className: cn(
3115
- "cn-card-header group/card-header @container/card-header grid auto-rows-min has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] has-data-[slot=card-description]:[&>[data-slot=card-action]]:row-span-2",
3099
+ "cn-card-header group/card-header @container/card-header grid auto-rows-min has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] has-data-[slot=card-description]:[&>[data-slot=card-action]]:row-span-2 [&:not(:last-child)]:border-border/60 [&:not(:last-child)]:border-b",
3116
3100
  className
3117
3101
  ),
3118
3102
  ...props
@@ -3167,7 +3151,10 @@ function CardFooter({ className, ...props }) {
3167
3151
  "div",
3168
3152
  {
3169
3153
  "data-slot": "card-footer",
3170
- className: cn("cn-card-footer flex items-center", className),
3154
+ className: cn(
3155
+ "cn-card-footer flex items-center [&:not(:first-child)]:border-border/60 [&:not(:first-child)]:border-t",
3156
+ className
3157
+ ),
3171
3158
  ...props
3172
3159
  }
3173
3160
  );