{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "notice",
  "title": "Notice",
  "description": "Inline message: a tone cell with a glyph, the message, and action cells; folds away; narrow layout drops actions to their own row.",
  "dependencies": [
    "@base-ui/react@1.9.0",
    "class-variance-authority"
  ],
  "registryDependencies": [
    "@keyline-ui/keyline",
    "@keyline-ui/keyline-render",
    "utils"
  ],
  "files": [
    {
      "path": "src/registry/keyline/ui/notice.tsx",
      "content": "\"use client\";\n\nimport * as React from \"react\";\nimport { mergeProps } from \"@base-ui/react/merge-props\";\nimport { useRender } from \"@base-ui/react/use-render\";\nimport { cva } from \"class-variance-authority\";\n\nimport { cn } from \"@/lib/utils\";\nimport { dataAttrs, resolveClassName, resolveStyle, type PartProps } from \"../lib/keyline-render\";\n\ntype Tone = \"info\" | \"done\" | \"attention\" | \"neutral\";\ntype NoticeLayout = \"control\" | \"cell\";\n\n/*\n * The notice is a size container (kl-notice): at 520px and under its actions drop to their own row of cells, under\n * the message. Every narrow rule is written in full ([@container_kl-notice_(max-width:520px)]:…).\n */\nconst noticeVariants = cva(\n  [\n    \"kl-ctl @container/kl-notice grid min-w-0 grid-cols-[auto_minmax(0,1fr)_auto_auto] items-stretch\",\n    \"bg-kl-cell text-kl-ink\",\n  ],\n  {\n    variants: {\n      tone: { info: \"\", done: \"\", attention: \"border-kl-red\", neutral: \"\" },\n    },\n  },\n);\n\n/* the signal cell: the tone's fill and glyph. A cut frame's first cell keeps its glyph clear of the diagonal. The\n   font shorthand it replaces also reset numerals and style, so they are set back here. */\nconst signalVariants = cva(\n  [\n    \"grid min-h-(--kl-row) w-[calc(40px+var(--kl-c,0px)*0.35)] place-items-center ps-[calc(var(--kl-c,0px)*0.35)]\",\n    \"border-e-(length:--kl-k1) border-e-kl-seam\",\n    \"font-(family-name:--kl-font) text-[16px]/none font-(--kl-weight-display) not-italic normal-nums\",\n    \"forced-colors:bg-[Mark] forced-colors:text-[MarkText] forced-colors:forced-color-adjust-none\",\n  ],\n  {\n    variants: {\n      tone: {\n        info: \"bg-kl-cobalt text-kl-on-cobalt\",\n        done: \"bg-kl-yellow text-kl-on-yellow\",\n        attention: \"bg-kl-red text-kl-on-red\",\n        neutral: \"\",\n      },\n    },\n  },\n);\n\nconst actionsClass = cn(\n  \"kl-cells border-s-(length:--kl-k1) border-s-kl-seam *:min-w-max\",\n  \"[@container_kl-notice_(max-width:520px)]:col-span-full [@container_kl-notice_(max-width:520px)]:row-2\",\n  \"[@container_kl-notice_(max-width:520px)]:border-s-0 [@container_kl-notice_(max-width:520px)]:border-t-(length:--kl-k1)\",\n  \"[@container_kl-notice_(max-width:520px)]:border-t-kl-seam\",\n  \"[@container_kl-notice_(max-width:520px)]:*:min-w-0 [@container_kl-notice_(max-width:520px)]:*:flex-[1_1_0]\",\n);\n\nconst GLYPH: Record<Tone, React.ReactNode> = {\n  info: \"i\",\n  attention: \"!\",\n  neutral: <span className=\"kl-glyph\" data-kind=\"none\" />,\n  done: <span className=\"kl-glyph\" data-kind=\"done\" />,\n};\n\ntype NoticeState = { tone: Tone; layout: NoticeLayout; open: boolean };\n\ntype NoticeProps = Omit<PartProps<\"div\", NoticeState>, \"title\" | \"children\"> & {\n  /** info: cobalt, \"i\" · done: the working-set yellow, ✓ · attention: red, ! · neutral: ink rule, no fill */\n  tone?: Tone;\n  title: React.ReactNode;\n  description?: React.ReactNode;\n  /** Actions: Buttons with layout=\"cell\". They share the notice's keylines and wrap below on narrow widths. */\n  actions?: React.ReactNode;\n  /** control: its own 2px frame. cell: a row of an enclosing frame (top of a panel, above a table). */\n  layout?: NoticeLayout;\n  /** false folds the notice back to its top keyline (and makes it inert); true unfolds it. */\n  open?: boolean;\n  /** Renders a close cell. */\n  onDismiss?: () => void;\n  dismissLabel?: string;\n  /** Announce when it appears. Use for results of something the user just did, not for page furniture. */\n  live?: boolean;\n};\n\n/**\n * An inline message about the place it sits in. One frame: a signal cell carrying the tone's glyph\n * (shape, not only colour), the message, and its actions as cells. It never floats: a toast is a record\n * of something that happened; a notice describes a condition that is still true.\n *\n * The frame (data-slot=\"notice\") takes the props; it sits in a fold (data-slot=\"notice-root\") that `open`\n * unfolds from the top keyline.\n */\nfunction Notice({\n  tone = \"info\",\n  title,\n  description,\n  actions,\n  layout = \"control\",\n  open = true,\n  onDismiss,\n  dismissLabel = \"Dismiss\",\n  live,\n  render,\n  className,\n  style,\n  ...props\n}: NoticeProps): React.ReactElement {\n  const state: NoticeState = { tone, layout, open };\n  const own = {\n    ...dataAttrs({ tone, \"kl-layout\": layout }),\n    \"data-slot\": \"notice\",\n    className: resolveClassName(cn(noticeVariants({ tone })), className)(state),\n    style: resolveStyle(undefined, style)(state),\n    children: (\n      <>\n        <span data-slot=\"notice-signal\" className={cn(signalVariants({ tone }))} aria-hidden>\n          {GLYPH[tone]}\n        </span>\n        <div data-slot=\"notice-content\" className=\"grid min-w-0 content-center gap-0.5 px-(--kl-inset) py-[9px]\">\n          <p\n            data-slot=\"notice-title\"\n            className={cn(\n              \"m-0 leading-[1.3] font-(--kl-weight-strong) wrap-anywhere\",\n              tone === \"attention\" && \"text-kl-red-text\",\n            )}\n          >\n            {title}\n          </p>\n          {description ? (\n            <div\n              data-slot=\"notice-description\"\n              className=\"text-(length:--kl-text-label)/[1.4] wrap-anywhere text-kl-ink-2 [&>:is(p,ul)]:m-0\"\n            >\n              {description}\n            </div>\n          ) : null}\n        </div>\n        {actions ? (\n          <div data-slot=\"notice-actions\" className={actionsClass}>\n            {actions}\n          </div>\n        ) : null}\n        {onDismiss ? (\n          <button\n            type=\"button\"\n            data-slot=\"notice-dismiss\"\n            className=\"kl-cell kl-key w-(--kl-row) justify-center border-s-(length:--kl-k1) border-s-kl-seam p-0\"\n            aria-label={dismissLabel}\n            onClick={onDismiss}\n          >\n            <svg\n              viewBox=\"0 0 16 16\"\n              width=\"14\"\n              height=\"14\"\n              fill=\"none\"\n              stroke=\"currentColor\"\n              strokeWidth=\"1.75\"\n              strokeLinecap=\"square\"\n              aria-hidden\n            >\n              <path d=\"m4 4 8 8M12 4l-8 8\" />\n            </svg>\n          </button>\n        ) : null}\n      </>\n    ),\n  };\n  const frame = useRender({\n    defaultTagName: \"div\",\n    render,\n    state,\n    props: mergeProps<\"div\">({ role: live ? (tone === \"attention\" ? \"alert\" : \"status\") : undefined }, props, own),\n  });\n  return (\n    <div\n      data-slot=\"notice-root\"\n      className=\"kl-unfold min-w-0\"\n      data-open={open ? \"\" : undefined}\n      inert={!open || undefined}\n    >\n      <div>{frame}</div>\n    </div>\n  );\n}\n\nexport { Notice, type NoticeProps, type Tone as NoticeTone };\n",
      "type": "registry:ui",
      "target": "components/keyline/ui/notice.tsx"
    }
  ],
  "type": "registry:ui"
}