@use 'sass:map';
@use '../../dist/letsui.tokens.scss' as *;

$breakpoint: (
  1xs: 320px,
  sm: 768px,
  md: 1024px,
  lg: 1280px,
  1xl: 1440px,
);
$border: (
  radius: (
    xs: token('lui.border.radius.xs'),
    sm: token('lui.border.radius.sm'),
    md: token('lui.border.radius.md'),
    lg: token('lui.border.radius.lg'),
    circle: token('lui.border.radius.circle'),
    none: token('lui.border.radius.none'),
  ),
  width: (
    0: token('lui.border.width.0'),
    1: token('lui.border.width.1'),
    2: token('lui.border.width.2'),
  ),
);
$color: (
  primitive: (
    primary: (
      1: token('lui.brand.color.primary.1'),
      2: token('lui.brand.color.primary.2'),
      3: token('lui.brand.color.primary.3'),
      4: token('lui.brand.color.primary.4'),
      5: token('lui.brand.color.primary.5'),
      6: token('lui.brand.color.primary.6'),
      7: token('lui.brand.color.primary.7'),
      8: token('lui.brand.color.primary.8'),
    ),
    secondary: (
      1: token('lui.brand.color.secondary.1'),
      2: token('lui.brand.color.secondary.2'),
      3: token('lui.brand.color.secondary.3'),
      4: token('lui.brand.color.secondary.4'),
      5: token('lui.brand.color.secondary.5'),
      6: token('lui.brand.color.secondary.6'),
      7: token('lui.brand.color.secondary.7'),
      8: token('lui.brand.color.secondary.8'),
    ),
    blue: (
      1: token('lui.color.blue.1'),
      2: token('lui.color.blue.2'),
      3: token('lui.color.blue.3'),
      4: token('lui.color.blue.4'),
      5: token('lui.color.blue.5'),
      6: token('lui.color.blue.6'),
      7: token('lui.color.blue.7'),
      8: token('lui.color.blue.8'),
    ),
    gray: (
      1: token('lui.color.gray.1'),
      2: token('lui.color.gray.2'),
      3: token('lui.color.gray.3'),
      4: token('lui.color.gray.4'),
      5: token('lui.color.gray.5'),
      6: token('lui.color.gray.6'),
      7: token('lui.color.gray.7'),
      8: token('lui.color.gray.8'),
    ),
    green: (
      1: token('lui.color.green.1'),
      2: token('lui.color.green.2'),
      3: token('lui.color.green.3'),
      4: token('lui.color.green.4'),
      5: token('lui.color.green.5'),
      6: token('lui.color.green.6'),
      7: token('lui.color.green.7'),
      8: token('lui.color.green.8'),
    ),
    orange: (
      1: token('lui.color.orange.1'),
      2: token('lui.color.orange.2'),
      3: token('lui.color.orange.3'),
      4: token('lui.color.orange.4'),
      5: token('lui.color.orange.5'),
      6: token('lui.color.orange.6'),
      7: token('lui.color.orange.7'),
      8: token('lui.color.orange.8'),
    ),
    red: (
      1: token('lui.color.red.1'),
      2: token('lui.color.red.2'),
      3: token('lui.color.red.3'),
      4: token('lui.color.red.4'),
      5: token('lui.color.red.5'),
      6: token('lui.color.red.6'),
      7: token('lui.color.red.7'),
      8: token('lui.color.red.8'),
    ),
    violet: (
      1: token('lui.color.violet.1'),
      2: token('lui.color.violet.2'),
      3: token('lui.color.violet.3'),
      4: token('lui.color.violet.4'),
      5: token('lui.color.violet.5'),
      6: token('lui.color.violet.6'),
      7: token('lui.color.violet.7'),
      8: token('lui.color.violet.8'),
    ),
  ),
  semantic: (
    bg: (
      surface: (
        primary: token('lui.color.primary.background.surface'),
        secondary: token('lui.color.secondary.background.surface'),
        info: token('lui.color.info.background.surface'),
        danger: token('lui.color.danger.background.surface'),
        success: token('lui.color.success.background.surface'),
        caution: token('lui.color.caution.background.surface'),
        neutral: token('lui.color.neutral.background.surface'),
      ),
      container: (
        primary: token('lui.color.primary.background.container'),
        secondary: token('lui.color.secondary.background.container'),
        info: token('lui.color.info.background.container'),
        danger: token('lui.color.danger.background.container'),
        success: token('lui.color.success.background.container'),
        caution: token('lui.color.caution.background.container'),
        neutral: token('lui.color.neutral.background.container'),
        overlay: token('lui.color.neutral.background.overlay'),
      ),
    ),

    border: (
      divisor: token('lui.color.neutral.border.divisor'),
      stroke: (
        neutral: token('lui.color.neutral.border.stroke'),
        primary: token('lui.color.primary.border.stroke'),
        secondary: token('lui.color.secondary.border.stroke'),
        info: token('lui.color.info.border.stroke'),
        danger: token('lui.color.danger.border.stroke'),
        success: token('lui.color.success.border.stroke'),
        caution: token('lui.color.caution.border.stroke'),
      ),
    ),

    text: (
      heading: token('lui.color.neutral.text.heading'),
      body: token('lui.color.neutral.text.body'),
      inverse: token('lui.color.neutral.text.inverse'),
      error: token('lui.color.danger.text.error'),
      link: token('lui.color.link.default'),
      link-visited: token('lui.color.link.visited'),
    ),

    icon: (
      primary: token('lui.color.primary.icon.default'),
      secondary: token('lui.color.secondary.icon.default'),
      info: token('lui.color.info.icon.default'),
      danger: token('lui.color.danger.icon.default'),
      success: token('lui.color.success.icon.default'),
      caution: token('lui.color.caution.icon.default'),
      neutral: token('lui.color.neutral.icon.default'),
      inverse: token('lui.color.neutral.icon.inverse'),
    ),
  ),
);
$elevation: (
  base: token('lui.elevation.base'),
  hovered: token('lui.elevation.hovered'),
  floating: token('lui.elevation.floating'),
  overlay: token('lui.elevation.overlay'),
);
$opacity: (
  disabled: token('lui.opacity.disabled'),
  hidden: token('lui.opacity.hidden'),
  visible: token('lui.opacity.visible'),
);
$space: (
  fixed: (
    0: token('lui.spacing.fixed.0'),
    8: token('lui.spacing.fixed.8'),
    16: token('lui.spacing.fixed.16'),
    24: token('lui.spacing.fixed.24'),
    32: token('lui.spacing.fixed.32'),
    40: token('lui.spacing.fixed.40'),
  ),
  fluid: (
    2: token('lui.spacing.fluid.2'),
    4: token('lui.spacing.fluid.4'),
    8: token('lui.spacing.fluid.8'),
    12: token('lui.spacing.fluid.12'),
    16: token('lui.spacing.fluid.16'),
    20: token('lui.spacing.fluid.20'),
    24: token('lui.spacing.fluid.24'),
    32: token('lui.spacing.fluid.32'),
    40: token('lui.spacing.fluid.40'),
    48: token('lui.spacing.fluid.48'),
    56: token('lui.spacing.fluid.56'),
    64: token('lui.spacing.fluid.64'),
    72: token('lui.spacing.fluid.72'),
    80: token('lui.spacing.fluid.80'),
  ),
);
$typography: (
  font: (
    heading: token('lui.brand.typography.font-family.heading'),
    body: token('lui.brand.typography.font-family.body'),
  ),

  scales: (
    display: (
      family: heading,
      size: 3xl,
      weight: regular,
      case: none,
    ),
    title: (
      family: heading,
      size: 2xl,
      weight: bold,
      case: none,
    ),
    headline: (
      family: heading,
      size: 1xl,
      weight: semibold,
      case: none,
    ),
    subtitle: (
      family: heading,
      size: lg,
      weight: regular,
      case: none,
    ),
    block-title: (
      family: heading,
      size: md,
      weight: medium,
      case: none,
    ),
    subheadline: (
      family: heading,
      size: sm,
      weight: regular,
      case: none,
    ),
    overtitle: (
      family: heading,
      size: 3xs,
      weight: medium,
      case: uppercase,
    ),
    body--lg: (
      family: body,
      size: 1xs,
      weight: regular,
      case: none,
    ),
    body--md: (
      family: body,
      size: 2xs,
      weight: regular,
      case: none,
    ),
    body--sm: (
      family: body,
      size: 3xs,
      weight: regular,
      case: none,
    ),
  ),

  weight: (
    regular: token('lui.typography.weight.regular'),
    medium: token('lui.typography.weight.medium'),
    semibold: token('lui.typography.weight.semibold'),
    bold: token('lui.typography.weight.bold'),
  ),

  case: (
    none: token('lui.typography.case.none'),
    lowercase: token('lui.typography.case.lowercase'),
    uppercase: token('lui.typography.case.uppercase'),
  ),

  decoration: (
    none: token('lui.typography.decoration.none'),
    underline: token('lui.typography.decoration.underline'),
    line-through: token('lui.typography.decoration.line-through'),
  ),

  size: (
    3xl: token('lui.brand.typography.font-size.3xl'),
    2xl: token('lui.brand.typography.font-size.2xl'),
    1xl: token('lui.brand.typography.font-size.1xl'),
    lg: token('lui.brand.typography.font-size.lg'),
    md: token('lui.brand.typography.font-size.md'),
    sm: token('lui.brand.typography.font-size.sm'),
    1xs: token('lui.brand.typography.font-size.1xs'),
    2xs: token('lui.brand.typography.font-size.2xs'),
    3xs: token('lui.brand.typography.font-size.3xs'),
  ),

  line-height: (
    heading: token('lui.brand.typography.line-height.heading'),
    body: token('lui.brand.typography.line-height.body'),
  ),
);
