|
| 1 | +@props([ |
| 2 | + // NO-OP textarea: renders a plain <textarea> with today's attributes + inner content. |
| 3 | + // There is NO `variant` arm: the only textarea style-classes in the app (.tiptapSimple / |
| 4 | + // .tiptapComplex / .wiki-editor-textarea) are JS rich-text EDITOR mounts — never route those |
| 5 | + // through this component (see do-not-touch below). Plain textareas carry no distinct style |
| 6 | + // class, so attribute + content passthrough is the whole no-op surface. |
| 7 | +
|
| 8 | + // --- design-system IDL: declared for the durable contract (shared with forms.text-input), |
| 9 | + // intentionally NOT rendered in no-op mode (a label/validation wrapper would change |
| 10 | + // today's markup). Activated in the design phase's field-row layout. --- |
| 11 | + 'contentRole' => '', // reserved |
| 12 | + 'state' => '', // info | warning | danger | success (validation) — reserved |
| 13 | + 'scale' => '', // xs | s | m | l | xl — reserved |
| 14 | + 'labelPosition' => 'top', // reserved |
| 15 | + 'labelText' => '', // reserved |
| 16 | + 'caption' => '', // reserved |
| 17 | + 'validationText' => '', // reserved |
| 18 | + 'validationState' => '', // reserved |
| 19 | +]) |
| 20 | + |
| 21 | +{{-- |
| 22 | + forms.textarea — NO-OP textarea. |
| 23 | +
|
| 24 | + Renders a plain <textarea> with the SAME attributes the app uses today; every attribute |
| 25 | + (name, id, rows, cols, placeholder, style, class, data-*, hx-*, required, …) passes through |
| 26 | + via $attributes, and the field's value is the slot (inner content), preserved EXACTLY. |
| 27 | +
|
| 28 | + ⚠️ DO NOT route rich-text EDITOR textareas through this component — JS upgrades them to Tiptap |
| 29 | + and they will break. Keep these RAW: |
| 30 | + • Tiptap: class="tiptapSimple" / class="tiptapComplex" (JS scans `textarea.tiptapSimple` / |
| 31 | + `textarea.tiptapComplex` and mounts an editor — public/assets/js/app/core/tiptap/index.js) |
| 32 | + • Wiki editor: class="wiki-editor-textarea" (id="wikiArticleContent") |
| 33 | + • any textarea with an inline on* handler or a data-*editor* attribute. |
| 34 | +
|
| 35 | + ⚠️ Whitespace matters: a textarea's value IS its inner content. Keep the slot tight — |
| 36 | + <x-global::forms.textarea …>{{ $value }}</x-global::forms.textarea> — never add newlines/indent |
| 37 | + around the value, or you change the field's content. |
| 38 | +
|
| 39 | + Migration: |
| 40 | + <textarea name="x"></textarea> -> <x-global::forms.textarea name="x"></x-global::forms.textarea> |
| 41 | + <textarea name="x">{{ $v }}</textarea> -> <x-global::forms.textarea name="x">{{ $v }}</x-global::forms.textarea> |
| 42 | +--}} |
| 43 | +<textarea {{ $attributes }}>{{ $slot }}</textarea> |
0 commit comments