# frozen_string_literal: true # :nocov: module Yattho module YARD # The set of documented components (and associated metadata). class ComponentManifest COMPONENTS = { Yattho::Beta::RelativeTime => {}, Yattho::Beta::IconButton => {}, Yattho::Beta::Button => {}, Yattho::Alpha::SegmentedControl => {}, Yattho::Alpha::Layout => {}, Yattho::Alpha::HellipButton => {}, Yattho::Alpha::Image => {}, Yattho::LocalTime => { js: true }, Yattho::Alpha::OcticonSymbols => {}, Yattho::Alpha::ImageCrop => { js: true }, Yattho::IconButton => { js: true }, Yattho::Beta::AutoComplete => { js: true }, Yattho::Beta::AutoComplete::Item => {}, Yattho::Beta::Avatar => {}, Yattho::Beta::AvatarStack => {}, Yattho::Beta::BaseButton => {}, Yattho::Alpha::Banner => { js: true }, Yattho::Beta::Blankslate => {}, Yattho::Beta::BorderBox => {}, Yattho::Beta::BorderBox::Header => {}, Yattho::Box => {}, Yattho::Beta::Breadcrumbs => {}, Yattho::ButtonComponent => { js: true }, Yattho::Beta::ButtonGroup => {}, Yattho::Alpha::ButtonMarketing => {}, Yattho::Beta::ClipboardCopy => { js: true }, Yattho::Beta::CloseButton => {}, Yattho::Beta::Counter => {}, Yattho::Beta::Details => {}, Yattho::Alpha::Dialog => {}, Yattho::Alpha::Dropdown => { js: true }, Yattho::Beta::Flash => {}, Yattho::Beta::Heading => {}, Yattho::Alpha::HiddenTextExpander => {}, Yattho::Beta::Label => {}, Yattho::LayoutComponent => {}, Yattho::Beta::Link => { js: true }, Yattho::Beta::Markdown => {}, Yattho::Alpha::Menu => {}, Yattho::Navigation::TabComponent => {}, Yattho::Beta::Octicon => {}, Yattho::Beta::Popover => {}, Yattho::Beta::ProgressBar => {}, Yattho::Beta::State => {}, Yattho::Beta::Spinner => {}, Yattho::Beta::Subhead => {}, Yattho::Alpha::TabContainer => { js: true }, Yattho::Beta::Text => {}, Yattho::TimeAgoComponent => { js: true }, Yattho::Beta::TimelineItem => {}, Yattho::Tooltip => {}, Yattho::Truncate => {}, Yattho::Beta::Truncate => {}, Yattho::Alpha::UnderlineNav => {}, Yattho::Alpha::UnderlinePanels => { js: true }, Yattho::Alpha::TabNav => {}, Yattho::Alpha::TabPanels => { js: true }, Yattho::Alpha::Tooltip => { js: true }, Yattho::Alpha::ToggleSwitch => { js: true }, # Examples can be seen in the NavList docs Yattho::Alpha::NavList => { js: true }, Yattho::Alpha::NavList::Item => { js: true, examples: false }, Yattho::Alpha::NavList::Section => { js: true, examples: false }, # ActionList is a base component that should not be used by itself, and thus # does not have examples of its own Yattho::Alpha::ActionList => { js: true, examples: false }, Yattho::Alpha::ActionList::Divider => { examples: false }, Yattho::Alpha::ActionList::Heading => { examples: false }, Yattho::Alpha::ActionList::Item => { examples: false }, # Forms Yattho::Alpha::TextField => { form_component: true } }.freeze class << self def each(&block) COMPONENTS.keys.each(&block) end def components_with_docs @components_with_docs ||= COMPONENTS.keys end def all_components @all_components ||= Yattho::Component.descendants - [Yattho::BaseComponent] end def components_without_docs @components_without_docs ||= all_components - components_with_docs end def components_with_examples @components_with_examples ||= COMPONENTS.keys.select do |c| COMPONENTS[c].fetch(:examples, true) end end def components_requiring_js @components_requiring_js ||= COMPONENTS.keys.select do |c| COMPONENTS[c].fetch(:js, false) end end def form_components @form_components ||= COMPONENTS.keys.select do |c| COMPONENTS[c].fetch(:form_component, false) end end end end end end # :nocov: