diff --git a/.changeset/6541-sonner-button-variant-enum.md b/.changeset/6541-sonner-button-variant-enum.md new file mode 100644 index 000000000..c3396d7e4 --- /dev/null +++ b/.changeset/6541-sonner-button-variant-enum.md @@ -0,0 +1,43 @@ +--- +'@object-ui/types': minor +--- + +**Accept-set NARROWING on a published surface.** `SonnerSchema.buttonVariant` in the zod +mirror (`@object-ui/types/zod`) was `z.string()`; it is now +`z.enum(['default', 'secondary', 'destructive', 'outline', 'ghost', 'link'])`. Values +outside those six — `'primary'`, `'danger'`, `'Default'`, `''` — used to validate and now +fail. Stated as a narrowing rather than as a fix, because it removes values the published +mirror accepted (objectui#6541). + +**What was wrong.** The same key on the same component shipped as two disagreeing published +faces: an open string to anyone validating (`@object-ui/types/zod`), and a closed +six-member union to anyone type-checking (`@object-ui/types`, `SonnerSchema.buttonVariant` +in `feedback.ts`). The TS face was already correct — only the mirror is changed here, so +this is the mirror being made to agree with a declaration that sat beside it all along. + +**Why the wide face was wrong and not merely wide.** `renderers/feedback/sonner.tsx` passes +the value straight into `