Sha256: 114fbd81d5b4940b6d43e8ec574e4028578042cad5bc3ec59ea6e430cfecaae1
Contents?: true
Size: 981 Bytes
Versions: 148
Compression:
Stored size: 981 Bytes
Contents
# frozen_string_literal: true module Ariadne # Represents a linear timeline of events. Typically, this is shown # as part of the Conversation component. class TimelineComponent < Ariadne::Component DEFAULT_TAG = :div DEFAULT_CLASSES = "" # The sub-items(s) to render renders_many :items, lambda { |static_content = nil, &block| next static_content if static_content.present? view_context.capture { block&.call } } # @example Default # # <%= render(Ariadne::TimelineComponent.new) { "Example" } %> # # @param tag [Symbol, String] The rendered tag name # @param classes [String] <%= link_to_classes_docs %> # @param attributes [Hash] <%= link_to_attributes_docs %> def initialize(tag: DEFAULT_TAG, classes: "", attributes: {}) @tag = check_incoming_tag(DEFAULT_TAG, tag) @classes = class_names( DEFAULT_CLASSES, classes, ) @attributes = attributes end end end
Version data entries
148 entries across 148 versions & 1 rubygems