feat(scaffold): add v2 mail form templates with reusable c-form-* components#952
Draft
yusasa16 wants to merge 8 commits into
Draft
feat(scaffold): add v2 mail form templates with reusable c-form-* components#952yusasa16 wants to merge 8 commits into
yusasa16 wants to merge 8 commits into
Conversation
- 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
c-form-fieldset/c-form-field/c-form-input(type別)/c-form-input-confirmを新規追加c-form-fieldsetはname(単一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は対象外).markuplintrc)を追加Closes #897
Test plan
yarn workspace @d-zero/scaffold build:onlyで300_form_input_v2.pug/301_form_confirm_v2.pugのビルドが通ることを確認.markuplintrcのルール上書き内容を最終調整🤖 Generated with Claude Code