Sha256: 56a42be0f29e4ebe4158effede872860bb43c4e1c822d2ebf355871f8816c317
Contents?: true
Size: 1.19 KB
Versions: 20
Compression:
Stored size: 1.19 KB
Contents
# typed: false # frozen_string_literal: true module Ariadne module Form module ToggleGroup module Option class Component < Ariadne::BaseComponent option :name option :value option :label option :type option :checked, default: proc { false } accepts_html_attributes do |html_attrs| html_attrs[:class] = Ariadne::ViewComponents.tailwind_merger.merge([style(:tab), html_attrs[:class]].join(" ")) end def input_type if type == :multiple "checkbox" elsif type == :single "radio" else raise ArgumentError, "Unknown type: #{type}" end end style :tab do base do [ "ariadne-px-1.5", "ariadne-rounded-md", "ariadne-opacity-75", "has-[:checked]:ariadne-shadow-sm", "has-[:checked]:ariadne-opacity-100", "has-[:checked]:ariadne-bg-white", "dark:has-[:checked]:ariadne-bg-white/20", ] end end end end end end end
Version data entries
20 entries across 20 versions & 1 rubygems