import { getCSSPropRawValue, } from '@graphprotocol/gds-css';
/**
 * Returns attributes to spread on the root element of a component that supports CSS props.
 *
 * @param component The component metadata object created with createComponent.
 * @param passedValues Object containing all the CSS prop values from the component props.
 * @param style Existing style object to merge with.
 * @returns Object with attributes to spread on the component's root element.
 */
export function getCSSPropsAttributes(component, passedValues, style) {
    const customProperties = {};
    for (const propName in passedValues) {
        const cssProp = component.getCSSPropByName(propName);
        const value = passedValues[propName];
        if (value === undefined)
            continue;
        customProperties[`--gds-passed-${cssProp.kebabName}`] = getCSSPropRawValue(cssProp, value);
    }
    return {
        style: { ...customProperties, ...style },
    };
}
//# sourceMappingURL=getCSSPropsAttributes.js.map