@primer/primitives
Version:
Typography, spacing, and color primitives for Primer design system
7 lines (6 loc) • 379 B
JavaScript
import { z } from 'zod';
import { schemaErrorMessage } from '../utilities/index.js';
const allowed = [100, 200, 300, 400, 500, 600, 700, 800, 900, 950];
export const fontWeightValue = z.number().refine(value => allowed.includes(value), value => ({
message: schemaErrorMessage(`Invalid font weight value: "${value}"`, `Font weight must be one of ${allowed.join(', ')}`),
}));