# typed: false # frozen_string_literal: true module Ariadne module UI module Typography class Component < Ariadne::BaseComponent option :type accepts_html_attributes do |html_attrs| html_attrs[:class] = Ariadne::ViewComponents.tailwind_merger.merge([style(type: @type), html_attrs[:class]].join(" ")) end def tag_name case type when :title :h1 when :heading :h2 when :subheading :h3 when :ann :h4 when :lead :p when :code :code else :span end end style do variants do type do title do [ "ariadne-scroll-m-20", "ariadne-text-4xl", "ariadne-font-extrabold", "ariadne-tracking-tight", "lg:ariadne-text-5xl", ] end heading do [ "ariadne-scroll-m-20", "ariadne-border-b", "ariadne-pb-2", "ariadne-text-3xl", "ariadne-font-semibold", "ariadne-tracking-tight", "first:ariadne-mt-0", ] end subheading do [ "ariadne-scroll-m-20", "ariadne-text-2xl", "ariadne-font-semibold", "ariadne-tracking-tight", ] end ann do [ "ariadne-scroll-m-20", "ariadne-text-xl", "ariadne-font-semibold", "ariadne-tracking-tight", ] end lede do [ "ariadne-text-xl", "ariadne-gray-90", ] end code do [ "ariadne-relative", "ariadne-rounded", "ariadne-bg-neutral-100", "ariadne-px-[0.3rem]", "ariadne-py-[0.2rem]", "ariadne-font-mono", "ariadne-text-sm", "ariadne-font-semibold", ] end end end end end end end end