# typed: false # frozen_string_literal: true module Ariadne module UI module Typography class Component < Ariadne::BaseComponent option :tag, optional: true option :type option :size, optional: true accepts_html_attributes do |html_attrs| html_attrs[:class] = Ariadne::ViewComponents.tailwind_merger.merge([style(type:, size:), html_attrs[:class]].join(" ")) end def tag_name return tag if tag.present? case type when :title :h1 when :heading :h2 when :subheading :h3 when :ann :h4 when :lede :p when :code :code else :span end end style do base do [ "ariadne-text-content", "dark:ariadne-text-content-dark", ] end variants do size do sm do [ "ariadne-text-sm", ] end base do [ "ariadne-text-base", ] end lg do [ "ariadne-text-lg", ] end end 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-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-text-slate-500", ] 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 muted do [ "ariadne-text-muted-foreground", ] end end end end end end end end