Skip to content

feat(scaffold): add v2 mail form templates with reusable c-form-* components#952

Draft
yusasa16 wants to merge 8 commits into
v6from
refactor/form-template-redesign
Draft

feat(scaffold): add v2 mail form templates with reusable c-form-* components#952
yusasa16 wants to merge 8 commits into
v6from
refactor/form-template-redesign

Conversation

@yusasa16

@yusasa16 yusasa16 commented Jul 21, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • フォーム用コンポーネントセット c-form-fieldset / c-form-field / c-form-input(type別)/ c-form-input-confirm を新規追加
    • c-form-fieldsetname(単一inputにlabel[for]で紐付く場合)/ key(グループ化、または checkbox・radio)のどちらを渡すかで div/label 構造と fieldset/legend 構造を自動判定
    • c-form-field は前後見出しをCMS要件に沿って label にするか span にするかを自動判定
  • 都道府県・生まれ年の選択肢一覧を data.yml に切り出し
  • 新コンポーネントを使った 300_form_input_v2.pug / 301_form_confirm_v2.pug を追加し __tmpl/index.pug に登録
    • 既存の 300_form_input.pug / 301_form_confirm.pug は変更せず、新旧を並行運用できるようにした(302_form_complete.pug は対象外)
  • フォームコンポーネント配下に暫定の markuplint オーバーライド(.markuplintrc)を追加

Closes #897

Test plan

  • yarn workspace @d-zero/scaffold build:only300_form_input_v2.pug / 301_form_confirm_v2.pug のビルドが通ることを確認
  • .markuplintrc のルール上書き内容を最終調整

🤖 Generated with Claude Code

yusasa16 and others added 8 commits July 21, 2026 19:45
- extract .mail-field markup from 300_form_input.pug into mail-field.pug mixins
- render label/span attachments per CMS grouping rules with checkbox/radio exceptions
- output hidden inputs for checkbox/radio groups to keep unchecked keys submitted
- move prefecture and birth-year options to data.yml
- add tentative markuplint overrides for the form component directory

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…onent

- extract .cc-form-fieldset markup from 300_form_input.pug into cc-form-fieldset.pug
- render fieldset/legend or div/label structure via isGrouped, with field content
  injected through a pug block
- replace ambiguous badge string prop with an isRequired boolean, normalizing the
  previously badge-less tel field to show the optional badge

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
- add mail-field-confirm.pug with a mailFieldConfirm mixin mirroring mail-field.pug's
  type dispatch, for the confirm page's static placeholder markup (no id, label
  switching, description, or error-message needed there)
- let ccFormFieldset fall back to a plain span heading when labelFor is omitted, so
  the confirm page (no focusable input to label) can reuse it with isGrouped: false
- replace the 14 repeated .cc-form-fieldset blocks in 301_form_confirm.pug with
  ccFormFieldset + mailFieldConfirm calls, keeping the confirm page's existing
  (sometimes blank) attachment text and attention as-is
- normalize checkbox/radio fields to always render both attachment spans, and always
  show the required/optional badge, matching ccFormFieldset's existing behavior

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Replace ccFormFieldset's id/isGrouped/labelFor props with name (single
field) and key (grouped field): the wrapper id, label-for target, and
fieldset/legend vs div/label structure are now all computed from
whichever one is passed, instead of being hand-typed per call site.

Also drop the now-meaningless isGrouped from mailField calls for
checkbox/radio inputs, since their own option labels make it a no-op.
Turn mail-field's span.mail-input into a block so the caller composes
the concrete mailInputXxx mixin instead of mailField dispatching on a
nested input.type config object. This drops the now-dead isRequired
passthrough and moves mailInputText/Select/Checkbox/Radio/Textarea/File
into their own mail-input.pug, each deriving its own id from name
instead of receiving it from mail-field.
Align mail-field/mail-input/cc-form-fieldset mixins with the c- prefixed
BEM naming used by other components, and split the 301 confirm-screen
placeholder markup into its own c-form-input-confirm component.
Restore 300_form_input.pug, 301_form_confirm.pug, and the related
c-content-main.css fieldset styles to their pre-redesign state so the
new component-based design can be added as a separate template
instead of overwriting the original.
Add 300_form_input_v2.pug and 301_form_confirm_v2.pug using the new
c-form-fieldset/c-form-field/c-form-input component set, kept as
separate templates alongside the originals. List them in the template
index.
@yusasa16 yusasa16 changed the title Refactor/form template redesign feat(scaffold): add v2 mail form templates with reusable c-form-* components Jul 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant