{"version":3,"file":"ShopField.CjcTwvu4.mjs","names":[],"sources":["https:/framerusercontent.com/modules/gqxlWEcOO7rbhKds5HGE/UWtBQTDkIXGPDvXw9zys/ShopField.js"],"sourcesContent":["// Shop field — one line of text that Shopify holds and the CMS does not: the\n// product's colour, its short line, where it is made, and so on (the custom.*\n// metafields). Bind \"Slug\" to the product's slug and pick the field. When the\n// product has no value for it, nothing is shown.\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{addPropertyControls,ControlType,useIsStaticRenderer}from\"framer\";import{T,ff,useLive}from\"https://framerusercontent.com/modules/oUXMVQOxy4sbV3MK6xzP/3AdG0mnQaYrfHYxQcHhZ/OmbrineStore.js\";/**\n * Shop field\n *\n * @framerIntrinsicWidth 80\n * @framerIntrinsicHeight 19\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight auto\n */export default function ShopField(props){const{slug=\"\",field=\"colour\",look=\"body\",color,sample=\"\",style}=props;const isStatic=useIsStaticRenderer();const live=useLive(slug);const meta=live?.meta;const withSwatch=field===\"swatch\"||field===\"colourAndSwatch\";const key=withSwatch?\"colour\":field;// on the canvas there is no shop to ask, so the sample stands in\nconst text=field===\"swatch\"?\"\":meta&&meta[key]||(isStatic?sample:\"\");const hex=withSwatch?meta?.colourHex||(isStatic?\"#B0875F\":\"\"):\"\";const fixedWidth=style?.width===\"100%\";if(!text&&!hex)return /*#__PURE__*/_jsx(\"span\",{\"aria-hidden\":true,style:{...style,display:\"block\",width:fixedWidth?\"100%\":0,height:0}});return /*#__PURE__*/_jsxs(\"span\",{style:{...style,display:\"inline-flex\",alignItems:\"center\",gap:10,width:fixedWidth?\"100%\":\"max-content\",maxWidth:\"100%\",fontFamily:ff.sans(),fontSize:look===\"caption\"?12:13,lineHeight:look===\"caption\"?1.3:1.45,letterSpacing:look===\"caption\"?\"0.006em\":\"0.002em\",color:color||T.inkSoft,whiteSpace:fixedWidth?\"normal\":\"nowrap\"},children:[hex&&/*#__PURE__*/_jsx(\"span\",{\"aria-hidden\":true,style:{width:12,height:12,borderRadius:6,background:hex,flex:\"0 0 auto\"}}),text]});}addPropertyControls(ShopField,{slug:{type:ControlType.String,title:\"Slug\",defaultValue:\"\",preventLocalization:true,description:\"Bind to the product's Slug.\"},field:{type:ControlType.Enum,title:\"Field\",options:[\"colour\",\"colourAndSwatch\",\"swatch\",\"shortLine\",\"composition\",\"care\",\"madeIn\"],optionTitles:[\"Colour\",\"Colour with swatch\",\"Swatch only\",\"Short line\",\"Composition\",\"Care\",\"Made in\"],defaultValue:\"colour\",description:\"A Shopify product metafield (custom.colour, custom.colour_hex, custom.short_line, custom.composition, custom.care, custom.made_in).\"},look:{type:ControlType.Enum,title:\"Text\",options:[\"body\",\"caption\"],optionTitles:[\"Body S\",\"Caption\"],defaultValue:\"body\",displaySegmentedControl:true},color:{type:ControlType.Color,title:\"Colour\",optional:true,description:\"Leave empty to follow the Ink Soft colour style.\"},sample:{type:ControlType.String,title:\"Canvas sample\",defaultValue:\"\",description:\"Shown on the canvas only, where there is no shop to ask.\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"ShopField\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"auto\",\"framerIntrinsicHeight\":\"19\",\"framerIntrinsicWidth\":\"80\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"any\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}"],"mappings":"2OAWG,SAAwB,EAAU,EAAM,CAAC,GAAK,CAAC,OAAK,GAAG,QAAM,SAAS,OAAK,OAAO,QAAM,SAAO,GAAG,SAAO,EAAY,EAAS,EAAoB,EAAiC,EAApB,EAAQ,CAAoB,CAAC,EAAE,KAAW,EAAW,IAAQ,UAAU,IAAQ,kBAC3O,EAAK,IAAQ,SAAS,GAAG,GAAM,EADwO,EAAW,SAAS,KAChP,EAAS,EAAO,IAAU,EAAI,EAAW,GAAM,YAAY,EAAS,UAAU,IAAI,GA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