@lobehub/ui
Version:
Lobe UI is an open-source UI component library for building AIGC web apps
1 lines • 2.29 kB
Source Map (JSON)
{"version":3,"file":"ActualSizeIcon.mjs","names":[],"sources":["../../../src/Image/viewer/ActualSizeIcon.tsx"],"sourcesContent":["'use client';\n\nimport { memo } from 'react';\n\nimport { styles } from '../style';\n\n// lucide's Expand, kept as four separate corners so each can be transformed on\n// its own. Expand and Shrink are not two unrelated glyphs: rotating each of\n// these corners 180° about its own quadrant centre maps Expand onto Shrink\n// exactly, coordinate for coordinate. That makes the toggle a transform\n// animation rather than a path interpolation, so it needs no morphing library\n// and stays on the compositor.\nconst CORNERS = [\n { d: 'm21 21-6-6m6 6v-4.8m0 4.8h-4.8', origin: '18px 18px' },\n { d: 'M3 16.2V21m0 0h4.8M3 21l6-6', origin: '6px 18px' },\n { d: 'M21 7.8V3m0 0h-4.8M21 3l-6 6', origin: '18px 6px' },\n { d: 'M3 7.8V3m0 0h4.8M3 3l6 6', origin: '6px 6px' },\n];\n\nexport interface ActualSizeIconProps {\n color?: string;\n fill?: string;\n height?: number | string;\n strokeWidth?: number | string;\n width?: number | string;\n}\n\nconst ActualSizeIcon = memo<ActualSizeIconProps>(\n ({ color = 'currentColor', fill = 'none', height = 24, strokeWidth = 2, width = 24 }) => (\n <svg\n fill={fill}\n height={height}\n stroke={color}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth={strokeWidth}\n viewBox=\"0 0 24 24\"\n width={width}\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n {CORNERS.map(({ d, origin }) => (\n <path\n className={styles.actualSizeCorner}\n d={d}\n key={d}\n style={{ transformOrigin: origin }}\n />\n ))}\n </svg>\n ),\n);\n\nActualSizeIcon.displayName = 'ActualSizeIcon';\n\nexport default ActualSizeIcon;\n"],"mappings":";;;;;AAYA,MAAM,UAAU;CACd;EAAE,GAAG;EAAkC,QAAQ;CAAY;CAC3D;EAAE,GAAG;EAA+B,QAAQ;CAAW;CACvD;EAAE,GAAG;EAAgC,QAAQ;CAAW;CACxD;EAAE,GAAG;EAA4B,QAAQ;CAAU;AACrD;AAUA,MAAM,iBAAiB,MACpB,EAAE,QAAQ,gBAAgB,OAAO,QAAQ,SAAS,IAAI,cAAc,GAAG,QAAQ,SAC9E,oBAAC,OAAD;CACQ;CACE;CACR,QAAQ;CACR,eAAc;CACd,gBAAe;CACF;CACb,SAAQ;CACD;CACP,OAAM;CAEL,UAAA,QAAQ,KAAK,EAAE,GAAG,aACjB,oBAAC,QAAD;EACE,WAAW,OAAO;EACf;EAEH,OAAO,EAAE,iBAAiB,OAAO;CAClC,GAFM,CAEN,CACF;AACE,CAAA,CAET;AAEA,eAAe,cAAc"}