@nucleux/md3-structured-input 0.0.0-stage → 0.6.0
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/LICENSE +21 -0
- package/README.md +42 -2
- package/dist/index.cjs +562 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +49 -0
- package/dist/index.d.ts +49 -0
- package/dist/index.js +534 -0
- package/dist/index.js.map +1 -0
- package/package.json +65 -3
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/index.tsx"],"names":["cn","React","jsxs","Md3Card","jsx","Check","Md3Button","Sparkles","UserPen","structuredPartsToText","X","Md3Chip"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgCA,IAAM,UAAA,GACJ,8MAAA;AAGF,IAAM,UAAA,GAAaA,QAAA;AAAA,EACjB,+HAAA;AAAA,EACA,mEAAA;AAAA,EACA,6EAAA;AAAA,EACA;AACF,CAAA;AAWO,IAAM,kBAAA,GAA2BC,gBAAA,CAAA,UAAA;AAAA,EACtC,CACE;AAAA,IACE,QAAA;AAAA,IACA,OAAA;AAAA,IACA,QAAA,GAAW,KAAA;AAAA,IACX,KAAA;AAAA,IACA,eAAe,EAAC;AAAA,IAChB,aAAA;AAAA,IACA,UAAA,GAAa,KAAA;AAAA,IACb,gBAAA,GAAmB,sBAAA;AAAA,IACnB,QAAA;AAAA,IACA,MAAA;AAAA,IACA,WAAA,GAAc,UAAA;AAAA,IACd,SAAA,GAAY,MAAA;AAAA,IACZ,SAAA;AAAA,IACA,GAAG;AAAA,KAEL,GAAA,KACG;AACH,IAAA,MAAM,CAAC,QAAA,EAAU,WAAW,CAAA,GAAUA,0BAAmB,YAAY,CAAA;AACrE,IAAA,MAAM,CAAC,KAAA,EAAO,QAAQ,CAAA,GAAUA,0BAAS,EAAE,CAAA;AAC3C,IAAA,MAAM,aAAmBA,gBAAA,CAAA,KAAA,EAAM;AAC/B,IAAA,MAAM,QAA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AAA;AAAA,kBAAE,MAAA;AAAA,kBAAK,KAAA,CAAM,MAAA;AAAA,kBAAO,QAAA;AAAA,kBAAI,MAAM,IAAI;AAAA;AAAA;AAAA,aACjD;AAAA,YACC,WAAA,oBAAeE,cAAA,CAAC,GAAA,EAAA,EAAE,SAAA,EAAU,sCAAsC,QAAA,EAAA,WAAA,EAAY;AAAA,WAAA,EACjF,CAAA;AAAA,UACC,QAAA;AAAA,0BACDF,eAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAU,yBAAA,EACZ,QAAA,EAAA;AAAA,YAAA,IAAA,GAAO,CAAA,oBACNE,cAAA,CAACE,mBAAA,EAAA,EAAU,OAAA,EAAQ,MAAA,EAAO,OAAA,EAAS,MAAM,EAAA,CAAG,IAAA,GAAO,CAAC,CAAA,EAAG,QAAA,EAAA,MAAA,EAEvD,CAAA;AAAA,4BAEFF,cAAA,CAAC,MAAA,EAAA,EAAK,SAAA,EAAU,QAAA,EAAS,CAAA;AAAA,YACxB,CAAC,QAAQ,gBAAA,IAAoB,QAAA,oCAC3BE,mBAAA,EAAA,EAAU,OAAA,EAAQ,MAAA,EAAO,OAAA,EAAS,QAAA,EAChC,QAAA,EAAA;AAAA,cAAA,WAAA;AAAA,cAAY;AAAA,aAAA,EACf,CAAA;AAAA,YAED,IAAA,GACC,4BACEF,cAAA,CAACE,mBAAA,EAAA,EAAU,SAAQ,QAAA,EAAS,OAAA,EAAS,UAClC,QAAA,EAAA,WAAA,EACH,CAAA,kCAGDA,mBAAA,EAAA,EAAU,OAAA,EAAQ,UAAS,OAAA,EAAS,MAAM,GAAG,IAAA,GAAO,CAAC,GAAG,QAAA,EAAA,MAAA,EAEzD;AAAA,WAAA,EAEJ;AAAA;AAAA;AAAA,KACF;AAAA,EAEJ;AACF;AACA,wBAAA,CAAyB,WAAA,GAAc,0BAAA","file":"index.cjs","sourcesContent":["import * as React from \"react\";\nimport { cn } from \"@nucleux/utils\";\nimport { Md3Button } from \"@nucleux/md3-button\";\nimport { Md3Card } from \"@nucleux/md3-card\";\nimport { Md3Chip } from \"@nucleux/md3-chip\";\nimport {\n structuredPartsToText,\n type StructuredInputPart,\n type StructuredInputProps,\n type StructuredInputSlotsProps,\n type StructuredInputTagsProps,\n type StructuredInputTagTrigger,\n type StructuredInputValues,\n type StructuredInputWizardProps,\n} from \"@nucleux/structured-input\";\nimport { Check, Sparkles, UserPen, X } from \"lucide-react\";\n\n// Same API as the shadcn twin: the props and data shapes are the twin's own types.\nexport type Md3StructuredInputProps = StructuredInputProps;\nexport type Md3StructuredInputSlotsProps = StructuredInputSlotsProps;\nexport type Md3StructuredInputTagsProps = StructuredInputTagsProps;\nexport type Md3StructuredInputWizardProps = StructuredInputWizardProps;\nexport type {\n StructuredOption,\n StructuredInputSlot,\n StructuredInputValues,\n StructuredInputTagTrigger,\n StructuredInputPart,\n} from \"@nucleux/structured-input\";\n/** Serialise parts into the plain prompt text — shared with `@nucleux/structured-input`. */\nexport { structuredPartsToText };\n\nconst stateLayer =\n \"before:absolute before:inset-0 before:bg-current before:opacity-0 before:transition-opacity before:content-[''] hover:before:opacity-[0.08] focus-visible:before:opacity-[0.12] active:before:opacity-[0.12]\";\n\n/** MD3 outlined field chrome, shared by text inputs, selects and textareas. */\nconst fieldClass = cn(\n \"w-full rounded-md-xs border border-md-outline bg-transparent px-4 text-base text-md-on-surface outline-none transition-colors\",\n \"placeholder:text-md-on-surface-variant hover:border-md-on-surface\",\n \"focus:border-md-primary focus:ring-1 focus:ring-inset focus:ring-md-primary\",\n \"disabled:cursor-not-allowed disabled:opacity-[0.38]\",\n);\n\n/**\n * Material 3 structured input: an agent-generated clarifying question as a\n * compact MD3 card — single or multi-select options drawn as MD3 radio and\n * checkbox rows with a state layer, a free-text escape, and a skip. Arrow keys\n * move and select in single mode, exactly as in the twin. The other variants\n * are composable siblings: {@link Md3StructuredInputSlots},\n * {@link Md3StructuredInputTags} and {@link Md3StructuredInputWizard}. Shares\n * its API with `StructuredInput` from `@nucleux/structured-input`.\n */\nexport const Md3StructuredInput = React.forwardRef<HTMLDivElement, Md3StructuredInputProps>(\n (\n {\n question,\n options,\n multiple = false,\n value,\n defaultValue = [],\n onValueChange,\n allowOther = false,\n otherPlaceholder = \"Something else…\",\n onSubmit,\n onSkip,\n submitLabel = \"Continue\",\n skipLabel = \"Skip\",\n className,\n ...props\n },\n ref,\n ) => {\n const [internal, setInternal] = React.useState<string[]>(defaultValue);\n const [other, setOther] = React.useState(\"\");\n const questionId = React.useId();\n const groupRef = React.useRef<HTMLDivElement>(null);\n const selected = value !== undefined ? value : internal;\n\n const setSelected = (next: string[]) => {\n if (value === undefined) setInternal(next);\n onValueChange?.(next);\n };\n const toggle = (val: string) => {\n if (multiple) {\n setSelected(selected.includes(val) ? selected.filter((v) => v !== val) : [...selected, val]);\n } else {\n setSelected([val]);\n }\n };\n\n return (\n <Md3Card\n ref={ref}\n variant=\"outlined\"\n className={cn(\"flex flex-col gap-4 rounded-md-lg p-5 animate-nx-fade-in motion-reduce:animate-none\", className)}\n {...props}\n >\n <p id={questionId} className=\"text-base font-medium tracking-[0.15px] text-md-on-surface\">\n {question}\n </p>\n <div\n ref={groupRef}\n role={multiple ? \"group\" : \"radiogroup\"}\n aria-labelledby={questionId}\n className=\"flex flex-col gap-1\"\n onKeyDown={(e) => {\n // Radio-group keyboard pattern: arrows move and select.\n if (multiple || ![\"ArrowDown\", \"ArrowUp\", \"ArrowRight\", \"ArrowLeft\"].includes(e.key)) return;\n const radios = Array.from(groupRef.current?.querySelectorAll<HTMLButtonElement>('[role=\"radio\"]') ?? []);\n const i = radios.indexOf(document.activeElement as HTMLButtonElement);\n if (i < 0) return;\n e.preventDefault();\n const step = e.key === \"ArrowDown\" || e.key === \"ArrowRight\" ? 1 : -1;\n const next = (i + step + radios.length) % radios.length;\n radios[next].focus();\n setSelected([options[next].value]);\n }}\n >\n {options.map((option, index) => {\n const active = selected.includes(option.value);\n const tabbable = multiple || index === Math.max(0, options.findIndex((o) => selected.includes(o.value)));\n return (\n <button\n key={option.value}\n type=\"button\"\n role={multiple ? \"checkbox\" : \"radio\"}\n aria-checked={active}\n tabIndex={tabbable ? 0 : -1}\n onClick={() => toggle(option.value)}\n className={cn(\n \"relative flex min-h-12 items-center gap-4 overflow-hidden rounded-md-md px-3 py-2 text-left text-sm transition-colors duration-200 motion-reduce:transition-none\",\n stateLayer,\n \"outline-none focus-visible:ring-2 focus-visible:ring-md-primary\",\n active\n ? \"bg-md-secondary-container text-md-on-secondary-container\"\n : \"text-md-on-surface\",\n )}\n >\n {multiple ? (\n <span\n className={cn(\n \"relative inline-flex size-[18px] shrink-0 items-center justify-center rounded-[2px] border-2 transition-colors [&_svg]:size-3.5\",\n active ? \"border-md-primary bg-md-primary text-md-on-primary\" : \"border-md-on-surface-variant\",\n )}\n >\n {active && <Check strokeWidth={3} aria-hidden=\"true\" />}\n </span>\n ) : (\n <span\n className={cn(\n \"relative inline-flex size-5 shrink-0 items-center justify-center rounded-full border-2 transition-colors\",\n active ? \"border-md-primary\" : \"border-md-on-surface-variant\",\n )}\n >\n <span\n className={cn(\n \"size-2.5 rounded-full bg-md-primary transition-transform duration-200 motion-reduce:transition-none\",\n active ? \"scale-100\" : \"scale-0\",\n )}\n />\n </span>\n )}\n <span className=\"relative flex-1\">{option.label}</span>\n </button>\n );\n })}\n </div>\n {allowOther && (\n <input\n type=\"text\"\n value={other}\n onChange={(e) => setOther(e.target.value)}\n placeholder={otherPlaceholder}\n aria-label={otherPlaceholder}\n className={cn(fieldClass, \"h-12\")}\n />\n )}\n <div className=\"flex items-center justify-end gap-2\">\n {onSkip && (\n <Md3Button variant=\"text\" onClick={onSkip}>\n {skipLabel}\n </Md3Button>\n )}\n {onSubmit && (\n <Md3Button\n variant=\"filled\"\n onClick={() => onSubmit(selected, allowOther ? other : undefined)}\n disabled={selected.length === 0 && !(allowOther && other.trim())}\n >\n {submitLabel}\n </Md3Button>\n )}\n </div>\n </Md3Card>\n );\n },\n);\nMd3StructuredInput.displayName = \"Md3StructuredInput\";\n\n/* -------------------------------------------------------------------------- */\n/* Named slots */\n/* -------------------------------------------------------------------------- */\n\n/**\n * Material 3 named slots: a short set of plain-language MD3 outlined fields\n * (2–4) that fill a prompt template — text fields or native selects with\n * visible labels and helper text, an optional freeform override, and a submit\n * that never requires every field. Agent-suggested values carry a\n * primary-container “Suggested” mark with their reason and turn into a neutral\n * “Edited by you” once changed; the component never changes a value the person\n * set. Shares its API with `StructuredInputSlots`.\n */\nexport const Md3StructuredInputSlots = React.forwardRef<HTMLFormElement, Md3StructuredInputSlotsProps>(\n (\n {\n slots,\n values: valuesProp,\n defaultValues,\n onValuesChange,\n freeform = false,\n onSubmit,\n submitLabel = \"Generate\",\n label = \"Structured prompt builder\",\n className,\n ...props\n },\n ref,\n ) => {\n const [internal, setInternal] = React.useState<StructuredInputValues>(defaultValues ?? {});\n const values = valuesProp ?? internal;\n const [edited, setEdited] = React.useState<Record<string, boolean>>({});\n const [extra, setExtra] = React.useState(\"\");\n const baseId = React.useId();\n\n const setValue = (name: string, value: string) => {\n const next = { ...values, [name]: value };\n if (valuesProp === undefined) setInternal(next);\n setEdited((e) => ({ ...e, [name]: true }));\n onValuesChange?.(next);\n };\n\n const hasAny = Object.values(values).some((v) => v && v.trim()) || extra.trim().length > 0;\n const freeformLabel = typeof freeform === \"string\" ? freeform : \"Anything else?\";\n\n return (\n <form\n ref={ref}\n aria-label={label}\n className={cn(\"grid grid-cols-1 gap-4 text-md-on-surface sm:grid-cols-2\", className)}\n onSubmit={(e) => {\n e.preventDefault();\n if (hasAny) onSubmit?.(values, extra);\n }}\n {...props}\n >\n {slots.map((slot) => {\n const id = `${baseId}-${slot.name}`;\n const helperId = `${id}-helper`;\n const isEdited = !!edited[slot.name];\n const mark = slot.suggested ? (isEdited ? \"edited\" : \"suggested\") : null;\n const describedBy = slot.helper || mark === \"suggested\" ? helperId : undefined;\n return (\n <div key={slot.name} className={cn(\"flex flex-col gap-1.5\", slot.wide && \"sm:col-span-2\")}>\n <div className=\"flex min-h-6 items-center gap-2\">\n <label htmlFor={id} className=\"text-xs font-medium tracking-[0.5px] text-md-on-surface-variant\">\n {slot.label}\n </label>\n {mark && (\n <span\n className={cn(\n \"inline-flex h-6 items-center gap-1 rounded-md-sm px-2 text-[11px] font-medium tracking-[0.5px] [&_svg]:size-3.5\",\n mark === \"suggested\"\n ? \"bg-md-primary-container text-md-on-primary-container\"\n : \"bg-md-surface-container-high text-md-on-surface-variant\",\n )}\n >\n {mark === \"suggested\" ? <Sparkles aria-hidden=\"true\" /> : <UserPen aria-hidden=\"true\" />}\n {mark === \"suggested\" ? \"Suggested\" : \"Edited by you\"}\n </span>\n )}\n </div>\n {slot.options ? (\n <select\n id={id}\n value={values[slot.name] ?? \"\"}\n aria-describedby={describedBy}\n onChange={(e) => setValue(slot.name, e.target.value)}\n className={cn(fieldClass, \"h-14 cursor-pointer\", !values[slot.name] && \"text-md-on-surface-variant\")}\n >\n <option value=\"\" disabled>\n {slot.placeholder ?? \"Choose…\"}\n </option>\n {slot.options.map((o) => (\n <option key={o.value} value={o.value}>\n {typeof o.label === \"string\" || typeof o.label === \"number\" ? o.label : o.value}\n </option>\n ))}\n </select>\n ) : (\n <input\n id={id}\n type=\"text\"\n value={values[slot.name] ?? \"\"}\n placeholder={slot.placeholder}\n aria-describedby={describedBy}\n onChange={(e) => setValue(slot.name, e.target.value)}\n className={cn(fieldClass, \"h-14\")}\n />\n )}\n {describedBy && (\n <p id={helperId} className=\"px-4 text-xs text-md-on-surface-variant\">\n {mark === \"suggested\" ? `Suggested ${slot.suggested}. ` : \"\"}\n {slot.helper}\n </p>\n )}\n </div>\n );\n })}\n {freeform && (\n <div className=\"flex flex-col gap-1.5 sm:col-span-2\">\n <label\n htmlFor={`${baseId}-freeform`}\n className=\"text-xs font-medium tracking-[0.5px] text-md-on-surface-variant\"\n >\n {freeformLabel}\n </label>\n <textarea\n id={`${baseId}-freeform`}\n rows={2}\n value={extra}\n placeholder=\"Say it in your own words — this overrides the fields above\"\n onChange={(e) => setExtra(e.target.value)}\n className={cn(fieldClass, \"resize-none py-3\")}\n />\n </div>\n )}\n {onSubmit && (\n <div className=\"flex justify-end sm:col-span-2\">\n <Md3Button type=\"submit\" variant=\"filled\" disabled={!hasAny}>\n {submitLabel}\n </Md3Button>\n </div>\n )}\n </form>\n );\n },\n);\nMd3StructuredInputSlots.displayName = \"Md3StructuredInputSlots\";\n\n/* -------------------------------------------------------------------------- */\n/* Tagged input */\n/* -------------------------------------------------------------------------- */\n\n// Same defaults as the twin (internal there).\nconst DEFAULT_TRIGGERS: StructuredInputTagTrigger[] = [\n { trigger: \"@\", label: \"Person\" },\n { trigger: \"p:\", label: \"Project\" },\n { trigger: \"/\", label: \"File\" },\n];\n\n/** MD3 tonal roles for tag chips, cycled per trigger. */\nconst TAG_TONES = [\n \"bg-md-primary-container text-md-on-primary-container\",\n \"bg-md-secondary-container text-md-on-secondary-container\",\n \"bg-md-tertiary-container text-md-on-tertiary-container\",\n \"bg-md-surface-container-high text-md-on-surface\",\n];\n\n/**\n * Material 3 tagged input: a prompt field (MD3 outlined) where typed prefixes\n * (`@` person, `p:` project, `/` file — configurable) become removable input\n * chips in tonal containers, with type-ahead suggestions as MD3 suggestion\n * chips. Backspace on an empty field removes the last tag; Enter sends. Tags\n * are optional — plain text always works. Shares its API (and\n * `structuredPartsToText`) with `StructuredInputTags`.\n */\nexport const Md3StructuredInputTags = React.forwardRef<HTMLDivElement, Md3StructuredInputTagsProps>(\n (\n {\n triggers = DEFAULT_TRIGGERS,\n value: valueProp,\n defaultValue,\n onValueChange,\n onSubmit,\n placeholder = \"Type @ for people, p: for projects, / for files\",\n submitLabel = \"Send\",\n className,\n ...props\n },\n ref,\n ) => {\n const [internal, setInternal] = React.useState<StructuredInputPart[]>(defaultValue ?? []);\n const parts = valueProp ?? internal;\n const [draft, setDraft] = React.useState(\"\");\n const inputRef = React.useRef<HTMLInputElement>(null);\n const hintId = React.useId();\n\n const commit = (next: StructuredInputPart[]) => {\n if (valueProp === undefined) setInternal(next);\n onValueChange?.(next);\n };\n\n // Longest trigger first so \"p:\" wins over \"p\".\n const ordered = [...triggers].sort((a, b) => b.trigger.length - a.trigger.length);\n const matchTag = (word: string) => {\n const t = ordered.find((tr) => word.startsWith(tr.trigger) && word.length > tr.trigger.length);\n return t ? { trigger: t.trigger, value: word.slice(t.trigger.length) } : null;\n };\n\n const lastWord = draft.split(\" \").pop() ?? \"\";\n const activeTrigger = ordered.find((tr) => lastWord.startsWith(tr.trigger));\n const query = activeTrigger ? lastWord.slice(activeTrigger.trigger.length).toLowerCase() : \"\";\n const suggestions =\n activeTrigger?.suggestions?.filter((s) => s.toLowerCase().startsWith(query)).slice(0, 5) ?? [];\n\n /** Split the draft into text + a trailing tag (if any) and commit them. */\n const flush = (source = draft, forceTag?: { trigger: string; value: string }): StructuredInputPart[] => {\n const words = source.split(\" \");\n const last = words.pop() ?? \"\";\n const tag = forceTag ?? matchTag(last);\n const textBefore = (tag ? words.join(\" \") : source).trim();\n const next = [...parts];\n if (textBefore) next.push({ type: \"text\", text: textBefore });\n if (tag) next.push({ type: \"tag\", ...tag });\n if (next.length !== parts.length) commit(next);\n setDraft(\"\");\n return next;\n };\n\n const toneFor = (trigger: string) => {\n const i = triggers.findIndex((t) => t.trigger === trigger);\n return TAG_TONES[(i < 0 ? 0 : i) % TAG_TONES.length];\n };\n const labelFor = (trigger: string) => triggers.find((t) => t.trigger === trigger)?.label ?? \"Tag\";\n\n const submit = () => {\n const next = flush();\n const text = structuredPartsToText(next);\n if (text) onSubmit?.(next, text);\n };\n\n return (\n <div ref={ref} className={cn(\"flex flex-col gap-2 text-md-on-surface\", className)} {...props}>\n <div\n className={cn(\n \"flex min-h-14 flex-wrap items-center gap-1.5 rounded-md-xs border border-md-outline bg-transparent px-3 py-2 text-base text-md-on-surface transition-colors\",\n \"hover:border-md-on-surface focus-within:border-md-primary focus-within:ring-1 focus-within:ring-inset focus-within:ring-md-primary\",\n )}\n onClick={() => inputRef.current?.focus()}\n >\n {parts.map((part, i) =>\n part.type === \"text\" ? (\n <span key={i}>{part.text}</span>\n ) : (\n <span\n key={i}\n className={cn(\n \"inline-flex h-7 items-center gap-0.5 rounded-md-sm pl-2 pr-0.5 text-sm font-medium animate-nx-fade-in motion-reduce:animate-none\",\n toneFor(part.trigger),\n )}\n >\n {part.trigger}\n {part.value}\n <button\n type=\"button\"\n aria-label={`Remove ${labelFor(part.trigger).toLowerCase()} ${part.trigger}${part.value}`}\n onClick={(e) => {\n e.stopPropagation();\n commit(parts.filter((_, j) => j !== i));\n inputRef.current?.focus();\n }}\n className={cn(\n \"relative inline-flex size-6 items-center justify-center overflow-hidden rounded-full [&_svg]:size-3.5\",\n stateLayer,\n \"outline-none focus-visible:ring-2 focus-visible:ring-md-primary\",\n )}\n >\n <X className=\"relative\" aria-hidden=\"true\" />\n </button>\n </span>\n ),\n )}\n <input\n ref={inputRef}\n type=\"text\"\n value={draft}\n aria-label={placeholder}\n aria-describedby={hintId}\n placeholder={parts.length ? undefined : placeholder}\n onChange={(e) => {\n const v = e.target.value;\n // A space after a tag word (incl. mobile keyboards that skip keydown) makes it a chip.\n if (v.endsWith(\" \") && matchTag(v.trimEnd().split(\" \").pop() ?? \"\")) flush(v.trimEnd());\n else setDraft(v);\n }}\n onKeyDown={(e) => {\n if (e.key === \" \" && matchTag(lastWord)) {\n e.preventDefault();\n flush();\n } else if (e.key === \"Enter\") {\n e.preventDefault();\n submit();\n } else if (e.key === \"Backspace\" && draft === \"\" && parts.length) {\n e.preventDefault();\n const last = parts[parts.length - 1];\n commit(parts.slice(0, -1));\n if (last.type === \"text\") setDraft(last.text);\n }\n }}\n className=\"h-8 min-w-[8rem] flex-1 bg-transparent text-base text-md-on-surface outline-none placeholder:text-md-on-surface-variant\"\n />\n </div>\n <p id={hintId} className=\"sr-only\">\n {triggers.map((t) => `${t.trigger} for ${t.label.toLowerCase()}`).join(\", \")}. Space turns a tag into a\n chip; Backspace removes the last one; Enter sends.\n </p>\n {activeTrigger && suggestions.length > 0 && (\n <div role=\"group\" aria-label={`${activeTrigger.label} suggestions`} className=\"flex flex-wrap gap-2\">\n {suggestions.map((s) => (\n <Md3Chip\n key={s}\n variant=\"suggestion\"\n onClick={() => {\n flush(draft, { trigger: activeTrigger.trigger, value: s });\n inputRef.current?.focus();\n }}\n >\n {activeTrigger.trigger}\n {s}\n </Md3Chip>\n ))}\n </div>\n )}\n {onSubmit && (\n <div className=\"flex justify-end\">\n <Md3Button variant=\"filled\" onClick={submit} disabled={parts.length === 0 && draft.trim() === \"\"}>\n {submitLabel}\n </Md3Button>\n </div>\n )}\n </div>\n );\n },\n);\nMd3StructuredInputTags.displayName = \"Md3StructuredInputTags\";\n\n/* -------------------------------------------------------------------------- */\n/* Wizard step */\n/* -------------------------------------------------------------------------- */\n\n/**\n * Material 3 wizard step: a multi-step MD3 card for high-stakes prompts\n * (legal, HR, medical) — a segmented progress track in the primary colour,\n * “Step 2 of 3 · Audience”, the step's question and fields (children), and\n * Back / Next / Generate as MD3 text and filled buttons. Focus moves to the\n * step heading when the step changes; nothing forces every step to be filled\n * before generating. Shares its API with `StructuredInputWizard`.\n */\nexport const Md3StructuredInputWizard = React.forwardRef<HTMLDivElement, Md3StructuredInputWizardProps>(\n (\n {\n steps,\n step: stepProp,\n defaultStep = 0,\n onStepChange,\n description,\n onSubmit,\n submitLabel = \"Generate\",\n allowEarlySubmit = true,\n className,\n children,\n ...props\n },\n ref,\n ) => {\n const [internal, setInternal] = React.useState(defaultStep);\n const step = Math.min(Math.max(stepProp ?? internal, 0), Math.max(steps.length - 1, 0));\n const headingRef = React.useRef<HTMLParagraphElement>(null);\n const headingId = React.useId();\n const moved = React.useRef(false);\n\n React.useEffect(() => {\n if (moved.current) headingRef.current?.focus();\n }, [step]);\n\n const go = (next: number) => {\n moved.current = true;\n if (stepProp === undefined) setInternal(next);\n onStepChange?.(next);\n };\n\n const last = step === steps.length - 1;\n\n return (\n <Md3Card\n ref={ref}\n variant=\"outlined\"\n role=\"group\"\n aria-labelledby={headingId}\n className={cn(\"flex flex-col gap-3 rounded-md-lg p-4\", className)}\n {...props}\n >\n <div className=\"flex gap-1\" aria-hidden=\"true\">\n {steps.map((_, i) => (\n <span\n key={i}\n className={cn(\n \"h-1 flex-1 rounded-full transition-colors duration-300 motion-reduce:transition-none\",\n i <= step ? \"bg-md-primary\" : \"bg-md-secondary-container\",\n )}\n />\n ))}\n </div>\n <div className=\"flex flex-col gap-1\">\n <p\n ref={headingRef}\n id={headingId}\n tabIndex={-1}\n className=\"rounded-md-xs text-sm font-medium tracking-[0.1px] text-md-on-surface outline-none focus-visible:ring-2 focus-visible:ring-md-primary\"\n >\n Step {step + 1} of {steps.length} · {steps[step]}\n </p>\n {description && <p className=\"text-sm text-md-on-surface-variant\">{description}</p>}\n </div>\n {children}\n <div className=\"flex items-center gap-2\">\n {step > 0 && (\n <Md3Button variant=\"text\" onClick={() => go(step - 1)}>\n Back\n </Md3Button>\n )}\n <span className=\"flex-1\" />\n {!last && allowEarlySubmit && onSubmit && (\n <Md3Button variant=\"text\" onClick={onSubmit}>\n {submitLabel} now\n </Md3Button>\n )}\n {last ? (\n onSubmit && (\n <Md3Button variant=\"filled\" onClick={onSubmit}>\n {submitLabel}\n </Md3Button>\n )\n ) : (\n <Md3Button variant=\"filled\" onClick={() => go(step + 1)}>\n Next\n </Md3Button>\n )}\n </div>\n </Md3Card>\n );\n },\n);\nMd3StructuredInputWizard.displayName = \"Md3StructuredInputWizard\";\n"]}
|
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { StructuredInputProps, StructuredInputSlotsProps, StructuredInputTagsProps, StructuredInputWizardProps } from '@nucleux/structured-input';
|
|
3
|
+
export { StructuredInputPart, StructuredInputSlot, StructuredInputTagTrigger, StructuredInputValues, StructuredOption, structuredPartsToText } from '@nucleux/structured-input';
|
|
4
|
+
|
|
5
|
+
type Md3StructuredInputProps = StructuredInputProps;
|
|
6
|
+
type Md3StructuredInputSlotsProps = StructuredInputSlotsProps;
|
|
7
|
+
type Md3StructuredInputTagsProps = StructuredInputTagsProps;
|
|
8
|
+
type Md3StructuredInputWizardProps = StructuredInputWizardProps;
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Material 3 structured input: an agent-generated clarifying question as a
|
|
12
|
+
* compact MD3 card — single or multi-select options drawn as MD3 radio and
|
|
13
|
+
* checkbox rows with a state layer, a free-text escape, and a skip. Arrow keys
|
|
14
|
+
* move and select in single mode, exactly as in the twin. The other variants
|
|
15
|
+
* are composable siblings: {@link Md3StructuredInputSlots},
|
|
16
|
+
* {@link Md3StructuredInputTags} and {@link Md3StructuredInputWizard}. Shares
|
|
17
|
+
* its API with `StructuredInput` from `@nucleux/structured-input`.
|
|
18
|
+
*/
|
|
19
|
+
declare const Md3StructuredInput: React.ForwardRefExoticComponent<StructuredInputProps & React.RefAttributes<HTMLDivElement>>;
|
|
20
|
+
/**
|
|
21
|
+
* Material 3 named slots: a short set of plain-language MD3 outlined fields
|
|
22
|
+
* (2–4) that fill a prompt template — text fields or native selects with
|
|
23
|
+
* visible labels and helper text, an optional freeform override, and a submit
|
|
24
|
+
* that never requires every field. Agent-suggested values carry a
|
|
25
|
+
* primary-container “Suggested” mark with their reason and turn into a neutral
|
|
26
|
+
* “Edited by you” once changed; the component never changes a value the person
|
|
27
|
+
* set. Shares its API with `StructuredInputSlots`.
|
|
28
|
+
*/
|
|
29
|
+
declare const Md3StructuredInputSlots: React.ForwardRefExoticComponent<StructuredInputSlotsProps & React.RefAttributes<HTMLFormElement>>;
|
|
30
|
+
/**
|
|
31
|
+
* Material 3 tagged input: a prompt field (MD3 outlined) where typed prefixes
|
|
32
|
+
* (`@` person, `p:` project, `/` file — configurable) become removable input
|
|
33
|
+
* chips in tonal containers, with type-ahead suggestions as MD3 suggestion
|
|
34
|
+
* chips. Backspace on an empty field removes the last tag; Enter sends. Tags
|
|
35
|
+
* are optional — plain text always works. Shares its API (and
|
|
36
|
+
* `structuredPartsToText`) with `StructuredInputTags`.
|
|
37
|
+
*/
|
|
38
|
+
declare const Md3StructuredInputTags: React.ForwardRefExoticComponent<StructuredInputTagsProps & React.RefAttributes<HTMLDivElement>>;
|
|
39
|
+
/**
|
|
40
|
+
* Material 3 wizard step: a multi-step MD3 card for high-stakes prompts
|
|
41
|
+
* (legal, HR, medical) — a segmented progress track in the primary colour,
|
|
42
|
+
* “Step 2 of 3 · Audience”, the step's question and fields (children), and
|
|
43
|
+
* Back / Next / Generate as MD3 text and filled buttons. Focus moves to the
|
|
44
|
+
* step heading when the step changes; nothing forces every step to be filled
|
|
45
|
+
* before generating. Shares its API with `StructuredInputWizard`.
|
|
46
|
+
*/
|
|
47
|
+
declare const Md3StructuredInputWizard: React.ForwardRefExoticComponent<StructuredInputWizardProps & React.RefAttributes<HTMLDivElement>>;
|
|
48
|
+
|
|
49
|
+
export { Md3StructuredInput, type Md3StructuredInputProps, Md3StructuredInputSlots, type Md3StructuredInputSlotsProps, Md3StructuredInputTags, type Md3StructuredInputTagsProps, Md3StructuredInputWizard, type Md3StructuredInputWizardProps };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { StructuredInputProps, StructuredInputSlotsProps, StructuredInputTagsProps, StructuredInputWizardProps } from '@nucleux/structured-input';
|
|
3
|
+
export { StructuredInputPart, StructuredInputSlot, StructuredInputTagTrigger, StructuredInputValues, StructuredOption, structuredPartsToText } from '@nucleux/structured-input';
|
|
4
|
+
|
|
5
|
+
type Md3StructuredInputProps = StructuredInputProps;
|
|
6
|
+
type Md3StructuredInputSlotsProps = StructuredInputSlotsProps;
|
|
7
|
+
type Md3StructuredInputTagsProps = StructuredInputTagsProps;
|
|
8
|
+
type Md3StructuredInputWizardProps = StructuredInputWizardProps;
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Material 3 structured input: an agent-generated clarifying question as a
|
|
12
|
+
* compact MD3 card — single or multi-select options drawn as MD3 radio and
|
|
13
|
+
* checkbox rows with a state layer, a free-text escape, and a skip. Arrow keys
|
|
14
|
+
* move and select in single mode, exactly as in the twin. The other variants
|
|
15
|
+
* are composable siblings: {@link Md3StructuredInputSlots},
|
|
16
|
+
* {@link Md3StructuredInputTags} and {@link Md3StructuredInputWizard}. Shares
|
|
17
|
+
* its API with `StructuredInput` from `@nucleux/structured-input`.
|
|
18
|
+
*/
|
|
19
|
+
declare const Md3StructuredInput: React.ForwardRefExoticComponent<StructuredInputProps & React.RefAttributes<HTMLDivElement>>;
|
|
20
|
+
/**
|
|
21
|
+
* Material 3 named slots: a short set of plain-language MD3 outlined fields
|
|
22
|
+
* (2–4) that fill a prompt template — text fields or native selects with
|
|
23
|
+
* visible labels and helper text, an optional freeform override, and a submit
|
|
24
|
+
* that never requires every field. Agent-suggested values carry a
|
|
25
|
+
* primary-container “Suggested” mark with their reason and turn into a neutral
|
|
26
|
+
* “Edited by you” once changed; the component never changes a value the person
|
|
27
|
+
* set. Shares its API with `StructuredInputSlots`.
|
|
28
|
+
*/
|
|
29
|
+
declare const Md3StructuredInputSlots: React.ForwardRefExoticComponent<StructuredInputSlotsProps & React.RefAttributes<HTMLFormElement>>;
|
|
30
|
+
/**
|
|
31
|
+
* Material 3 tagged input: a prompt field (MD3 outlined) where typed prefixes
|
|
32
|
+
* (`@` person, `p:` project, `/` file — configurable) become removable input
|
|
33
|
+
* chips in tonal containers, with type-ahead suggestions as MD3 suggestion
|
|
34
|
+
* chips. Backspace on an empty field removes the last tag; Enter sends. Tags
|
|
35
|
+
* are optional — plain text always works. Shares its API (and
|
|
36
|
+
* `structuredPartsToText`) with `StructuredInputTags`.
|
|
37
|
+
*/
|
|
38
|
+
declare const Md3StructuredInputTags: React.ForwardRefExoticComponent<StructuredInputTagsProps & React.RefAttributes<HTMLDivElement>>;
|
|
39
|
+
/**
|
|
40
|
+
* Material 3 wizard step: a multi-step MD3 card for high-stakes prompts
|
|
41
|
+
* (legal, HR, medical) — a segmented progress track in the primary colour,
|
|
42
|
+
* “Step 2 of 3 · Audience”, the step's question and fields (children), and
|
|
43
|
+
* Back / Next / Generate as MD3 text and filled buttons. Focus moves to the
|
|
44
|
+
* step heading when the step changes; nothing forces every step to be filled
|
|
45
|
+
* before generating. Shares its API with `StructuredInputWizard`.
|
|
46
|
+
*/
|
|
47
|
+
declare const Md3StructuredInputWizard: React.ForwardRefExoticComponent<StructuredInputWizardProps & React.RefAttributes<HTMLDivElement>>;
|
|
48
|
+
|
|
49
|
+
export { Md3StructuredInput, type Md3StructuredInputProps, Md3StructuredInputSlots, type Md3StructuredInputSlotsProps, Md3StructuredInputTags, type Md3StructuredInputTagsProps, Md3StructuredInputWizard, type Md3StructuredInputWizardProps };
|