// @ts-nocheck import { createSignal } from "solid-js" import * as mod from "./line-comment" const docs = `### Overview Inline comment anchor and editor for code review or annotation flows. Pair with \`Diff\` or \`Code\` to align comments to lines. ### API - \`LineCommentAnchor\`: position with \`top\`, control \`open\`, render custom children. - \`LineComment\`: convenience wrapper for displaying comment + selection label. - \`LineCommentEditor\`: controlled textarea with submit/cancel handlers. ### Variants and states - Default display and editor display variants. ### Behavior - Anchor positions relative to a containing element. - Editor submits on Enter (Shift+Enter for newline). ### Accessibility - TODO: confirm ARIA labeling for comment button and editor textarea. ### Theming/tokens - Uses \`data-component="line-comment"\` and related slots. ` export default { title: "UI/LineComment", id: "components-line-comment", component: mod.LineComment, tags: ["autodocs"], parameters: { docs: { description: { component: docs, }, }, }, } export const Default = { render: () => (
12 | const total = sum(values)
13 | return total / values.length
), } export const Editor = { render: () => { const [value, setValue] = createSignal("Add context for this change.") return (
40 | if (values.length === 0) return 0
setValue("")} onSubmit={(next) => setValue(next)} />
) }, } export const AnchorOnly = { render: () => (
20 | const ready = true
Anchor content
), }