docs/solutions/developer-experience/2026-05-23-shadcn-calendar-class-names-need-react-day-picker-normalization.md
Registry / Validate Registry failed in the playground template after pnpm templates:update --local regenerated components/ui/calendar.tsx.
The generated calendar and registry-installed date node used React Day Picker props that do not match the latest template dependency graph.
The failing CI job built templates/plate-playground-template and stopped on:
Type error: Object literal may only specify known properties, and 'table' does not exist in type 'Partial<ClassNames>'.
The local template had:
classNames={{
table: 'w-full border-collapse',
}}
with [email protected].
After that was fixed, the same job updated the template dependency graph to [email protected] and stopped on:
Property 'initialFocus' does not exist on type ...
React Day Picker v10 uses autoFocus.
templates/**. Those files are generated output in this repo, so patching them directly just hides the bad generator step.@platejs/* packages, not the calendar type error.Patch the template updater's generated-code normalization step:
normalize_react_day_picker_api() {
local calendar_file="$1/src/components/ui/calendar.tsx"
local date_node_file="$1/src/components/ui/date-node.tsx"
if [[ -f "$calendar_file" ]] && grep -q "react-day-picker" "$calendar_file"; then
perl -0pi -e 's/(\n\s*)table:/${1}month_grid:/g; s/defaultClassNames\.table/defaultClassNames.month_grid/g' "$calendar_file"
fi
if [[ -f "$date_node_file" ]] && grep -q "@/components/ui/calendar" "$date_node_file"; then
perl -0pi -e 's/(\n\s*)initialFocus(\n)/${1}autoFocus$2/g' "$date_node_file"
fi
}
Then call it after shadcn add and relative import normalization:
normalize_relative_ts_imports "$TEMPLATE_DIR/src"
normalize_react_day_picker_api "$TEMPLATE_DIR"
React Day Picker v9.14 exposes month_grid, not table, in its default class names. React Day Picker v10 removes the deprecated initialFocus prop and keeps autoFocus. shadcn@latest and Plate registry source can straddle those versions, so the template updater has to normalize generated calendar output before template lint/build checks run.
Keeping the fix in tooling/scripts/update-template.sh preserves the repo boundary: source controls generation behavior, and templates/** remains generated output.
getDefaultClassNames().month_grid and v10 uses autoFocus.calendar.tsx and date-node.tsx errors disappear.