"use client";
import {
  cn,
  init_cn
} from "./chunk-XTCBRQN2.js";

// src/components/ui/status-badge.tsx
init_cn();
import { cva } from "class-variance-authority";
import { jsx } from "react/jsx-runtime";
var statusBadgeVariants = cva(
  "inline-flex items-center justify-center rounded font-mono font-medium uppercase tracking-wide",
  {
    variants: {
      variant: {
        card: "px-3 py-1.5 text-sm",
        button: "px-2 py-0.5 text-[10px] leading-none"
      },
      colorScheme: {
        cyan: "bg-[var(--ods-flamingo-cyan-base)] text-ods-text-on-accent",
        pink: "bg-[var(--ods-flamingo-pink-base)] text-ods-text-on-accent",
        yellow: "bg-[var(--ods-flamingo-yellow-base)] text-ods-text-on-accent border border-[var(--ods-system-greys-black)]",
        green: "bg-[var(--ods-flamingo-green-base)] text-ods-text-on-accent",
        purple: "bg-[var(--ods-flamingo-purple-base)] text-ods-text-on-accent",
        success: "bg-[var(--ods-attention-green-success-secondary)] text-[var(--ods-attention-green-success)]",
        error: "bg-[var(--ods-attention-red-error-secondary)] text-[var(--ods-attention-red-error)]",
        warning: "bg-[var(--ods-attention-yellow-warning-secondary)] text-[var(--ods-attention-yellow-warning)]",
        default: "bg-ods-bg-secondary text-ods-text-primary",
        // Border-only variants (no background) - for task type badges
        accentBorder: "bg-transparent border-2 text-ods-accent border-ods-accent",
        errorBorder: "bg-transparent border-2 text-[var(--ods-attention-red-error)] border-[var(--ods-attention-red-error)]",
        whiteBorder: "bg-transparent border-2 text-ods-text-primary border-ods-text-primary"
      }
    },
    defaultVariants: {
      variant: "card",
      colorScheme: "default"
    }
  }
);
function StatusBadge({
  text,
  variant,
  colorScheme,
  className,
  singleLine,
  ...props
}) {
  const renderText = () => {
    if (singleLine) return text;
    if (variant === "button" && text.includes(" ")) {
      const words = text.split(" ");
      return /* @__PURE__ */ jsx("span", { className: "flex flex-col items-center justify-center text-center gap-0", children: words.map((word, index) => /* @__PURE__ */ jsx("span", { className: "block", children: word }, index)) });
    }
    return text;
  };
  return /* @__PURE__ */ jsx(
    "span",
    {
      className: cn(statusBadgeVariants({ variant, colorScheme }), className),
      ...props,
      children: renderText()
    }
  );
}

// src/components/layout/page-heading.tsx
import { Fragment, jsx as jsx2, jsxs } from "react/jsx-runtime";
var PAGE_HEADING_CLASS = "text-h1 text-ods-text-primary";
var SECTION_HEADING_CLASS = "text-h2 text-ods-text-primary";
var DESCRIPTION_CLASS = "mt-6 max-w-[640px] font-['DM_Sans'] text-[16px] md:text-[18px] leading-[24px] md:leading-[28px] text-ods-text-secondary";
function PageHeading({
  children,
  as: Tag = "h1",
  description,
  className,
  descriptionClassName
}) {
  const headingClass = className ? `${PAGE_HEADING_CLASS} ${className}` : PAGE_HEADING_CLASS;
  const descClass = descriptionClassName ? `${DESCRIPTION_CLASS} ${descriptionClassName}` : DESCRIPTION_CLASS;
  const hasDescription = description != null && description !== "" && typeof description !== "boolean";
  return /* @__PURE__ */ jsxs(Fragment, { children: [
    /* @__PURE__ */ jsx2(Tag, { className: headingClass, children }),
    hasDescription && /* @__PURE__ */ jsx2("p", { className: descClass, children: description })
  ] });
}

// src/components/features/entity-tag-badges.tsx
import Link from "next/link";
import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
var TAG_BADGE_CLASS = "bg-ods-card border border-ods-border";
var BADGE_CLASS = TAG_BADGE_CLASS;
function EntityTagBadges({ tags, basePath, max, className }) {
  const items = (tags || []).filter((t) => !!t && !!t.name);
  if (items.length === 0) return null;
  const visibleLimit = max == null ? items.length : Math.max(0, max);
  const shown = items.slice(0, visibleLimit);
  const overflow = items.length - shown.length;
  return /* @__PURE__ */ jsxs2("div", { className: `flex flex-wrap items-center gap-2 w-full ${className || ""}`, children: [
    shown.map((tag) => {
      const key = tag.tag_id ?? tag.id ?? tag.slug ?? tag.name;
      const label = (tag.name || "").toUpperCase();
      if (basePath && tag.slug) {
        return /* @__PURE__ */ jsx3(Link, { href: `${basePath}?tags=${tag.slug}`, className: "inline-flex", children: /* @__PURE__ */ jsx3(
          StatusBadge,
          {
            text: label,
            variant: "card",
            className: `${BADGE_CLASS} cursor-pointer transition-colors hover:border-ods-accent`
          }
        ) }, key);
      }
      return /* @__PURE__ */ jsx3(StatusBadge, { text: label, variant: "card", className: BADGE_CLASS }, key);
    }),
    overflow > 0 && /* @__PURE__ */ jsx3(StatusBadge, { text: `+${overflow}`, variant: "card", className: `${BADGE_CLASS} text-ods-text-secondary` })
  ] });
}

export {
  statusBadgeVariants,
  StatusBadge,
  PAGE_HEADING_CLASS,
  SECTION_HEADING_CLASS,
  PageHeading,
  TAG_BADGE_CLASS,
  EntityTagBadges
};
//# sourceMappingURL=chunk-FREG2KXV.js.map