diff --git a/src/components/puck/Address.tsx b/src/components/puck/Address.tsx index 0236b0f..fd153ee 100644 --- a/src/components/puck/Address.tsx +++ b/src/components/puck/Address.tsx @@ -76,7 +76,7 @@ const Address = ({ return (
{address && ( diff --git a/src/components/puck/Emails.tsx b/src/components/puck/Emails.tsx index 96cbdad..006a96a 100644 --- a/src/components/puck/Emails.tsx +++ b/src/components/puck/Emails.tsx @@ -9,9 +9,10 @@ import { EntityField, YextEntityField, YextEntityFieldSelector, + getFontWeightOverrideOptions, } from "../../index.js"; -const emailsVariants = cva("list-inside", { +const emailsVariants = cva("list-inside font-body-fontFamily", { variants: { fontSize: { default: "text-body-fontSize", @@ -85,22 +86,6 @@ const EmailsFields: Fields = { { label: "5xl", value: "5xl" }, ], }, - fontWeight: { - label: "Font Weight", - type: "select", - options: [ - { label: "Default", value: "default" }, - { label: "Thin", value: "thin" }, - { label: "Extra Light", value: "extralight" }, - { label: "Light", value: "light" }, - { label: "Normal", value: "normal" }, - { label: "Medium", value: "medium" }, - { label: "Semibold", value: "semibold" }, - { label: "Bold", value: "bold" }, - { label: "Extrabold", value: "extrabold" }, - { label: "Black", value: "black" }, - ], - }, color: { label: "Color", type: "select", @@ -182,6 +167,19 @@ export const EmailsComponent: ComponentConfig = { includeHyperlink: true, listLength: 5, }, + resolveFields: async () => { + const fontWeightOptions = await getFontWeightOverrideOptions({ + fontCssVariable: `--fontFamily-body-fontFamily`, + }); + return { + ...EmailsFields, + fontWeight: { + label: "Font Weight", + type: "select", + options: fontWeightOptions, + }, + }; + }, render: (props) => , }; diff --git a/src/components/puck/GetDirections.tsx b/src/components/puck/GetDirections.tsx index 3d108f3..1a1b25d 100644 --- a/src/components/puck/GetDirections.tsx +++ b/src/components/puck/GetDirections.tsx @@ -121,7 +121,7 @@ const GetDirections = ({ return (