23 lines
536 B
TypeScript
23 lines
536 B
TypeScript
|
|
import {
|
||
|
|
type ControlModel,
|
||
|
|
createTypographyControl,
|
||
|
|
} from '$shared/lib';
|
||
|
|
|
||
|
|
export function createTypographyControlManager(configs: ControlModel[]) {
|
||
|
|
const controls = $state(
|
||
|
|
configs.map(({ id, increaseLabel, decreaseLabel, controlLabel, ...config }) => ({
|
||
|
|
id,
|
||
|
|
increaseLabel,
|
||
|
|
decreaseLabel,
|
||
|
|
controlLabel,
|
||
|
|
instance: createTypographyControl(config),
|
||
|
|
})),
|
||
|
|
);
|
||
|
|
|
||
|
|
return {
|
||
|
|
get controls() {
|
||
|
|
return controls;
|
||
|
|
},
|
||
|
|
};
|
||
|
|
}
|