Shopify/polaris-tokens

Remove tokensToJson from src/utils to format/utils

tmlayton opened this issue · 1 comments

src/utils is published and tokensToJson is only for internals related to Theo. It belongs in format/utils

export function tokensToJson(data: ImmutableStyleMap) {
return data.toJS().props.reduce(
(accumulator: any, prop: any) => ({
...accumulator,
[prop.name]: prop.originalValue,
}),
{},
);
}

This also results in a type being importing from Theo which, when importing from this file in Polaris React, breaks the Polaris React build.

import { ImmutableStyleMap } from 'theo';
import { Config } from './types';
export declare function hueRotationFn(rotation: number): (hue: number) => number;
export declare function saturationAdjustmentFn(adjustment: number): (saturation: number) => number;
export declare function tokensToJson(data: ImmutableStyleMap): any;
export declare function mergeConfigs(base: Config, extended: Config): {};