{"version":3,"file":"SkeletonShape.cjs","sources":["../../../../src/lib/Skeleton/SkeletonShape.tsx"],"sourcesContent":["import {useMemo, forwardRef} from 'react';\nimport classNames from 'classnames';\nimport {useLocalTheme} from 'css-vars-hook';\n\nimport type {DataAttributes, LibraryProps} from '@/internal/LibraryAPI';\nimport {useLinkRefs} from '@/internal/hooks/useLinkRefs.ts';\n\nimport classes from './Skeleton.module.css';\nimport type {SkeletonProps} from './SkeletonTypes.ts';\nimport {normalizeUnit} from './normalizeUnit.ts';\n\nexport type Props = DataAttributes &\n    LibraryProps &\n    SkeletonProps & {\n        borderRadius?: number;\n    };\n\nexport const SkeletonShape = forwardRef<HTMLDivElement, Props>(\n    (\n        {\n            className,\n            width = 'fluid',\n            height,\n            borderRadius = 6,\n            marginY = 0,\n            marginX = 0,\n            ...nativeProps\n        },\n        ref\n    ) => {\n        const {LocalRoot, ref: innerRef} = useLocalTheme<HTMLDivElement>();\n        useLinkRefs(ref, innerRef);\n        const theme = useMemo(\n            () => ({\n                width: normalizeUnit(width),\n                height: normalizeUnit(height),\n                'border-radius': borderRadius,\n                'margin-y': marginY,\n                'margin-x': marginX,\n            }),\n            [borderRadius, height, marginX, marginY, width]\n        );\n        return (\n            <LocalRoot\n                {...nativeProps}\n                theme={theme}\n                className={classNames(classes.skeletonShape, className)}\n            />\n        );\n    }\n);\n\nSkeletonShape.displayName = 'SkeletonShape';\n"],"names":["SkeletonShape","forwardRef","className","width","height","borderRadius","marginY","marginX","nativeProps","ref","LocalRoot","innerRef","useLocalTheme","useLinkRefs","theme","useMemo","normalizeUnit","jsx","classNames","classes"],"mappings":"kUAiBaA,EAAgBC,EAAA,WACzB,CACI,CACI,UAAAC,EACA,MAAAC,EAAQ,QACR,OAAAC,EACA,aAAAC,EAAe,EACf,QAAAC,EAAU,EACV,QAAAC,EAAU,EACV,GAAGC,GAEPC,IACC,CACD,KAAM,CAAC,UAAAC,EAAW,IAAKC,CAAA,EAAYC,EAAAA,cAA8B,EACjEC,EAAA,YAAYJ,EAAKE,CAAQ,EACzB,MAAMG,EAAQC,EAAA,QACV,KAAO,CACH,MAAOC,gBAAcb,CAAK,EAC1B,OAAQa,gBAAcZ,CAAM,EAC5B,gBAAiBC,EACjB,WAAYC,EACZ,WAAYC,CAAA,GAEhB,CAACF,EAAcD,EAAQG,EAASD,EAASH,CAAK,CAClD,EAEI,OAAAc,EAAA,IAACP,EAAA,CACI,GAAGF,EACJ,MAAAM,EACA,UAAWI,EAAWC,UAAQ,cAAejB,CAAS,CAAA,CAC1D,CAAA,CAGZ,EAEAF,EAAc,YAAc"}