ariadne_view_components 0.0.93.1 → 0.0.94
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +9 -0
- data/README.md +13 -4
- data/app/assets/javascripts/ariadne_view_components.js +14 -14
- data/app/assets/javascripts/ariadne_view_components.js.br +0 -0
- data/app/assets/javascripts/ariadne_view_components.js.gz +0 -0
- data/app/assets/javascripts/ariadne_view_components.js.map +1 -1
- data/app/assets/stylesheets/ariadne_view_components.css +1 -1
- data/app/assets/stylesheets/ariadne_view_components.css.br +0 -0
- data/app/assets/stylesheets/ariadne_view_components.css.gz +0 -0
- data/app/components/ariadne/base_component.rb +25 -22
- data/app/components/ariadne/behaviors/tooltipable.rb +12 -12
- data/app/components/ariadne/form/checkbox/component.rb +2 -2
- data/app/components/ariadne/form/group/component.rb +1 -1
- data/app/components/ariadne/form/radio_button/component.rb +2 -2
- data/app/components/ariadne/form/select/component.rb +1 -1
- data/app/components/ariadne/form/text_field/component.html.erb +2 -2
- data/app/components/ariadne/form/text_field/component.rb +14 -7
- data/app/components/ariadne/form/toggle/component.rb +2 -2
- data/app/components/ariadne/form/toggle_group/component.rb +1 -1
- data/app/components/ariadne/form/toggle_group/option/component.rb +1 -1
- data/app/components/ariadne/layout/grid/component.rb +1 -1
- data/app/components/ariadne/layout/grid/item/component.rb +2 -2
- data/app/components/ariadne/layout/label_block/component.rb +1 -1
- data/app/components/ariadne/layout/narrow/component.rb +1 -1
- data/app/components/ariadne/ui/accordion/component.rb +3 -1
- data/app/components/ariadne/ui/accordion/item/component.html.erb +10 -10
- data/app/components/ariadne/ui/accordion/item/component.rb +12 -3
- data/app/components/ariadne/ui/avatar/component.html.erb +9 -7
- data/app/components/ariadne/ui/avatar/component.rb +55 -7
- data/app/components/ariadne/ui/badge/component.rb +35 -16
- data/app/components/ariadne/ui/banner/component.html.erb +23 -0
- data/app/components/ariadne/ui/banner/component.rb +226 -0
- data/app/components/ariadne/ui/banner/component.ts +46 -0
- data/app/components/ariadne/ui/blankslate/component.html.erb +2 -2
- data/app/components/ariadne/ui/blankslate/component.rb +12 -1
- data/app/components/ariadne/ui/button/component.rb +35 -24
- data/app/components/ariadne/ui/card/body/component.rb +1 -1
- data/app/components/ariadne/ui/card/component.rb +11 -7
- data/app/components/ariadne/ui/card/footer/component.rb +1 -1
- data/app/components/ariadne/ui/card/header/component.html.erb +2 -2
- data/app/components/ariadne/ui/card/header/component.rb +25 -16
- data/app/components/ariadne/ui/clipboard_copy/component.html.erb +1 -0
- data/app/components/ariadne/ui/clipboard_copy/component.rb +17 -21
- data/app/components/ariadne/ui/clipboard_copy/component.ts +15 -0
- data/app/components/ariadne/ui/color_dot/component.html.erb +5 -5
- data/app/components/ariadne/ui/color_dot/component.rb +19 -4
- data/app/components/ariadne/ui/combobox/component.html.erb +1 -1
- data/app/components/ariadne/ui/combobox/component.rb +54 -23
- data/app/components/ariadne/ui/combobox/component.ts +2 -0
- data/app/components/ariadne/ui/dialog/body/component.html.erb +3 -0
- data/app/components/ariadne/ui/dialog/body/component.rb +28 -0
- data/app/components/ariadne/ui/dialog/component.html.erb +25 -24
- data/app/components/ariadne/ui/dialog/component.rb +87 -18
- data/app/components/ariadne/ui/dialog/component.ts +5 -1
- data/app/components/ariadne/ui/dialog/footer/component.html.erb +3 -0
- data/app/components/ariadne/ui/dialog/footer/component.rb +34 -0
- data/app/components/ariadne/ui/heroicon/component.rb +21 -21
- data/app/components/ariadne/ui/image/component.rb +11 -23
- data/app/components/ariadne/ui/link/component.html.erb +1 -3
- data/app/components/ariadne/ui/link/component.rb +17 -4
- data/app/components/ariadne/ui/list/component.html.erb +5 -9
- data/app/components/ariadne/ui/list/component.rb +31 -7
- data/app/components/ariadne/ui/list/item/component.rb +6 -5
- data/app/components/ariadne/ui/pagination/component.rb +1 -2
- data/app/components/ariadne/ui/popover/component.html.erb +1 -1
- data/app/components/ariadne/ui/popover/component.rb +31 -26
- data/app/components/ariadne/ui/relative_time/component.html.erb +1 -0
- data/app/components/ariadne/ui/{time_ago → relative_time}/component.rb +15 -15
- data/app/components/ariadne/ui/{time_ago → relative_time}/component.ts +1 -1
- data/app/components/ariadne/ui/shortcut/component.html.erb +0 -1
- data/app/components/ariadne/ui/shortcut/component.rb +31 -5
- data/app/components/ariadne/ui/shortcut/component.ts +1 -1
- data/app/components/ariadne/ui/skeleton/component.rb +2 -8
- data/app/components/ariadne/ui/stats_panel/component.html.erb +3 -3
- data/app/components/ariadne/ui/stats_panel/component.rb +25 -1
- data/app/components/ariadne/ui/stats_panel/item/component.html.erb +3 -3
- data/app/components/ariadne/ui/stats_panel/item/component.rb +6 -6
- data/app/components/ariadne/ui/table/cell/component.rb +1 -1
- data/app/components/ariadne/ui/table/row/component.rb +1 -1
- data/app/components/ariadne/ui/typography/component.rb +3 -1
- data/app/frontend/controllers/tooltip_controller.ts +8 -3
- data/app/frontend/stylesheets/ariadne_view_components.css +1 -0
- data/app/frontend/stylesheets/theme.css +88 -0
- data/app/frontend/utils/createController.ts +9 -0
- data/app/helpers/ariadne/color_helper.rb +158 -0
- data/app/helpers/ariadne/form_helper.rb +1 -0
- data/app/helpers/ariadne/size_helper.rb +7 -0
- data/app/lib/ariadne/attributes_helper.rb +4 -4
- data/app/lib/ariadne/view_component/style_variants.rb +1 -1
- data/app/lib/ariadne/view_helper.rb +0 -6
- data/lib/ariadne/accessibility.rb +64 -0
- data/lib/ariadne/forms/dsl/form_object.rb +5 -1
- data/lib/ariadne/forms/dsl/input.rb +1 -1
- data/lib/ariadne/static/generate_arguments.rb +54 -0
- data/lib/ariadne/static/generate_audited_at.rb +17 -0
- data/lib/ariadne/static/generate_constants.rb +19 -0
- data/lib/ariadne/static/generate_previews.rb +53 -0
- data/lib/ariadne/static/generate_statuses.rb +17 -0
- data/lib/ariadne/static/generate_structure.rb +279 -0
- data/lib/ariadne/static.rb +68 -0
- data/lib/ariadne/view_components/constants.rb +2 -2
- data/lib/ariadne/view_components/version.rb +1 -1
- data/lib/ariadne/view_components.rb +0 -51
- data/lib/ariadne/yard/component_manifest.rb +81 -81
- data/lib/ariadne/yard/component_ref.rb +1 -1
- data/lib/ariadne/yard/docs_helper.rb +24 -16
- data/lib/ariadne/yard/dry_initializer/common_handler.rb +103 -0
- data/lib/ariadne/yard/dry_initializer/option_handler.rb +38 -0
- data/lib/ariadne/yard/dry_initializer/param_handler.rb +57 -0
- data/lib/ariadne/yard/registry.rb +2 -5
- data/lib/ariadne/yard/{info_arch_docs_helper.rb → structure_docs_helper.rb} +5 -5
- data/lib/ariadne/yard.rb +20 -8
- data/lib/rubocop/config/default.yml +0 -3
- metadata +34 -37
- data/app/components/ariadne/behaviors/captionable.rb +0 -55
- data/app/components/ariadne/turbo/frame/component.html.erb +0 -3
- data/app/components/ariadne/turbo/frame/component.rb +0 -16
- data/app/components/ariadne/turbo/stream_action/component.html.erb +0 -4
- data/app/components/ariadne/turbo/stream_action/component.rb +0 -25
- data/app/components/ariadne/ui/data_table/component.html.erb +0 -1
- data/app/components/ariadne/ui/data_table/component.rb +0 -11
- data/app/components/ariadne/ui/flash/component.html.erb +0 -18
- data/app/components/ariadne/ui/flash/component.rb +0 -151
- data/app/components/ariadne/ui/flash/component.ts +0 -56
- data/app/components/ariadne/ui/overlay/component.html.erb +0 -12
- data/app/components/ariadne/ui/overlay/component.rb +0 -54
- data/app/components/ariadne/ui/overlay/component.ts +0 -92
- data/app/components/ariadne/ui/time_ago/component.html.erb +0 -1
- data/lib/ariadne/view_components/commands.rb +0 -90
- data/lib/ariadne/view_components/statuses.rb +0 -14
- data/lib/ariadne/view_components/upstream.rb +0 -19
- data/lib/ariadne/yard/lookbook_pages_backend.rb +0 -235
- data/lib/rubocop/cop/ariadne/no_tag_memoize.rb +0 -44
- data/static/arguments.yml +0 -879
- data/static/assets/view-components.svg +0 -18
- data/static/classes.yml +0 -211
- data/static/constants.json +0 -743
- data/static/statuses.json +0 -58
- data/static/tailwindcss.yml +0 -727
- /data/app/components/ariadne/ui/{time_ago → relative_time}/en.yml +0 -0
| @@ -6,7 +6,7 @@ module Ariadne | |
| 6 6 | 
             
              module Yard
         | 
| 7 7 | 
             
                # Helper methods to use for yard documentation
         | 
| 8 8 | 
             
                module DocsHelper
         | 
| 9 | 
            -
                  def one_of(enumerable, lower: false, sort:  | 
| 9 | 
            +
                  def one_of(enumerable, lower: false, sort: false)
         | 
| 10 10 | 
             
                    # Sort the array if requested
         | 
| 11 11 | 
             
                    if sort && !enumerable.nil?
         | 
| 12 12 | 
             
                      enumerable = enumerable.sort do |a, b|
         | 
| @@ -36,8 +36,8 @@ module Ariadne | |
| 36 36 | 
             
                    "[Accessibility](#accessibility)"
         | 
| 37 37 | 
             
                  end
         | 
| 38 38 |  | 
| 39 | 
            -
                  def  | 
| 40 | 
            -
                    "[ | 
| 39 | 
            +
                  def link_to_html_attrs_docs
         | 
| 40 | 
            +
                    "[HTML attributes](/html-attrs)"
         | 
| 41 41 | 
             
                  end
         | 
| 42 42 |  | 
| 43 43 | 
             
                  def link_to_typography_docs
         | 
| @@ -45,32 +45,40 @@ module Ariadne | |
| 45 45 | 
             
                  end
         | 
| 46 46 |  | 
| 47 47 | 
             
                  def link_to_component(component)
         | 
| 48 | 
            -
                     | 
| 49 | 
            -
                    status_path = status_module.nil? ? "" : "#{status_module}/"
         | 
| 48 | 
            +
                    class_name, short_name = component_and_short_name(component)
         | 
| 50 49 |  | 
| 51 | 
            -
                    "[#{class_name}](/components/#{ | 
| 50 | 
            +
                    "[#{class_name}](/components/#{short_name.downcase})"
         | 
| 52 51 | 
             
                  end
         | 
| 53 52 |  | 
| 54 | 
            -
                  def  | 
| 55 | 
            -
                    "[ | 
| 53 | 
            +
                  def link_to_heroicons
         | 
| 54 | 
            +
                    "[Heroicon](https://heroicons.com/)"
         | 
| 56 55 | 
             
                  end
         | 
| 57 56 |  | 
| 58 57 | 
             
                  def link_to_heading_practices
         | 
| 59 58 | 
             
                    "[Learn more about best heading practices (WAI Headings)](https://www.w3.org/WAI/tutorials/page-structure/headings/)"
         | 
| 60 59 | 
             
                  end
         | 
| 61 60 |  | 
| 62 | 
            -
                  def  | 
| 63 | 
            -
                     | 
| 64 | 
            -
             | 
| 65 | 
            -
                    m  | 
| 66 | 
            -
             | 
| 61 | 
            +
                  def component_and_short_name(component)
         | 
| 62 | 
            +
                    name = component.name.sub("::Preview", "::Component")
         | 
| 63 | 
            +
                    m = name.match(/Ariadne::(?<name>.*)::Component/)
         | 
| 64 | 
            +
                    if m.nil? # e.g. `Ariadne::Behaviors::Caption`; three paths instad of four
         | 
| 65 | 
            +
                      m = name.match(/Ariadne::(?<name>.*)/)
         | 
| 66 | 
            +
                    end
         | 
| 67 | 
            +
                    [name, m[:name]]
         | 
| 67 68 | 
             
                  end
         | 
| 68 69 |  | 
| 69 70 | 
             
                  def pretty_default_value(tag, component)
         | 
| 70 | 
            -
                     | 
| 71 | 
            -
             | 
| 71 | 
            +
                    default = tag.respond_to?(:defaults) ? tag.defaults : nil
         | 
| 72 | 
            +
             | 
| 73 | 
            +
                    # For slots; eg.,
         | 
| 74 | 
            +
                    # `renders_one :title, lambda { |type: :subheading, **options|`;
         | 
| 75 | 
            +
                    # `type` has a default value of `:subheading`.
         | 
| 76 | 
            +
                    if default.nil?
         | 
| 77 | 
            +
                      results = /#{tag.name}:\s*([^,\s]+)/.match(tag.object.source)
         | 
| 78 | 
            +
                      default = results[1] if results
         | 
| 79 | 
            +
                    end
         | 
| 72 80 |  | 
| 73 | 
            -
                    return " | 
| 81 | 
            +
                    return "" unless default
         | 
| 74 82 |  | 
| 75 83 | 
             
                    constant_name = "#{component.name}::#{default}"
         | 
| 76 84 | 
             
                    constant_value = default.safe_constantize || constant_name.safe_constantize
         | 
| @@ -0,0 +1,103 @@ | |
| 1 | 
            +
            # frozen_string_literal: true
         | 
| 2 | 
            +
             | 
| 3 | 
            +
            module Ariadne
         | 
| 4 | 
            +
              module Yard
         | 
| 5 | 
            +
                module DryInitializer
         | 
| 6 | 
            +
                  module CommonHandler
         | 
| 7 | 
            +
                    def process
         | 
| 8 | 
            +
                      return unless reader?
         | 
| 9 | 
            +
             | 
| 10 | 
            +
                      # Define reader method
         | 
| 11 | 
            +
                      object = YARD::CodeObjects::MethodObject.new(namespace, reader_name)
         | 
| 12 | 
            +
                      register(object)
         | 
| 13 | 
            +
                      object.visibility = reader_visibility
         | 
| 14 | 
            +
                      object.dynamic = true
         | 
| 15 | 
            +
                      doc = "Reader method for the +#{definition_name}+ initializer parameter."
         | 
| 16 | 
            +
                      object.docstring = [comment, doc].compact.join("\n\n")
         | 
| 17 | 
            +
             | 
| 18 | 
            +
                      # Register as attribute unless it is already registered
         | 
| 19 | 
            +
                      return if namespace.attributes[:instance].key?(reader_name.to_sym)
         | 
| 20 | 
            +
             | 
| 21 | 
            +
                      namespace.attributes[:instance][reader_name.to_sym] = { read: object }
         | 
| 22 | 
            +
                    end
         | 
| 23 | 
            +
             | 
| 24 | 
            +
                    protected
         | 
| 25 | 
            +
             | 
| 26 | 
            +
                    def constructor
         | 
| 27 | 
            +
                      return @constructor if defined?(@constructor)
         | 
| 28 | 
            +
             | 
| 29 | 
            +
                      existing = namespace.meths.find(&:constructor?)
         | 
| 30 | 
            +
                      unless existing
         | 
| 31 | 
            +
                        @constructor = create_constructor
         | 
| 32 | 
            +
                        return @constructor
         | 
| 33 | 
            +
                      end
         | 
| 34 | 
            +
             | 
| 35 | 
            +
                      @constructor = if existing.namespace == namespace
         | 
| 36 | 
            +
                        existing
         | 
| 37 | 
            +
                      else
         | 
| 38 | 
            +
                        copy_parent_constructor(existing)
         | 
| 39 | 
            +
                      end
         | 
| 40 | 
            +
                    end
         | 
| 41 | 
            +
             | 
| 42 | 
            +
                    def create_constructor
         | 
| 43 | 
            +
                      YARD::CodeObjects::MethodObject.new(namespace, :initialize)
         | 
| 44 | 
            +
                    end
         | 
| 45 | 
            +
             | 
| 46 | 
            +
                    def copy_parent_constructor(existing_constructor)
         | 
| 47 | 
            +
                      YARD::CodeObjects::MethodObject.new(namespace, :initialize) do |new_constructor|
         | 
| 48 | 
            +
                        existing_constructor.copy_to(new_constructor)
         | 
| 49 | 
            +
             | 
| 50 | 
            +
                        # To allow replace arguments independent of parent
         | 
| 51 | 
            +
                        new_constructor.parameters = existing_constructor.parameters.map(&:dup)
         | 
| 52 | 
            +
                        # new_constructor.add_tag(*existing_constructor.tags.map(&:dup))
         | 
| 53 | 
            +
                      end
         | 
| 54 | 
            +
                    end
         | 
| 55 | 
            +
             | 
| 56 | 
            +
                    def definition_name
         | 
| 57 | 
            +
                      statement.parameters.first.jump(:tstring_content, :ident).source.delete(":") # FIXME: sometimes this randomly returns a symbol
         | 
| 58 | 
            +
                    end
         | 
| 59 | 
            +
             | 
| 60 | 
            +
                    def options
         | 
| 61 | 
            +
                      raw_options = statement.parameters[2] || statement.parameters[1]
         | 
| 62 | 
            +
                      return {} unless raw_options
         | 
| 63 | 
            +
             | 
| 64 | 
            +
                      raw_options.map do |o|
         | 
| 65 | 
            +
                        [o.first.jump(:tstring_content, :ident).source, o[1]]
         | 
| 66 | 
            +
                      end.to_h
         | 
| 67 | 
            +
                    end
         | 
| 68 | 
            +
             | 
| 69 | 
            +
                    def reader?
         | 
| 70 | 
            +
                      return true unless options.key?("reader:")
         | 
| 71 | 
            +
             | 
| 72 | 
            +
                      options["reader:"].jump(:tstring_content, :ident).source != "false"
         | 
| 73 | 
            +
                    end
         | 
| 74 | 
            +
             | 
| 75 | 
            +
                    def reader_name
         | 
| 76 | 
            +
                      if options.key?("as:")
         | 
| 77 | 
            +
                        options["as:"].jump(:tstring_content, :ident).source
         | 
| 78 | 
            +
                      else
         | 
| 79 | 
            +
                        definition_name
         | 
| 80 | 
            +
                      end
         | 
| 81 | 
            +
                    end
         | 
| 82 | 
            +
             | 
| 83 | 
            +
                    def reader_visibility
         | 
| 84 | 
            +
                      return :public unless options.key?("reader:")
         | 
| 85 | 
            +
             | 
| 86 | 
            +
                      options["reader:"].jump(:tstring_content, :ident).source.to_sym
         | 
| 87 | 
            +
                    end
         | 
| 88 | 
            +
             | 
| 89 | 
            +
                    def comment
         | 
| 90 | 
            +
                      return unless options.key?("comment:")
         | 
| 91 | 
            +
             | 
| 92 | 
            +
                      options["comment:"].jump(:tstring_content, :ident).source
         | 
| 93 | 
            +
                    end
         | 
| 94 | 
            +
             | 
| 95 | 
            +
                    def default_string
         | 
| 96 | 
            +
                      return options["default:"][1].source if options.key?("default:")
         | 
| 97 | 
            +
             | 
| 98 | 
            +
                      "nil" if options.key?("optional:") && options["optional:"].jump(:tstring_content, :ident).source == "true"
         | 
| 99 | 
            +
                    end
         | 
| 100 | 
            +
                  end
         | 
| 101 | 
            +
                end
         | 
| 102 | 
            +
              end
         | 
| 103 | 
            +
            end
         | 
| @@ -0,0 +1,38 @@ | |
| 1 | 
            +
            # frozen_string_literal: true
         | 
| 2 | 
            +
             | 
| 3 | 
            +
            module Ariadne
         | 
| 4 | 
            +
              module Yard
         | 
| 5 | 
            +
                module DryInitializer
         | 
| 6 | 
            +
                  # :nodoc:
         | 
| 7 | 
            +
                  class OptionHandler < ::YARD::Handlers::Ruby::Base
         | 
| 8 | 
            +
                    include CommonHandler
         | 
| 9 | 
            +
             | 
| 10 | 
            +
                    handles method_call(:option)
         | 
| 11 | 
            +
                    namespace_only
         | 
| 12 | 
            +
             | 
| 13 | 
            +
                    def process
         | 
| 14 | 
            +
                      super
         | 
| 15 | 
            +
             | 
| 16 | 
            +
                      parsed_docstring = YARD::DocstringParser.new.parse(statement.docstring)
         | 
| 17 | 
            +
                      existing_tag = parsed_docstring.tags.find { |t| t.name == definition_name }
         | 
| 18 | 
            +
             | 
| 19 | 
            +
                      # missing documentation
         | 
| 20 | 
            +
                      if existing_tag.nil?
         | 
| 21 | 
            +
             | 
| 22 | 
            +
                      else
         | 
| 23 | 
            +
                        defaults = existing_tag.defaults
         | 
| 24 | 
            +
                        defaults = defaults.join if defaults
         | 
| 25 | 
            +
             | 
| 26 | 
            +
                        # only docstring has complete description past newlines
         | 
| 27 | 
            +
                        docstring = statement.docstring.tr("\n", " ")
         | 
| 28 | 
            +
             | 
| 29 | 
            +
                        # strip out everything except description
         | 
| 30 | 
            +
                        docstring = docstring[docstring.index(existing_tag.text)..]
         | 
| 31 | 
            +
             | 
| 32 | 
            +
                        constructor.add_tag(YARD::Tags::DefaultTag.new(:param, docstring, existing_tag.types, existing_tag.name, defaults))
         | 
| 33 | 
            +
                      end
         | 
| 34 | 
            +
                    end
         | 
| 35 | 
            +
                  end
         | 
| 36 | 
            +
                end
         | 
| 37 | 
            +
              end
         | 
| 38 | 
            +
            end
         | 
| @@ -0,0 +1,57 @@ | |
| 1 | 
            +
            # frozen_string_literal: true
         | 
| 2 | 
            +
             | 
| 3 | 
            +
            module Ariadne
         | 
| 4 | 
            +
              module Yard
         | 
| 5 | 
            +
                module DryInitializer
         | 
| 6 | 
            +
                  class ParamHandler < ::YARD::Handlers::Ruby::Base
         | 
| 7 | 
            +
                    include CommonHandler
         | 
| 8 | 
            +
             | 
| 9 | 
            +
                    handles method_call(:param)
         | 
| 10 | 
            +
                    namespace_only
         | 
| 11 | 
            +
             | 
| 12 | 
            +
                    def process
         | 
| 13 | 
            +
                      super
         | 
| 14 | 
            +
             | 
| 15 | 
            +
                      add_constructor_param
         | 
| 16 | 
            +
                      add_constructor_tag
         | 
| 17 | 
            +
                    end
         | 
| 18 | 
            +
             | 
| 19 | 
            +
                    protected
         | 
| 20 | 
            +
             | 
| 21 | 
            +
                    def add_constructor_param
         | 
| 22 | 
            +
                      existing_index = constructor.parameters.index do |name, _default|
         | 
| 23 | 
            +
                        name == definition_name
         | 
| 24 | 
            +
                      end
         | 
| 25 | 
            +
                      if existing_index
         | 
| 26 | 
            +
                        constructor.parameters[existing_index] = [definition_name, default_string]
         | 
| 27 | 
            +
                      else
         | 
| 28 | 
            +
                        constructor.parameters.insert(last_param_index, [definition_name, default_string])
         | 
| 29 | 
            +
                      end
         | 
| 30 | 
            +
                    end
         | 
| 31 | 
            +
             | 
| 32 | 
            +
                    def last_param_index
         | 
| 33 | 
            +
                      return -1 if constructor.parameters.empty?
         | 
| 34 | 
            +
             | 
| 35 | 
            +
                      constructor.parameters.last.first.start_with?("**") ? -2 : -1
         | 
| 36 | 
            +
                    end
         | 
| 37 | 
            +
             | 
| 38 | 
            +
                    def add_constructor_tag
         | 
| 39 | 
            +
                      if existing_tag
         | 
| 40 | 
            +
                        existing_tag.text = comment
         | 
| 41 | 
            +
                        existing_tag.instance_variable_set(:@defaults, default_string && [default_string])
         | 
| 42 | 
            +
                      else
         | 
| 43 | 
            +
                        param = YARD::Tags::DefaultTag.new(:param, comment, nil, definition_name, [default_string])
         | 
| 44 | 
            +
                        constructor.add_tag(param)
         | 
| 45 | 
            +
                      end
         | 
| 46 | 
            +
                    end
         | 
| 47 | 
            +
             | 
| 48 | 
            +
                    def existing_tag
         | 
| 49 | 
            +
                      @existing_tag ||=
         | 
| 50 | 
            +
                        constructor.tags.find do |tag|
         | 
| 51 | 
            +
                          tag.name == definition_name && tag.tag_name == "param"
         | 
| 52 | 
            +
                        end
         | 
| 53 | 
            +
                    end
         | 
| 54 | 
            +
                  end
         | 
| 55 | 
            +
                end
         | 
| 56 | 
            +
              end
         | 
| 57 | 
            +
            end
         | 
| @@ -22,16 +22,13 @@ module Ariadne | |
| 22 22 |  | 
| 23 23 | 
             
                  def metadata
         | 
| 24 24 | 
             
                    @metadata ||= begin
         | 
| 25 | 
            -
                       | 
| 26 | 
            -
                      status = component.status.to_s
         | 
| 25 | 
            +
                      class_name, short_name = component_and_short_name(component)
         | 
| 27 26 | 
             
                      a11y_reviewed = component.audited_at.nil? ? "false" : "true"
         | 
| 28 27 |  | 
| 29 28 | 
             
                      {
         | 
| 30 29 | 
             
                        title: class_name,
         | 
| 31 30 | 
             
                        class_name: class_name,
         | 
| 32 31 | 
             
                        component_id: short_name.underscore,
         | 
| 33 | 
            -
                        status: status.capitalize,
         | 
| 34 | 
            -
                        status_module: status_module,
         | 
| 35 32 | 
             
                        short_name: short_name,
         | 
| 36 33 | 
             
                        a11y_reviewed: a11y_reviewed,
         | 
| 37 34 | 
             
                      }
         | 
| @@ -99,7 +96,7 @@ module Ariadne | |
| 99 96 | 
             
                # documentation.
         | 
| 100 97 | 
             
                class Registry
         | 
| 101 98 | 
             
                  class << self
         | 
| 102 | 
            -
                    include ViewComponent::TestHelpers
         | 
| 99 | 
            +
                    include ::ViewComponent::TestHelpers
         | 
| 103 100 | 
             
                    include Ariadne::ViewHelper
         | 
| 104 101 | 
             
                    include Ariadne::Yard::DocsHelper
         | 
| 105 102 |  | 
| @@ -4,15 +4,15 @@ | |
| 4 4 | 
             
            module Ariadne
         | 
| 5 5 | 
             
              module Yard
         | 
| 6 6 | 
             
                # Helper methods to use for info arch yard documentation
         | 
| 7 | 
            -
                module  | 
| 7 | 
            +
                module StructureDocsHelper
         | 
| 8 8 | 
             
                  include DocsHelper
         | 
| 9 9 |  | 
| 10 10 | 
             
                  def link_to_component(component)
         | 
| 11 11 | 
             
                    "{{#link_to_component}}#{component}{{/link_to_component}}"
         | 
| 12 12 | 
             
                  end
         | 
| 13 13 |  | 
| 14 | 
            -
                  def  | 
| 15 | 
            -
                    "{{ | 
| 14 | 
            +
                  def link_to_html_attrs_docs
         | 
| 15 | 
            +
                    "{{link_to_html_attrs_docs}}"
         | 
| 16 16 | 
             
                  end
         | 
| 17 17 |  | 
| 18 18 | 
             
                  def link_to_typography_docs
         | 
| @@ -23,8 +23,8 @@ module Ariadne | |
| 23 23 | 
             
                    "{{link_to_accessibility}}"
         | 
| 24 24 | 
             
                  end
         | 
| 25 25 |  | 
| 26 | 
            -
                  def  | 
| 27 | 
            -
                    "{{ | 
| 26 | 
            +
                  def link_to_heroicons
         | 
| 27 | 
            +
                    "{{link_to_heroicons}}"
         | 
| 28 28 | 
             
                  end
         | 
| 29 29 | 
             
                end
         | 
| 30 30 | 
             
              end
         | 
    
        data/lib/ariadne/yard.rb
    CHANGED
    
    | @@ -1,18 +1,30 @@ | |
| 1 1 | 
             
            # frozen_string_literal: true
         | 
| 2 2 |  | 
| 3 | 
            +
            require "rails"
         | 
| 3 4 | 
             
            require "yard"
         | 
| 5 | 
            +
            require "ariadne/yard/renders_one_handler"
         | 
| 6 | 
            +
            require "ariadne/yard/renders_many_handler"
         | 
| 7 | 
            +
            require "ariadne/yard/dry_initializer/common_handler"
         | 
| 8 | 
            +
            require "ariadne/yard/dry_initializer/param_handler"
         | 
| 9 | 
            +
            require "ariadne/yard/dry_initializer/option_handler"
         | 
| 10 | 
            +
            require "view_component-contrib"
         | 
| 4 11 |  | 
| 5 12 | 
             
            module Ariadne
         | 
| 6 13 | 
             
              # :nodoc:
         | 
| 7 14 | 
             
              module Yard
         | 
| 8 | 
            -
                autoload :Backend, | 
| 9 | 
            -
                autoload :ComponentManifest,  " | 
| 10 | 
            -
                autoload :ComponentRef,       " | 
| 11 | 
            -
                autoload :DocsHelper, | 
| 12 | 
            -
                autoload : | 
| 13 | 
            -
                autoload :Registry,           " | 
| 14 | 
            -
                autoload :RendersManyHandler, " | 
| 15 | 
            -
                autoload :RendersOneHandler,  " | 
| 15 | 
            +
                autoload :Backend, "ariadne/yard/backend"
         | 
| 16 | 
            +
                autoload :ComponentManifest,  "ariadne/yard/component_manifest"
         | 
| 17 | 
            +
                autoload :ComponentRef,       "ariadne/yard/component_ref"
         | 
| 18 | 
            +
                autoload :DocsHelper, "ariadne/yard/docs_helper"
         | 
| 19 | 
            +
                autoload :StructureDocsHelper, "ariadne/yard/structure_docs_helper"
         | 
| 20 | 
            +
                autoload :Registry,           "ariadne/yard/registry"
         | 
| 21 | 
            +
                autoload :RendersManyHandler, "ariadne/yard/renders_many_handler"
         | 
| 22 | 
            +
                autoload :RendersOneHandler,  "ariadne/yard/renders_one_handler"
         | 
| 23 | 
            +
             | 
| 24 | 
            +
                # for dry-initializer
         | 
| 25 | 
            +
                autoload :CommonHandler, "ariadne/yard/dry_initializer/common_handler"
         | 
| 26 | 
            +
                autoload :OptionHandler, "ariadne/yard/dry_initializer/option_handler"
         | 
| 27 | 
            +
                autoload :ParamHandler, "ariadne/yard/dry_initializer/param_handler"
         | 
| 16 28 |  | 
| 17 29 | 
             
                ::YARD::Tags::Library.define_tag("Snapshot preview", :snapshot)
         | 
| 18 30 | 
             
              end
         | 
    
        metadata
    CHANGED
    
    | @@ -1,14 +1,14 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: ariadne_view_components
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 0.0. | 
| 4 | 
            +
              version: 0.0.94
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - Garen J. Torikian
         | 
| 8 | 
            -
            autorequire: | 
| 8 | 
            +
            autorequire:
         | 
| 9 9 | 
             
            bindir: bin
         | 
| 10 10 | 
             
            cert_chain: []
         | 
| 11 | 
            -
            date:  | 
| 11 | 
            +
            date: 2025-02-05 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies:
         | 
| 13 13 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 14 14 | 
             
              name: tailwind_merge
         | 
| @@ -16,14 +16,14 @@ dependencies: | |
| 16 16 | 
             
                requirements:
         | 
| 17 17 | 
             
                - - "~>"
         | 
| 18 18 | 
             
                  - !ruby/object:Gem::Version
         | 
| 19 | 
            -
                    version: '0. | 
| 19 | 
            +
                    version: '0.13'
         | 
| 20 20 | 
             
              type: :runtime
         | 
| 21 21 | 
             
              prerelease: false
         | 
| 22 22 | 
             
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 23 23 | 
             
                requirements:
         | 
| 24 24 | 
             
                - - "~>"
         | 
| 25 25 | 
             
                  - !ruby/object:Gem::Version
         | 
| 26 | 
            -
                    version: '0. | 
| 26 | 
            +
                    version: '0.13'
         | 
| 27 27 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 28 28 | 
             
              name: actionview
         | 
| 29 29 | 
             
              requirement: !ruby/object:Gem::Requirement
         | 
| @@ -108,7 +108,7 @@ dependencies: | |
| 108 108 | 
             
                - - "~>"
         | 
| 109 109 | 
             
                  - !ruby/object:Gem::Version
         | 
| 110 110 | 
             
                    version: '0.2'
         | 
| 111 | 
            -
            description: | 
| 111 | 
            +
            description:
         | 
| 112 112 | 
             
            email:
         | 
| 113 113 | 
             
            - gjtorikian@yetto.app
         | 
| 114 114 | 
             
            executables: []
         | 
| @@ -127,7 +127,6 @@ files: | |
| 127 127 | 
             
            - app/assets/stylesheets/ariadne_view_components.css.gz
         | 
| 128 128 | 
             
            - app/components/ariadne/ariadne-form.ts
         | 
| 129 129 | 
             
            - app/components/ariadne/base_component.rb
         | 
| 130 | 
            -
            - app/components/ariadne/behaviors/captionable.rb
         | 
| 131 130 | 
             
            - app/components/ariadne/behaviors/tooltipable.rb
         | 
| 132 131 | 
             
            - app/components/ariadne/conditional_wrapper.rb
         | 
| 133 132 | 
             
            - app/components/ariadne/form/base_component.rb
         | 
| @@ -182,10 +181,6 @@ files: | |
| 182 181 | 
             
            - app/components/ariadne/layout/two_panel/component.rb
         | 
| 183 182 | 
             
            - app/components/ariadne/layout/wide/component.html.erb
         | 
| 184 183 | 
             
            - app/components/ariadne/layout/wide/component.rb
         | 
| 185 | 
            -
            - app/components/ariadne/turbo/frame/component.html.erb
         | 
| 186 | 
            -
            - app/components/ariadne/turbo/frame/component.rb
         | 
| 187 | 
            -
            - app/components/ariadne/turbo/stream_action/component.html.erb
         | 
| 188 | 
            -
            - app/components/ariadne/turbo/stream_action/component.rb
         | 
| 189 184 | 
             
            - app/components/ariadne/ui/accordion/component.html.erb
         | 
| 190 185 | 
             
            - app/components/ariadne/ui/accordion/component.rb
         | 
| 191 186 | 
             
            - app/components/ariadne/ui/accordion/component.ts
         | 
| @@ -195,6 +190,9 @@ files: | |
| 195 190 | 
             
            - app/components/ariadne/ui/avatar/component.rb
         | 
| 196 191 | 
             
            - app/components/ariadne/ui/badge/component.html.erb
         | 
| 197 192 | 
             
            - app/components/ariadne/ui/badge/component.rb
         | 
| 193 | 
            +
            - app/components/ariadne/ui/banner/component.html.erb
         | 
| 194 | 
            +
            - app/components/ariadne/ui/banner/component.rb
         | 
| 195 | 
            +
            - app/components/ariadne/ui/banner/component.ts
         | 
| 198 196 | 
             
            - app/components/ariadne/ui/blankslate/component.html.erb
         | 
| 199 197 | 
             
            - app/components/ariadne/ui/blankslate/component.rb
         | 
| 200 198 | 
             
            - app/components/ariadne/ui/button/component.html.erb
         | 
| @@ -215,14 +213,13 @@ files: | |
| 215 213 | 
             
            - app/components/ariadne/ui/combobox/component.html.erb
         | 
| 216 214 | 
             
            - app/components/ariadne/ui/combobox/component.rb
         | 
| 217 215 | 
             
            - app/components/ariadne/ui/combobox/component.ts
         | 
| 218 | 
            -
            - app/components/ariadne/ui/ | 
| 219 | 
            -
            - app/components/ariadne/ui/ | 
| 216 | 
            +
            - app/components/ariadne/ui/dialog/body/component.html.erb
         | 
| 217 | 
            +
            - app/components/ariadne/ui/dialog/body/component.rb
         | 
| 220 218 | 
             
            - app/components/ariadne/ui/dialog/component.html.erb
         | 
| 221 219 | 
             
            - app/components/ariadne/ui/dialog/component.rb
         | 
| 222 220 | 
             
            - app/components/ariadne/ui/dialog/component.ts
         | 
| 223 | 
            -
            - app/components/ariadne/ui/ | 
| 224 | 
            -
            - app/components/ariadne/ui/ | 
| 225 | 
            -
            - app/components/ariadne/ui/flash/component.ts
         | 
| 221 | 
            +
            - app/components/ariadne/ui/dialog/footer/component.html.erb
         | 
| 222 | 
            +
            - app/components/ariadne/ui/dialog/footer/component.rb
         | 
| 226 223 | 
             
            - app/components/ariadne/ui/heroicon/component.html.erb
         | 
| 227 224 | 
             
            - app/components/ariadne/ui/heroicon/component.rb
         | 
| 228 225 | 
             
            - app/components/ariadne/ui/image/component.rb
         | 
| @@ -233,14 +230,15 @@ files: | |
| 233 230 | 
             
            - app/components/ariadne/ui/list/component.ts
         | 
| 234 231 | 
             
            - app/components/ariadne/ui/list/item/component.html.erb
         | 
| 235 232 | 
             
            - app/components/ariadne/ui/list/item/component.rb
         | 
| 236 | 
            -
            - app/components/ariadne/ui/overlay/component.html.erb
         | 
| 237 | 
            -
            - app/components/ariadne/ui/overlay/component.rb
         | 
| 238 | 
            -
            - app/components/ariadne/ui/overlay/component.ts
         | 
| 239 233 | 
             
            - app/components/ariadne/ui/pagination/component.html.erb
         | 
| 240 234 | 
             
            - app/components/ariadne/ui/pagination/component.rb
         | 
| 241 235 | 
             
            - app/components/ariadne/ui/popover/component.html.erb
         | 
| 242 236 | 
             
            - app/components/ariadne/ui/popover/component.rb
         | 
| 243 237 | 
             
            - app/components/ariadne/ui/popover/component.ts
         | 
| 238 | 
            +
            - app/components/ariadne/ui/relative_time/component.html.erb
         | 
| 239 | 
            +
            - app/components/ariadne/ui/relative_time/component.rb
         | 
| 240 | 
            +
            - app/components/ariadne/ui/relative_time/component.ts
         | 
| 241 | 
            +
            - app/components/ariadne/ui/relative_time/en.yml
         | 
| 244 242 | 
             
            - app/components/ariadne/ui/shortcut/component.html.erb
         | 
| 245 243 | 
             
            - app/components/ariadne/ui/shortcut/component.rb
         | 
| 246 244 | 
             
            - app/components/ariadne/ui/shortcut/component.ts
         | 
| @@ -260,10 +258,6 @@ files: | |
| 260 258 | 
             
            - app/components/ariadne/ui/table/header/component.rb
         | 
| 261 259 | 
             
            - app/components/ariadne/ui/table/row/component.html.erb
         | 
| 262 260 | 
             
            - app/components/ariadne/ui/table/row/component.rb
         | 
| 263 | 
            -
            - app/components/ariadne/ui/time_ago/component.html.erb
         | 
| 264 | 
            -
            - app/components/ariadne/ui/time_ago/component.rb
         | 
| 265 | 
            -
            - app/components/ariadne/ui/time_ago/component.ts
         | 
| 266 | 
            -
            - app/components/ariadne/ui/time_ago/en.yml
         | 
| 267 261 | 
             
            - app/components/ariadne/ui/typography/component.html.erb
         | 
| 268 262 | 
             
            - app/components/ariadne/ui/typography/component.rb
         | 
| 269 263 | 
             
            - app/frontend/ariadne/index.ts
         | 
| @@ -275,9 +269,12 @@ files: | |
| 275 269 | 
             
            - app/frontend/entrypoints/application.ts
         | 
| 276 270 | 
             
            - app/frontend/stylesheets/ariadne_view_components.css
         | 
| 277 271 | 
             
            - app/frontend/stylesheets/scrollbar.css
         | 
| 272 | 
            +
            - app/frontend/stylesheets/theme.css
         | 
| 278 273 | 
             
            - app/frontend/utils/createController.ts
         | 
| 279 274 | 
             
            - app/frontend/utils/isMac.ts
         | 
| 275 | 
            +
            - app/helpers/ariadne/color_helper.rb
         | 
| 280 276 | 
             
            - app/helpers/ariadne/form_helper.rb
         | 
| 277 | 
            +
            - app/helpers/ariadne/size_helper.rb
         | 
| 281 278 | 
             
            - app/lib/ariadne/attributes_helper.rb
         | 
| 282 279 | 
             
            - app/lib/ariadne/class_name_helper.rb
         | 
| 283 280 | 
             
            - app/lib/ariadne/fetch_or_fallback_helper.rb
         | 
| @@ -287,6 +284,7 @@ files: | |
| 287 284 | 
             
            - app/lib/ariadne/view_component/html_attrs.rb
         | 
| 288 285 | 
             
            - app/lib/ariadne/view_component/style_variants.rb
         | 
| 289 286 | 
             
            - app/lib/ariadne/view_helper.rb
         | 
| 287 | 
            +
            - lib/ariadne/accessibility.rb
         | 
| 290 288 | 
             
            - lib/ariadne/forms/acts_as_component.rb
         | 
| 291 289 | 
             
            - lib/ariadne/forms/base.html.erb
         | 
| 292 290 | 
             
            - lib/ariadne/forms/base.rb
         | 
| @@ -307,8 +305,14 @@ files: | |
| 307 305 | 
             
            - lib/ariadne/forms/dsl/submit_button_input.rb
         | 
| 308 306 | 
             
            - lib/ariadne/forms/dsl/text_field_input.rb
         | 
| 309 307 | 
             
            - lib/ariadne/forms/utils.rb
         | 
| 308 | 
            +
            - lib/ariadne/static.rb
         | 
| 309 | 
            +
            - lib/ariadne/static/generate_arguments.rb
         | 
| 310 | 
            +
            - lib/ariadne/static/generate_audited_at.rb
         | 
| 311 | 
            +
            - lib/ariadne/static/generate_constants.rb
         | 
| 312 | 
            +
            - lib/ariadne/static/generate_previews.rb
         | 
| 313 | 
            +
            - lib/ariadne/static/generate_statuses.rb
         | 
| 314 | 
            +
            - lib/ariadne/static/generate_structure.rb
         | 
| 310 315 | 
             
            - lib/ariadne/view_components.rb
         | 
| 311 | 
            -
            - lib/ariadne/view_components/commands.rb
         | 
| 312 316 | 
             
            - lib/ariadne/view_components/constants.rb
         | 
| 313 317 | 
             
            - lib/ariadne/view_components/engine.rb
         | 
| 314 318 | 
             
            - lib/ariadne/view_components/linters.rb
         | 
| @@ -316,35 +320,28 @@ files: | |
| 316 320 | 
             
            - lib/ariadne/view_components/linters/autocorrectable.rb
         | 
| 317 321 | 
             
            - lib/ariadne/view_components/linters/base_linter.rb
         | 
| 318 322 | 
             
            - lib/ariadne/view_components/linters/tag_tree_helpers.rb
         | 
| 319 | 
            -
            - lib/ariadne/view_components/statuses.rb
         | 
| 320 | 
            -
            - lib/ariadne/view_components/upstream.rb
         | 
| 321 323 | 
             
            - lib/ariadne/view_components/version.rb
         | 
| 322 324 | 
             
            - lib/ariadne/yard.rb
         | 
| 323 325 | 
             
            - lib/ariadne/yard/backend.rb
         | 
| 324 326 | 
             
            - lib/ariadne/yard/component_manifest.rb
         | 
| 325 327 | 
             
            - lib/ariadne/yard/component_ref.rb
         | 
| 326 328 | 
             
            - lib/ariadne/yard/docs_helper.rb
         | 
| 327 | 
            -
            - lib/ariadne/yard/ | 
| 329 | 
            +
            - lib/ariadne/yard/dry_initializer/common_handler.rb
         | 
| 330 | 
            +
            - lib/ariadne/yard/dry_initializer/option_handler.rb
         | 
| 331 | 
            +
            - lib/ariadne/yard/dry_initializer/param_handler.rb
         | 
| 328 332 | 
             
            - lib/ariadne/yard/lookbook_docs_helper.rb
         | 
| 329 | 
            -
            - lib/ariadne/yard/lookbook_pages_backend.rb
         | 
| 330 333 | 
             
            - lib/ariadne/yard/registry.rb
         | 
| 331 334 | 
             
            - lib/ariadne/yard/renders_many_handler.rb
         | 
| 332 335 | 
             
            - lib/ariadne/yard/renders_one_handler.rb
         | 
| 336 | 
            +
            - lib/ariadne/yard/structure_docs_helper.rb
         | 
| 333 337 | 
             
            - lib/rubocop/config/default.yml
         | 
| 334 338 | 
             
            - lib/rubocop/cop/ariadne.rb
         | 
| 335 | 
            -
            - lib/rubocop/cop/ariadne/no_tag_memoize.rb
         | 
| 336 | 
            -
            - static/arguments.yml
         | 
| 337 | 
            -
            - static/assets/view-components.svg
         | 
| 338 | 
            -
            - static/classes.yml
         | 
| 339 | 
            -
            - static/constants.json
         | 
| 340 | 
            -
            - static/statuses.json
         | 
| 341 | 
            -
            - static/tailwindcss.yml
         | 
| 342 339 | 
             
            homepage: https://github.com/yettoapp/ariadne
         | 
| 343 340 | 
             
            licenses:
         | 
| 344 341 | 
             
            - AGPL-3.0-or-later
         | 
| 345 342 | 
             
            metadata:
         | 
| 346 343 | 
             
              allowed_push_host: https://rubygems.org
         | 
| 347 | 
            -
            post_install_message: | 
| 344 | 
            +
            post_install_message:
         | 
| 348 345 | 
             
            rdoc_options: []
         | 
| 349 346 | 
             
            require_paths:
         | 
| 350 347 | 
             
            - lib
         | 
| @@ -360,7 +357,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement | |
| 360 357 | 
             
                  version: '0'
         | 
| 361 358 | 
             
            requirements: []
         | 
| 362 359 | 
             
            rubygems_version: 3.5.22
         | 
| 363 | 
            -
            signing_key: | 
| 360 | 
            +
            signing_key:
         | 
| 364 361 | 
             
            specification_version: 4
         | 
| 365 362 | 
             
            summary: ViewComponents + TailwindCSS + Stimulus
         | 
| 366 363 | 
             
            test_files: []
         | 
| @@ -1,55 +0,0 @@ | |
| 1 | 
            -
            # frozen_string_literal: true
         | 
| 2 | 
            -
             | 
| 3 | 
            -
            module Ariadne
         | 
| 4 | 
            -
              module Behaviors
         | 
| 5 | 
            -
                module Captionable
         | 
| 6 | 
            -
                  def with_caption(text, **options)
         | 
| 7 | 
            -
                    @caption_id = ::Ariadne::ViewHelper.generate_id
         | 
| 8 | 
            -
             | 
| 9 | 
            -
                    Ariadne::Behaviors::Caption.new(id: @caption_id, text: text, component: self, **options)
         | 
| 10 | 
            -
                  end
         | 
| 11 | 
            -
                end
         | 
| 12 | 
            -
             | 
| 13 | 
            -
                class Caption < Ariadne::BaseComponent
         | 
| 14 | 
            -
                  option :id
         | 
| 15 | 
            -
                  option :text
         | 
| 16 | 
            -
                  option :component
         | 
| 17 | 
            -
                  option :size, default: -> { :sm }
         | 
| 18 | 
            -
             | 
| 19 | 
            -
                  erb_template <<~ERB
         | 
| 20 | 
            -
                    <div data-controller="ariadne-tooltip",>
         | 
| 21 | 
            -
                      <%= render(component) { content } %>
         | 
| 22 | 
            -
                      <p class="<%= style(:text) %>"><%= text %></p>
         | 
| 23 | 
            -
                    </div>
         | 
| 24 | 
            -
                  ERB
         | 
| 25 | 
            -
             | 
| 26 | 
            -
                  style do
         | 
| 27 | 
            -
                    base do
         | 
| 28 | 
            -
                      [
         | 
| 29 | 
            -
                        "ariadne-text-gray-500",
         | 
| 30 | 
            -
                      ]
         | 
| 31 | 
            -
                    end
         | 
| 32 | 
            -
             | 
| 33 | 
            -
                    variants do
         | 
| 34 | 
            -
                      size do
         | 
| 35 | 
            -
                        # w-36
         | 
| 36 | 
            -
                        sm { "max-w-[min(144px,90vw)]" }
         | 
| 37 | 
            -
                        # w-52
         | 
| 38 | 
            -
                        md { "max-w-[min(208px,90vw)]" }
         | 
| 39 | 
            -
                        # w-96
         | 
| 40 | 
            -
                        lg { "max-w-[min(384px,90vw)]" }
         | 
| 41 | 
            -
                      end
         | 
| 42 | 
            -
                    end
         | 
| 43 | 
            -
                  end
         | 
| 44 | 
            -
             | 
| 45 | 
            -
                  style :text do
         | 
| 46 | 
            -
                    base do
         | 
| 47 | 
            -
                      [
         | 
| 48 | 
            -
                        "text-sm",
         | 
| 49 | 
            -
                        "ariadne-text-gray-500",
         | 
| 50 | 
            -
                      ]
         | 
| 51 | 
            -
                    end
         | 
| 52 | 
            -
                  end
         | 
| 53 | 
            -
                end
         | 
| 54 | 
            -
              end
         | 
| 55 | 
            -
            end
         |