{"version":3,"file":"TagList.C9FNGr-e.mjs","names":[],"sources":["https:/framerusercontent.com/modules/I2mze3erEAWBptlYM2m2/805WM7Aw2lCnqINyZbQv/TagList.js"],"sourcesContent":["// TagList component that splits a comma-separated string and displays each tag in its own box with adjustable padding and border radius\nimport{jsx as _jsx}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";/**\n * TagList\n *\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight auto\n */export default function TagList(props){const{tags=\"Design, Development, Branding\",padding,borderRadius,backgroundColor,textColor,font,gap,style,alignment,blur=0}=props;const tagList=tags.split(\",\").map(t=>t.trim()).filter(Boolean);let justifyContent=\"flex-start\";if(alignment===\"center\")justifyContent=\"center\";if(alignment===\"right\")justifyContent=\"flex-end\";return /*#__PURE__*/_jsx(\"div\",{style:{display:\"flex\",flexWrap:\"wrap\",gap:`${props.rowGap!==undefined?props.rowGap:gap}px ${gap}px`,justifyContent,...style,position:\"relative\",width:style&&style.width===\"100%\"?\"100%\":undefined,alignContent:\"flex-start\"},children:tagList.length>0&&props.wrapBalance?balanceTags(tagList,gap,justifyContent).map((row,rowIdx)=>/*#__PURE__*/_jsx(\"div\",{style:{display:\"flex\",gap:`${gap}px`,justifyContent,width:\"100%\",marginBottom:rowIdx<balanceTags(tagList,gap,justifyContent).length-1?props.rowGap!==undefined?props.rowGap:gap:0},children:row.map((tag,i)=>/*#__PURE__*/_jsx(\"span\",{style:{background:backgroundColor,color:textColor,borderRadius,padding:`${padding.top}px ${padding.right}px ${padding.bottom}px ${padding.left}px`,...font,display:\"inline-block\",whiteSpace:\"nowrap\",fontSize:font?.fontSize,fontWeight:font?.fontWeight,fontFamily:font?.fontFamily,lineHeight:font?.lineHeight,letterSpacing:props.letterSpacing||font?.letterSpacing,textTransform:props.textTransform||undefined,...typeof window!==\"undefined\"&&typeof blur===\"number\"&&blur>0?{backdropFilter:`blur(${blur}px)`,WebkitBackdropFilter:`blur(${blur}px)`}:{}},children:tag},i))},rowIdx)):tagList.map((tag,i)=>/*#__PURE__*/_jsx(\"span\",{style:{background:backgroundColor,color:textColor,borderRadius,padding:`${padding.top}px ${padding.right}px ${padding.bottom}px ${padding.left}px`,...font,display:\"inline-block\",whiteSpace:\"nowrap\",fontSize:font?.fontSize,fontWeight:font?.fontWeight,fontFamily:font?.fontFamily,lineHeight:font?.lineHeight,letterSpacing:props.letterSpacing||font?.letterSpacing,textTransform:props.textTransform||undefined,...typeof window!==\"undefined\"&&typeof blur===\"number\"&&blur>0?{backdropFilter:`blur(${blur}px)`,WebkitBackdropFilter:`blur(${blur}px)`}:{}},children:tag},i))});}function balanceTags(tags,gap,justifyContent){if(typeof window===\"undefined\")return[tags];// Estimate tag widths\nconst font=window.getComputedStyle(document.body);const fontSize=parseFloat(font.fontSize)||15;const avgCharWidth=fontSize*.6;const containerWidth=document.body.clientWidth*.9// estimate\n;let rows=[];let currentRow=[];let currentWidth=0;for(let i=0;i<tags.length;i++){const tag=tags[i];const tagWidth=tag.length*avgCharWidth+32// 32px padding estimate\n;if(currentWidth+tagWidth+(currentRow.length>0?gap:0)>containerWidth&&currentRow.length>0){rows.push(currentRow);currentRow=[tag];currentWidth=tagWidth;}else{currentRow.push(tag);currentWidth+=tagWidth+(currentRow.length>1?gap:0);}}if(currentRow.length)rows.push(currentRow);// Ensure at least 2 rows if possible\nif(rows.length===1&&rows[0].length>1){const mid=Math.ceil(rows[0].length/2);rows=[rows[0].slice(0,mid),rows[0].slice(mid)];}// Aggressive balance: keep moving tags from the end of the longest row to the start of the shortest row until all rows differ by at most 1 in length\nlet changed=true;while(changed){changed=false;let maxRowIdx=0;let minRowIdx=0;for(let i=1;i<rows.length;i++){if(rows[i].length>rows[maxRowIdx].length)maxRowIdx=i;if(rows[i].length<rows[minRowIdx].length)minRowIdx=i;}if(rows.length>1&&rows[maxRowIdx].length-rows[minRowIdx].length>1&&rows[maxRowIdx].length>1){// Move the last tag from the longest row to the start of the shortest row\nconst moved=rows[maxRowIdx].pop();rows[minRowIdx].unshift(moved);changed=true;}}return rows;}addPropertyControls(TagList,{tags:{type:ControlType.String,title:\"TagList\",defaultValue:\"Design, Development, Branding\",placeholder:\"Comma separated tags\",displayTextArea:false},padding:{type:ControlType.Object,title:\"Padding\",controls:{top:{type:ControlType.Number,defaultValue:8,min:0,max:32,step:1,title:\"Top\"},right:{type:ControlType.Number,defaultValue:16,min:0,max:32,step:1,title:\"Right\"},bottom:{type:ControlType.Number,defaultValue:8,min:0,max:32,step:1,title:\"Bottom\"},left:{type:ControlType.Number,defaultValue:16,min:0,max:32,step:1,title:\"Left\"}},defaultValue:{top:8,right:16,bottom:8,left:16}},borderRadius:{type:ControlType.Number,title:\"Radius\",defaultValue:8,min:0,max:32,step:1},backgroundColor:{type:ControlType.Color,title:\"Background\",defaultValue:\"#F5F5F5\"},textColor:{type:ControlType.Color,title:\"Text Color\",defaultValue:\"#000000\"},font:{type:ControlType.Font,title:\"Font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:\"15px\",variant:\"Medium\",letterSpacing:\"-0.01em\",lineHeight:\"1.3em\",// Add these two lines to expose letterSpacing and textTransform in the font panel\nletterSpacingControl:true,textTransformControl:true}},gap:{type:ControlType.Number,title:\"Gap (X)\",defaultValue:8,min:0,max:32,step:1},rowGap:{type:ControlType.Number,title:\"Gap (Y)\",defaultValue:8,min:0,max:32,step:1},alignment:{type:ControlType.Enum,title:\"Alignment\",options:[\"left\",\"center\",\"right\"],optionTitles:[\"Left\",\"Center\",\"Right\"],defaultValue:\"left\",displaySegmentedControl:true},blur:{type:ControlType.Number,title:\"Background Blur\",defaultValue:0,min:0,max:32,step:1},wrapBalance:{type:ControlType.Boolean,title:\"Balance Rows\",defaultValue:false,enabledTitle:\"On\",disabledTitle:\"Off\"},letterSpacing:{type:ControlType.String,title:\"Letter Spacing\",defaultValue:\"-0.01em\",placeholder:\"e.g. 0.1em\"},textTransform:{type:ControlType.Enum,title:\"Text Transform\",options:[\"none\",\"uppercase\",\"lowercase\",\"capitalize\"],optionTitles:[\"None\",\"UPPERCASE\",\"lowercase\",\"Capitalize\"],defaultValue:\"none\",displaySegmentedControl:true}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"TagList\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"auto\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./TagList.map"],"mappings":"yQAMG,SAAwB,EAAQ,EAAM,CAAC,GAAK,CAAC,OAAK,gCAAgC,UAAQ,eAAa,kBAAgB,YAAU,OAAK,MAAI,QAAM,YAAU,OAAK,GAAG,EAAY,EAAQ,EAAK,MAAM,IAAI,CAAC,IAAI,GAAG,EAAE,MAAM,CAAC,CAAC,OAAO,QAAQ,CAAK,EAAe,aAA8G,OAA9F,IAAY,WAAS,EAAe,UAAY,IAAY,UAAQ,EAAe,YAA+B,EAAK,MAAM,CAAC,MAAM,CAAC,QAAQ,OAAO,SAAS,OAAO,IAAI,GAAG,EAAM,SAAS,IAAA,GAAuB,EAAb,EAAM,OAAW,KAAK,EAAI,IAAI,iBAAe,GAAG,EAAM,SAAS,WAAW,MAAM,GAAO,EAAM,QAAQ,OAAO,OAAO,IAAA,GAAU,aAAa,aAAa,CAAC,SAAS,EAAQ,OAAO,GAAG,EAAM,YAAY,EAAY,EAAQ,EAAI,EAAe,CAAC,KAAK,EAAI,IAAsB,EAAK,MAAM,CAAC,MAAM,CAAC,QAAQ,OAAO,IAAI,GAAG,EAAI,IAAI,iBAAe,MAAM,OAAO,aAAa,EAAO,EAAY,EAAQ,EAAI,EAAe,CAAC,OAAO,EAAE,EAAM,SAAS,IAAA,GAAuB,EAAb,EAAM,OAAW,EAAE,CAAC,SAAS,EAAI,KAAK,EAAI,IAAiB,EAAK,OAAO,CAAC,MAAM,CAAC,WAAW,EAAgB,MAAM,EAAU,e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