import { themeTokens } from "../data/tokens.js";
const tokens = themeTokens;
const cssVar = (name) => `var(--${name})`;
const kebab = (value) => value.replace(/_/g, "-");
const dropPrefix = (value, prefix) => value.startsWith(`${prefix}_`) ? value.slice(prefix.length + 1) : value;
function colorPrimitiveHex(key) {
  return tokens.color.primitive[key];
}
function colorPrimitiveVar(key) {
  return cssVar(`color-${kebab(key)}`);
}
function spacingPaddingPx(key) {
  return tokens.spacing.padding[key];
}
function spacingPaddingVar(key) {
  const suffix = kebab(dropPrefix(key, "padding"));
  return cssVar(`spacing-padding-${suffix}`);
}
function spacingGapPx(key) {
  return tokens.spacing.gap[key];
}
function spacingGapVar(key) {
  const suffix = kebab(dropPrefix(key, "gap"));
  return cssVar(`spacing-gap-${suffix}`);
}
function layoutBreakpointPx(key) {
  return tokens.layout.breakpoint[key];
}
function layoutBreakpointVar(key) {
  return cssVar(`theme-breakpoint-${kebab(key)}-start`);
}
function layoutSizePx(key) {
  return tokens.layout.size[key];
}
function layoutSizeVar(key) {
  return cssVar(`theme-size-${kebab(key)}`);
}
function layoutRadiusSizePx(key) {
  return tokens.layout.radius.size[key];
}
function layoutRadiusSizeVar(key) {
  const suffix = kebab(dropPrefix(key, "size"));
  return cssVar(`theme-radius-${suffix}`);
}
function layoutRadiusLevelPx(key) {
  return tokens.layout.radius.level[key];
}
function layoutRadiusLevelVar(key) {
  return cssVar(`theme-radius-${kebab(key)}`);
}
function typographyVariants(category) {
  return tokens.typography[category];
}
export {
  colorPrimitiveHex,
  colorPrimitiveVar,
  layoutBreakpointPx,
  layoutBreakpointVar,
  layoutRadiusLevelPx,
  layoutRadiusLevelVar,
  layoutRadiusSizePx,
  layoutRadiusSizeVar,
  layoutSizePx,
  layoutSizeVar,
  spacingGapPx,
  spacingGapVar,
  spacingPaddingPx,
  spacingPaddingVar,
  typographyVariants
};
